Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the resiliency module for Powerstore operator support in Installation Wizard UI #745

Merged
merged 4 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ volNamePrefix=csivol
snapNamePrefix=csi-snap
certSecretCount=1
pollRate=60
driverPodLabel=dell-storage
driverPodLabel=dell-storage
arrayThreshold=3
18 changes: 18 additions & 0 deletions content/docs/deployment/csminstallationwizard/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@
<label for="connection-validation" class="form-check-label ms-2 text-dark" data-bs-toggle="tooltip" data-bs-placement="right" title="Enable/Disable, if set to true will cause controllerPodCleanup to skip the validation that no I/O is ongoing before cleaning up the pod">Skip Array Connection Validation</label>
</div>
</div>
<div class="row mt-3 child-level-one" id="leader-election-wrapper">
<div class="col-sm-12">
<input class="form-check-input" type="checkbox" id="leader-election" value="">
<label for="leader-election" class="form-check-label ms-2 text-dark" data-bs-toggle="tooltip" data-bs-placement="right" title="Enable/Disable Leader election to keep only one controller is active at a time.">Leader Election</label>
</div>
</div>
<div class="was-validated row mt-3 child-level-one" id="driver-pod-label-value">
<label for="driver-pod-label" class="col-sm-3 col-form-label" data-bs-toggle="tooltip" data-bs-placement="right" title="Provide Driver Pod Label Value">Driver Pod Label Value</label>
<div class="col-sm-9"></div>
Expand All @@ -183,6 +189,18 @@
<label for="volumeless-pods" class="form-check-label ms-2 text-dark" data-bs-toggle="tooltip" data-bs-placement="right" title="Enable/Disable, if set to true will enable CSM for Resiliency to ignore pods without persistent volume attached to the pod.">Ignore Volumeless Pods</label>
</div>
</div>
<div class="was-validated row mt-3 child-level-one" id="array-connectionloss-threshold">
<label for="array-threshold" class="col-sm-3 col-form-label" data-bs-toggle="tooltip" data-bs-placement="right" title="Gives the number of failed connection polls that will indicate array connectivity loss. Should not be set to less than 3.">Array Connectivity ConnectionLoss Threshold</label>
<div class="col-sm-9"></div>
<div class="col-sm-2">
<input class="form-control input-lg" type="number" id="array-threshold" placeholder="3" min="3" oninput="validateInput(validateForm, CONSTANTS)" required>
</div>
<div class="col-sm-4">
<div class="row mt-1">
<a class="reset" id="reset-array-connectionloss-threshold" onclick="resetArrayConnectionLossThreshold(csmMap)">Reset to default</a>
</div>
</div>
</div>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ function setValues(csmMapValues, CONSTANTS_PARAM) {
DriverValues.driverNamespace = document.getElementById("driver-namespace").value;
DriverValues.labelValue = document.getElementById("label-value").value;
DriverValues.pollRate = document.getElementById("poll-rate").value;
DriverValues.arrayThreshold = document.getElementById("array-threshold").value;
DriverValues.driverPodLabel = document.getElementById("driver-pod-label").value;
DriverValues.connectionValidation = $("#connection-validation").prop('checked') ? true : false;
DriverValues.leaderElection = $("#leader-election").prop('checked') ? true : false;
DriverValues.volumelessPods = $("#volumeless-pods").prop('checked') ? true : false;
DriverValues.controllerPodsNodeSelector = $("#controller-pods-node-selector").prop('checked') ? true : "";
DriverValues.nodePodsNodeSelector = $("#node-pods-node-selector").prop('checked') ? true : "";
Expand Down Expand Up @@ -133,8 +135,10 @@ function createYamlString(yamlTpl, yamlTplValues, driverParam, CONSTANTS_PARAM)
yamlTpl = yamlTpl.replaceAll("$OPERATOR_RESILIENCY_ENABLED", yamlTplValues.operatorResiliency);
yamlTpl = yamlTpl.replaceAll("$LABEL_VALUE", yamlTplValues.labelValue);
yamlTpl = yamlTpl.replaceAll("$POLL_RATE", yamlTplValues.pollRate);
yamlTpl = yamlTpl.replaceAll("$ARRAY_THRESHOLD", yamlTplValues.arrayThreshold);
yamlTpl = yamlTpl.replaceAll("$DRIVER_POD_LABEL_VALUE", yamlTplValues.driverPodLabel);
yamlTpl = yamlTpl.replaceAll("$SKIP_ARRAY_CONNECTION_VALIDATION", yamlTplValues.connectionValidation);
yamlTpl = yamlTpl.replaceAll("$LEADER_ELECTION", yamlTplValues.leaderElection);
yamlTpl = yamlTpl.replaceAll("$IGNORE_VOLUMELESS_PODS", yamlTplValues.volumelessPods);
yamlTpl = yamlTpl.replaceAll("$STORAGE_CAPACITY_ENABLED", yamlTplValues.storageCapacity);
yamlTpl = yamlTpl.replaceAll("$MONITOR_ENABLED", yamlTplValues.monitor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@ describe("GIVEN setValues function", () => {
<input type="text" id="driver-namespace" value="">
<input type="text" id="label-value" value="">
<input type="number" id="poll-rate" value="60">
<input type="number" id="array-threshold" value="3">
<input type="text" id="driver-pod-label" value="dell-storage">
<input type="checkbox" id="volumeless-pods">
<input type="checkbox" id="connection-validation">
<input type="checkbox" id="leader-election">
<input type="text" id="authorization-proxy-host" value="">
<input type="text" id="taint" value="node-role.kubernetes.io/control-plane">
`;
Expand Down Expand Up @@ -143,8 +145,10 @@ describe("GIVEN setValues function", () => {
operatorResiliency: false,
labelValue: "",
pollRate: '60',
arrayThreshold: '3',
driverPodLabel: 'dell-storage',
connectionValidation: false,
leaderElection: false,
volumelessPods: false,
clusterPrefix: undefined,
portGroups: undefined,
Expand Down Expand Up @@ -183,9 +187,11 @@ describe("GIVEN setValues function", () => {
<input type="text" id="taint" value="node-role.kubernetes.io/control-plane">
<input type="text" id="label-value" value="">
<input type="number" id="poll-rate" value="60">
<input type="number" id="array-threshold" value="3">
<input type="text" id="driver-pod-label" value="dell-storage">
<input type="checkbox" id="volumeless-pods">
<input type="checkbox" id="connection-validation">
<input type="checkbox" id="leader-election">
`;

const expected = {
Expand Down Expand Up @@ -230,8 +236,10 @@ describe("GIVEN setValues function", () => {
operatorResiliency: false,
labelValue: "",
pollRate: '60',
arrayThreshold: '3',
driverPodLabel: 'dell-storage',
connectionValidation: false,
leaderElection: false,
volumelessPods: false,
clusterPrefix: undefined,
portGroups: undefined,
Expand Down Expand Up @@ -270,9 +278,11 @@ describe("GIVEN setValues function", () => {
<input type="text" id="taint" value="node-role.kubernetes.io/control-plane">
<input type="text" id="label-value" value="">
<input type="number" id="poll-rate" value="60">
<input type="number" id="array-threshold" value="3">
<input type="text" id="driver-pod-label" value="dell-storage">
<input type="checkbox" id="volumeless-pods">
<input type="checkbox" id="connection-validation">
<input type="checkbox" id="leader-election">
`;

const expected = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const {
resetSnapNamePrefix,
resetDriverPodLabel,
resetArrayPollRate,
resetArrayConnectionLossThreshold,
resetLabelValue,
resetNodeSelectorLabel,
resetDriverNamespace,
Expand Down Expand Up @@ -391,6 +392,22 @@ describe("GIVEN resetArrayPollRate function", () => {
});
});

describe("GIVEN resetArrayConnectionLossThreshold function", () => {
const testCSMMap = new Map([
["arrayThreshold", "3"]
]);

test("SHOULD invoke resetArrayConnectionLossThreshold function", () => {
document.body.innerHTML = `
<input type="number" id="array-threshold">
`;

resetArrayConnectionLossThreshold(testCSMMap);

expect(document.getElementById("array-threshold").value).toEqual("3");
});
});

describe("GIVEN resetLabelValue function", () => {
test("SHOULD invoke resetLabelValue function", () => {
document.body.innerHTML = `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ describe("GIVEN setDefaultValues function", () => {
<input type="text" id="cert-secret-count">
<input type="text" id="taint">
<input type="number" id="poll-rate">
<input type="number" id="array-threshold">
<input type="text" id="driver-pod-label">
`;

Expand All @@ -286,6 +287,7 @@ describe("GIVEN setDefaultValues function", () => {
["certSecretCount", "1"],
["taint", "node-role.kubernetes.io/control-plane"],
["pollRate", "60"],
["arrayThreshold", "3"],
["driverPodLabel", "dell-storage"]
]);

Expand All @@ -299,6 +301,7 @@ describe("GIVEN setDefaultValues function", () => {
expect(document.getElementById("cert-secret-count").value).toEqual("1");
expect(document.getElementById("taint").value).toEqual("node-role.kubernetes.io/control-plane");
expect(document.getElementById("poll-rate").value).toEqual("60");
expect(document.getElementById("array-threshold").value).toEqual("3");
expect(document.getElementById("driver-pod-label").value).toEqual("dell-storage");

});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ const resetArrayPollRate = csmMapValue => {
document.getElementById("poll-rate").value = String(csmMapValue.get("pollRate"));
}

const resetArrayConnectionLossThreshold = csmMapValue => {
document.getElementById("array-threshold").value = String(csmMapValue.get("arrayThreshold"));
}

const resetLabelValue = (driverValue, CONSTANTS_PARAM) => {
if (driverValue === CONSTANTS_PARAM.POWERSTORE) {
document.getElementById("label-value").value = CONSTANTS_PARAM.POWERSTORE_LABEL_VALUE;
Expand Down Expand Up @@ -386,6 +390,7 @@ if (typeof exports !== 'undefined') {
resetArrayPollRate,
resetLabelValue,
resetDriverPodLabel,
resetArrayConnectionLossThreshold,
resetTaint,
downloadFile,
displayModules,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ function setDefaultValues(defaultValuesParam, csmMapValues) {
document.getElementById("cert-secret-count").value = csmMapValues.get("certSecretCount");
document.getElementById("taint").value = csmMapValues.get("taint");
document.getElementById("poll-rate").value = csmMapValues.get("pollRate");
document.getElementById("array-threshold").value = csmMapValues.get("arrayThreshold");
document.getElementById("driver-pod-label").value = csmMapValues.get("driverPodLabel");

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,11 @@ spec:
# Leave as blank to consider all nodes
# Allowed values: map of key-value pairs
# Default value: None
nodeSelector:$NODE_POD_NODE_SELECTOR
# Uncomment if nodes you wish to use have the node-role.kubernetes.io/control-plane taint
# node-role.kubernetes.io/control-plane: ""
nodeSelector:$CONTROLLER_POD_NODE_SELECTOR

# tolerations: Define tolerations for the controller deployment, if required.
# Default value: None
tolerations:$NODE_TOLERATIONS
# Uncomment if nodes you wish to use have the node-role.kubernetes.io/control-plane taint
# - key: "node-role.kubernetes.io/control-plane"
# operator: "Exists"
# effect: "NoSchedule"
tolerations:$CONTROLLER_TOLERATIONS

node:
envs:
Expand Down Expand Up @@ -219,8 +213,6 @@ spec:
# Allowed values: map of key-value pairs
# Default value: None
nodeSelector:$NODE_POD_NODE_SELECTOR
# Uncomment if nodes you wish to use have the node-role.kubernetes.io/control-plane taint
# node-role.kubernetes.io/control-plane: ""

# tolerations: Define tolerations for the node daemonset, if required.
# Default value: None
Expand All @@ -234,10 +226,6 @@ spec:
# - key: "node.kubernetes.io/network-unavailable"
# operator: "Exists"
# effect: "NoExecute"
# Uncomment if nodes you wish to use have the node-role.kubernetes.io/control-plane taint
# - key: "node-role.kubernetes.io/control-plane"
# operator: "Exists"
# effect: "NoSchedule"

sideCars:
- name: provisioner
Expand Down Expand Up @@ -451,7 +439,7 @@ spec:
- "--skipArrayConnectionValidation=$SKIP_ARRAY_CONNECTION_VALIDATION"
- "--driverPodLabelValue=$DRIVER_POD_LABEL_VALUE"
- "--ignoreVolumelessPods=$IGNORE_VOLUMELESS_PODS"
- "--arrayConnectivityConnectionLossThreshold=3"
- "--arrayConnectivityConnectionLossThreshold=$ARRAY_THRESHOLD"
# Below 4 args should not be modified.
- "--csisock=unix:/var/run/csi/csi.sock"
- "--mode=controller"
Expand All @@ -469,10 +457,10 @@ spec:
args:
- "--labelvalue=$LABEL_VALUE"
- "--arrayConnectivityPollRate=$POLL_RATE"
- "--leaderelection=$SKIP_ARRAY_CONNECTION_VALIDATION"
- "--leaderelection=$LEADER_ELECTION"
- "--driverPodLabelValue=$DRIVER_POD_LABEL_VALUE"
- "--ignoreVolumelessPods=$IGNORE_VOLUMELESS_PODS"
- "--arrayConnectivityConnectionLossThreshold=3"
- "--arrayConnectivityConnectionLossThreshold=$ARRAY_THRESHOLD"
# Below 4 args should not be modified.
- "--csisock=unix:/var/lib/kubelet/plugins/csi-isilon/csi_sock"
- "--mode=node"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,11 @@ spec:
# Leave as blank to consider all nodes
# Allowed values: map of key-value pairs
# Default value: None
nodeSelector:$NODE_POD_NODE_SELECTOR
# Uncomment if nodes you wish to use have the node-role.kubernetes.io/control-plane taint
# node-role.kubernetes.io/control-plane: ""
nodeSelector:$CONTROLLER_POD_NODE_SELECTOR

# tolerations: Define tolerations for the controller deployment, if required.
# Default value: None
tolerations:$NODE_TOLERATIONS
# Uncomment if nodes you wish to use have the node-role.kubernetes.io/control-plane taint
# - key: "node-role.kubernetes.io/control-plane"
# operator: "Exists"
# effect: "NoSchedule"
tolerations:$CONTROLLER_TOLERATIONS

node:
envs:
Expand Down Expand Up @@ -219,8 +213,6 @@ spec:
# Allowed values: map of key-value pairs
# Default value: None
nodeSelector:$NODE_POD_NODE_SELECTOR
# Uncomment if nodes you wish to use have the node-role.kubernetes.io/control-plane taint
# node-role.kubernetes.io/control-plane: ""

# tolerations: Define tolerations for the node daemonset, if required.
# Default value: None
Expand All @@ -234,10 +226,6 @@ spec:
# - key: "node.kubernetes.io/network-unavailable"
# operator: "Exists"
# effect: "NoExecute"
# Uncomment if nodes you wish to use have the node-role.kubernetes.io/control-plane taint
# - key: "node-role.kubernetes.io/control-plane"
# operator: "Exists"
# effect: "NoSchedule"

sideCars:
- name: provisioner
Expand Down Expand Up @@ -451,7 +439,7 @@ spec:
- "--skipArrayConnectionValidation=$SKIP_ARRAY_CONNECTION_VALIDATION"
- "--driverPodLabelValue=$DRIVER_POD_LABEL_VALUE"
- "--ignoreVolumelessPods=$IGNORE_VOLUMELESS_PODS"
- "--arrayConnectivityConnectionLossThreshold=3"
- "--arrayConnectivityConnectionLossThreshold=$ARRAY_THRESHOLD"
# Below 4 args should not be modified.
- "--csisock=unix:/var/run/csi/csi.sock"
- "--mode=controller"
Expand All @@ -469,10 +457,10 @@ spec:
args:
- "--labelvalue=$LABEL_VALUE"
- "--arrayConnectivityPollRate=$POLL_RATE"
- "--leaderelection=$SKIP_ARRAY_CONNECTION_VALIDATION"
- "--leaderelection=$LEADER_ELECTION"
- "--driverPodLabelValue=$DRIVER_POD_LABEL_VALUE"
- "--ignoreVolumelessPods=$IGNORE_VOLUMELESS_PODS"
- "--arrayConnectivityConnectionLossThreshold=3"
- "--arrayConnectivityConnectionLossThreshold=$ARRAY_THRESHOLD"
# Below 4 args should not be modified.
- "--csisock=unix:/var/lib/kubelet/plugins/csi-isilon/csi_sock"
- "--mode=node"
Expand Down
Loading