From 791583f5cc6d41abf2cf2df4fd46e78a7b469fac Mon Sep 17 00:00:00 2001 From: boyamurthy <92081029+boyamurthy@users.noreply.github.com> Date: Mon, 21 Aug 2023 14:27:24 +0530 Subject: [PATCH] Powermax operator support wizard (#754) --- .../csminstallationwizard/src/index.html | 93 +++- .../src/static/js/commands.js | 2 + .../src/static/js/constants.js | 1 + .../src/static/js/generate-yaml.js | 25 ++ .../src/static/js/tests/generate-yaml.test.js | 45 +- .../src/static/js/tests/ui-functions.test.js | 55 +++ .../src/static/js/tests/utility.test.js | 44 +- .../src/static/js/ui-functions.js | 76 +++- .../src/static/js/utility.js | 22 +- .../operator/csm-powermax-1.7.0.template | 318 ++++++++++++++ .../operator/csm-powermax-1.8.0.template | 405 ++++++++++++++++++ 11 files changed, 1071 insertions(+), 15 deletions(-) create mode 100644 content/docs/deployment/csminstallationwizard/src/templates/operator/csm-powermax-1.7.0.template create mode 100644 content/docs/deployment/csminstallationwizard/src/templates/operator/csm-powermax-1.8.0.template diff --git a/content/docs/deployment/csminstallationwizard/src/index.html b/content/docs/deployment/csminstallationwizard/src/index.html index 23189cc846..9bcae1300a 100644 --- a/content/docs/deployment/csminstallationwizard/src/index.html +++ b/content/docs/deployment/csminstallationwizard/src/index.html @@ -109,11 +109,50 @@ +
+
+ + +
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+ +
- +
+
+ +
+
+ +
+
+
+
+ + +
+
@@ -341,6 +380,26 @@
+
+
+ +
+
+ +
+
+ +
+ +
+
+ +
+
+
+
+ +
@@ -368,6 +427,38 @@
+
+
+ +
+
+ +
+
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+
+ + +
+
+
+ + +
diff --git a/content/docs/deployment/csminstallationwizard/src/static/js/commands.js b/content/docs/deployment/csminstallationwizard/src/static/js/commands.js index 053e7af0bb..e30fffcf10 100644 --- a/content/docs/deployment/csminstallationwizard/src/static/js/commands.js +++ b/content/docs/deployment/csminstallationwizard/src/static/js/commands.js @@ -27,3 +27,5 @@ const certmanagerNote = 'If cert-manager is enabled, ensure the cert-manager CRD const veleroNote = 'If Velero is enabled, please add the respective credentials and configurations in the YAML file.'; const podmonNote = 'Uncomment tolerations under node property, if CSM for Resiliency and CSI Driver pods monitor are enabled in the generated YAML'; const authorizationNote = 'Only the Authorization sidecar is enabled by the CSM Installation Wizard. The Proxy Server has to be installed and configured separately'; +const topologyNote = 'If Node Topology is enabled, make sure topology configmap is created'; +const replicationNote = 'If Replication is enabled, ensure the Replication CRDs are installed and secrets are created. Enter the target cluster ID or "self" in case of stretched/single cluster'; diff --git a/content/docs/deployment/csminstallationwizard/src/static/js/constants.js b/content/docs/deployment/csminstallationwizard/src/static/js/constants.js index 85efd68da4..190bf63795 100644 --- a/content/docs/deployment/csminstallationwizard/src/static/js/constants.js +++ b/content/docs/deployment/csminstallationwizard/src/static/js/constants.js @@ -27,6 +27,7 @@ const CONSTANTS = { POWERSCALE_NAMESPACE: "isilon", UNITY_NAMESPACE: "unity", POWERSTORE_LABEL_VALUE: "csi-powerstore", + POWERMAX_LABEL_VALUE: "csi-powermax", POWERSCALE_LABEL_VALUE: "csi-isilon", VALUES: "values", TEMP_DIR: "templates", diff --git a/content/docs/deployment/csminstallationwizard/src/static/js/generate-yaml.js b/content/docs/deployment/csminstallationwizard/src/static/js/generate-yaml.js index cca6d2a2c6..aa38d06f11 100644 --- a/content/docs/deployment/csminstallationwizard/src/static/js/generate-yaml.js +++ b/content/docs/deployment/csminstallationwizard/src/static/js/generate-yaml.js @@ -18,9 +18,11 @@ var template = ""; var version = ""; var observabilityEnabled = false; +var observabilityOperatorEnabled = false; var authorizationEnabled = false; var replicationEnabled = false; + function generateYamlFile(tmpl) { var yamlFile = null; setMap(version); @@ -46,6 +48,7 @@ function setValues(csmMapValues, CONSTANTS_PARAM) { DriverValues.controllerCount = document.getElementById("controller-count").value; DriverValues.volNamePrefix = document.getElementById("vol-name-prefix").value; DriverValues.snapNamePrefix = document.getElementById("snapshot-prefix").value; + DriverValues.targetClusterId = document.getElementById("target-cluster-id").value; DriverValues.fsGroupPolicy = document.getElementById("fsGroup-Policy").value; DriverValues.driverNamespace = document.getElementById("driver-namespace").value; DriverValues.labelValue = document.getElementById("label-value").value; @@ -82,11 +85,16 @@ function setValues(csmMapValues, CONSTANTS_PARAM) { DriverValues.snapshot = $("#snapshot").prop('checked') ? true : false; DriverValues.vgsnapshot = $("#vgsnapshot").prop('checked') ? true : false; DriverValues.resizer = $("#resizer").prop('checked') ? true : false; + DriverValues.iscsichap = $("#iscsichap").prop('checked') ? true : false; DriverValues.healthMonitor = $("#health-monitor").prop('checked') ? true : false; DriverValues.replication = $("#replication").prop('checked') ? true : false; DriverValues.migration = $("#migration").prop('checked') ? true : false; DriverValues.observability = $("#observability").prop('checked') ? true : false; DriverValues.observabilityMetrics = $("#observability-metrics").prop('checked') ? true : false; + DriverValues.observabilityOperator = $("#observability-operator").prop('checked') ? true : false; + DriverValues.observabilityOperatorMetrics = $("#observability-operator-metrics").prop('checked') ? true : false; + DriverValues.observabilityOperatorTopology = $("#observability-operator-topology").prop('checked') ? true : false; + DriverValues.observabilityOperatorOtel = $("#observability-operator-otel").prop('checked') ? true : false; DriverValues.authorization = $("#authorization").prop('checked') ? true : false; DriverValues.resiliency = $("#resiliency").prop('checked') ? true : false; DriverValues.operatorResiliency = $("#operator-resiliency").prop('checked') ? true : false; @@ -94,15 +102,20 @@ function setValues(csmMapValues, CONSTANTS_PARAM) { DriverValues.authorizationSkipCertValidation = $("#authorization-skip-cert-validation").prop('checked') ? true : false; DriverValues.authorizationProxyHost = document.getElementById("authorization-proxy-host").value || '""'; DriverValues.certManagerEnabled = $("#certmanager").prop('checked') ? true : false; + DriverValues.topologyEnabled = $("#topology").prop('checked') ? true : false; observabilityEnabled = DriverValues.observability; + observabilityOperatorEnabled = DriverValues.observabilityOperator; authorizationEnabled = DriverValues.authorization; replicationEnabled = DriverValues.replication; DriverValues.storageArrayId = $("#storage-array-id").val(); DriverValues.storageArrayEndpointUrl = $("#storage-array-endpoint-url").val() || '""'; DriverValues.storageArrayBackupEndpointUrl = $("#storage-array-backup-endpoint-url").val() || '""'; + DriverValues.manageArrayId = $("#manage-array-id").val() || '""'; + DriverValues.manageArrayEndpointUrl = $("#manage-array-endpoint-url").val() || '""'; DriverValues.clusterPrefix = $("#cluster-prefix").val(); DriverValues.portGroups = $("#port-groups").val(); + DriverValues.transportProtocol = $("#transport-protocol").val(); DriverValues.vSphereEnabled = $("#vSphere").prop('checked') ? true : false; DriverValues.vSphereFCPortGroup = $("#vSphere-fc-port-group").val(); @@ -117,6 +130,7 @@ function createYamlString(yamlTpl, yamlTplValues, driverParam, CONSTANTS_PARAM) yamlTpl = yamlTpl.replaceAll("$CONTROLLER_COUNT", yamlTplValues.controllerCount); yamlTpl = yamlTpl.replaceAll("$VOLUME_NAME_PREFIX", yamlTplValues.volNamePrefix); yamlTpl = yamlTpl.replaceAll("$SNAP_NAME_PREFIX", yamlTplValues.snapNamePrefix); + yamlTpl = yamlTpl.replaceAll("$TARGET_CLUSTER_ID", yamlTplValues.targetClusterId); yamlTpl = yamlTpl.replaceAll("$FSGROUP_POLICY", yamlTplValues.fsGroupPolicy); yamlTpl = yamlTpl.replaceAll("$NAMESPACE", yamlTplValues.driverNamespace); yamlTpl = yamlTpl.replaceAll("$CONTROLLER_POD_NODE_SELECTOR", yamlTplValues.controllerPodsNodeSelector); @@ -125,12 +139,15 @@ function createYamlString(yamlTpl, yamlTplValues, driverParam, CONSTANTS_PARAM) yamlTpl = yamlTpl.replaceAll("$VG_SNAPSHOT_ENABLED", yamlTplValues.vgsnapshot); yamlTpl = yamlTpl.replaceAll("$SNAPSHOT_ENABLED", yamlTplValues.snapshot); yamlTpl = yamlTpl.replaceAll("$RESIZER_ENABLED", yamlTplValues.resizer); + yamlTpl = yamlTpl.replaceAll("$ISCSI_CHAP_ENABLED", yamlTplValues.iscsichap); + yamlTpl = yamlTpl.replaceAll("$TOPOLOGY_ENABLED", yamlTplValues.topologyEnabled); yamlTpl = yamlTpl.replaceAll("$REPLICATION_ENABLED", yamlTplValues.replication); yamlTpl = yamlTpl.replaceAll("$MIGRATION_ENABLED", yamlTplValues.migration); yamlTpl = yamlTpl.replaceAll("$AUTHORIZATION_ENABLED", yamlTplValues.authorization); yamlTpl = yamlTpl.replaceAll("$AUTHORIZATION_PROXY_HOST", yamlTplValues.authorizationProxyHost); yamlTpl = yamlTpl.replaceAll("$AUTHORIZATION_SKIP_CERTIFICATE_VALIDATION", yamlTplValues.authorizationSkipCertValidation); yamlTpl = yamlTpl.replaceAll("$OBSERVABILITY_ENABLED", yamlTplValues.observability); + yamlTpl = yamlTpl.replaceAll("$OBSERVABILITY_OPERATOR_ENABLED", yamlTplValues.observabilityOperator); yamlTpl = yamlTpl.replaceAll("$RESILIENCY_ENABLED", yamlTplValues.resiliency); yamlTpl = yamlTpl.replaceAll("$OPERATOR_RESILIENCY_ENABLED", yamlTplValues.operatorResiliency); yamlTpl = yamlTpl.replaceAll("$LABEL_VALUE", yamlTplValues.labelValue); @@ -147,8 +164,11 @@ function createYamlString(yamlTpl, yamlTplValues, driverParam, CONSTANTS_PARAM) yamlTpl = yamlTpl.replaceAll("$POWERMAX_STORAGE_ARRAY_ENDPOINT_URL", yamlTplValues.storageArrayEndpointUrl); yamlTpl = yamlTpl.replaceAll("$POWERMAX_STORAGE_ARRAY_BACKUP_ENDPOINT_URL", yamlTplValues.storageArrayBackupEndpointUrl); yamlTpl = yamlTpl.replaceAll("$POWERMAX_MANAGEMENT_SERVERS_ENDPOINT_URL", yamlTplValues.storageArrayEndpointUrl); + yamlTpl = yamlTpl.replaceAll("$POWERMAX_MANAGE_ARRAY_ID", yamlTplValues.manageArrayId); + yamlTpl = yamlTpl.replaceAll("$POWERMAX_MANAGE_ARRAY_ENDPOINT_URL", yamlTplValues.manageArrayEndpointUrl); yamlTpl = yamlTpl.replaceAll("$POWERMAX_CLUSTER_PREFIX", yamlTplValues.clusterPrefix); yamlTpl = yamlTpl.replaceAll("$POWERMAX_PORT_GROUPS", yamlTplValues.portGroups); + yamlTpl = yamlTpl.replaceAll("$NODE_TRANSPORT_PROTOCOL", yamlTplValues.transportProtocol); yamlTpl = yamlTpl.replaceAll("$VSPHERE_ENABLED", yamlTplValues.vSphereEnabled); yamlTpl = yamlTpl.replaceAll("$VSPHERE_FC_PORT_GROUP", yamlTplValues.vSphereFCPortGroup); yamlTpl = yamlTpl.replaceAll("$VSPHERE_FC_HOST_NAME", yamlTplValues.vSphereFCHostName); @@ -190,6 +210,11 @@ function createYamlString(yamlTpl, yamlTplValues, driverParam, CONSTANTS_PARAM) yamlTpl = yamlTpl.replaceAll("$POWERSCALE_OBSERVABILITY_METRICS_ENABLED", true); } } + yamlTpl = yamlTpl.replaceAll("$OBSERVABILITY_OPERATOR_TOPOLOGY", yamlTplValues.observabilityOperatorTopology); + yamlTpl = yamlTpl.replaceAll("$OBSERVABILITY_OPERATOR_METRICS", yamlTplValues.observabilityOperatorMetrics); + yamlTpl = yamlTpl.replaceAll("$OBSERVABILITY_OPERATOR_OTEL", yamlTplValues.observabilityOperatorOtel); + + yamlTpl = yamlTpl.replaceAll("$POWERSTORE_OBSERVABILITY_METRICS_ENABLED", false); yamlTpl = yamlTpl.replaceAll("$POWERMAX_OBSERVABILITY_METRICS_ENABLED", false); yamlTpl = yamlTpl.replaceAll("$POWERFLEX_OBSERVABILITY_METRICS_ENABLED", false); diff --git a/content/docs/deployment/csminstallationwizard/src/static/js/tests/generate-yaml.test.js b/content/docs/deployment/csminstallationwizard/src/static/js/tests/generate-yaml.test.js index 0b75ef591e..d46c769bd3 100644 --- a/content/docs/deployment/csminstallationwizard/src/static/js/tests/generate-yaml.test.js +++ b/content/docs/deployment/csminstallationwizard/src/static/js/tests/generate-yaml.test.js @@ -101,6 +101,16 @@ describe("GIVEN setValues function", () => { + + + + + + + + + + `; const expected = { @@ -156,7 +166,17 @@ describe("GIVEN setValues function", () => { vSphereFCPortGroup: undefined, vSphereFCHostName: undefined, vSphereVCenterHost: undefined, - vSphereVCenterCredSecret: undefined + vSphereVCenterCredSecret: undefined, + targetClusterId: "", + iscsichap: false, + manageArrayId: '""', + manageArrayEndpointUrl: '""', + observabilityOperator: false, + observabilityOperatorMetrics: false, + observabilityOperatorOtel: false, + observabilityOperatorTopology: false, + topologyEnabled: false, + transportProtocol: "", }; const received = setValues(testCSMMap, CONSTANTS); @@ -191,6 +211,16 @@ describe("GIVEN setValues function", () => { + + + + + + + + + + `; @@ -243,11 +273,21 @@ describe("GIVEN setValues function", () => { volumelessPods: false, clusterPrefix: undefined, portGroups: undefined, + targetClusterId: "", vSphereEnabled: false, vSphereFCPortGroup: undefined, vSphereFCHostName: undefined, vSphereVCenterHost: undefined, - vSphereVCenterCredSecret: undefined + vSphereVCenterCredSecret: undefined, + iscsichap: false, + manageArrayId: '""', + manageArrayEndpointUrl: '""', + observabilityOperator: false, + observabilityOperatorMetrics: false, + observabilityOperatorOtel: false, + observabilityOperatorTopology: false, + topologyEnabled: false, + transportProtocol: "", }; const received = setValues(testCSMMap, CONSTANTS); @@ -282,6 +322,7 @@ describe("GIVEN setValues function", () => { + `; diff --git a/content/docs/deployment/csminstallationwizard/src/static/js/tests/ui-functions.test.js b/content/docs/deployment/csminstallationwizard/src/static/js/tests/ui-functions.test.js index 5cbf1a02fd..1e5ada998d 100644 --- a/content/docs/deployment/csminstallationwizard/src/static/js/tests/ui-functions.test.js +++ b/content/docs/deployment/csminstallationwizard/src/static/js/tests/ui-functions.test.js @@ -20,6 +20,7 @@ const { onObservabilityChange, onResiliencyChange, onOperatorResiliencyChange, + onObservabilityOperatorChange, onSnapshotChange, onCertManagerChange, onVSphereChange, @@ -166,6 +167,40 @@ describe("GIVEN onOperatorResiliencyChange function", () => { }); }); + +describe("GIVEN onObservabilityOperatorChange function", () => { + test("SHOULD hide observability components when option not checked", () => { + document.body.innerHTML = ` + +
+
+
+ + `; + + onObservabilityOperatorChange(); + + expect($("div#observability-operator-metrics-wrapper").css("display")).toEqual("none"); + expect($("div#observability-operator-topology-wrapper").css("display")).toEqual("none"); + expect($("div#observability-operator-otel-wrapper").css("display")).toEqual("none"); + }); + + test("SHOULD show podmon components when option checked", () => { + document.body.innerHTML = ` + +