From bf1f9c4ff92d2baa225ce5cdfaca92632cce805a Mon Sep 17 00:00:00 2001 From: ashleyvjoy <110008193+ashleyvjoy@users.noreply.github.com> Date: Tue, 22 Aug 2023 11:46:51 +0530 Subject: [PATCH] signing all commits (#323) --- ...ell-csm-operator.clusterserviceversion.yaml | 7 ++++--- config/samples/storage_v1_csm_powerflex.yaml | 10 ++++++++++ .../powerflex/v2.8.0/controller.yaml | 18 ++++++++++++++++++ .../powerflex/v2.8.0/csidriver.yaml | 1 + pkg/drivers/commonconfig.go | 2 ++ pkg/drivers/powerflex.go | 7 ++++++- samples/storage_csm_powerflex_v280.yaml | 10 ++++++++++ .../powerflex/v2.8.0/controller.yaml | 18 ++++++++++++++++++ .../powerflex/v2.8.0/csidriver.yaml | 1 + tests/e2e/testfiles/storage_csm_powerflex.yaml | 10 ++++++++++ 10 files changed, 80 insertions(+), 4 deletions(-) diff --git a/bundle/manifests/dell-csm-operator.clusterserviceversion.yaml b/bundle/manifests/dell-csm-operator.clusterserviceversion.yaml index 82a68402e..0990dec8e 100644 --- a/bundle/manifests/dell-csm-operator.clusterserviceversion.yaml +++ b/bundle/manifests/dell-csm-operator.clusterserviceversion.yaml @@ -798,10 +798,10 @@ metadata: "value": "0" } ], - "image": "dellemc/csi-vxflexos:v2.7.0", + "image": "dellemc/csi-vxflexos:v2.8.0", "imagePullPolicy": "IfNotPresent" }, - "configVersion": "v2.7.0", + "configVersion": "v2.8.0", "controller": { "envs": [ { @@ -813,7 +813,8 @@ metadata: "tolerations": null }, "csiDriverSpec": { - "fSGroupPolicy": "File" + "fSGroupPolicy": "File", + "storageCapacity": true }, "csiDriverType": "powerflex", "dnsPolicy": "ClusterFirstWithHostNet", diff --git a/config/samples/storage_v1_csm_powerflex.yaml b/config/samples/storage_v1_csm_powerflex.yaml index bf728ae5c..a71afc016 100644 --- a/config/samples/storage_v1_csm_powerflex.yaml +++ b/config/samples/storage_v1_csm_powerflex.yaml @@ -11,6 +11,11 @@ spec: # Allowed values: ReadWriteOnceWithFSType, File , None # Default value: ReadWriteOnceWithFSType fSGroupPolicy: "File" + # storageCapacity: Helps the scheduler to schedule the pod on a node satisfying the topology constraints, only if the requested capacity is available on the storage array + # Allowed values: + # true: enable storage capacity tracking + # false: disable storage capacity tracking + storageCapacity: true configVersion: v2.8.0 replicas: 1 dnsPolicy: ClusterFirstWithHostNet @@ -56,6 +61,11 @@ spec: - name: csi-external-health-monitor-controller enabled: false args: ["--monitor-interval=60s"] + # Uncomment the following to configure how often external-provisioner polls the driver to detect changed capacity + # Configure when the storageCapacity is set as "true" + # Allowed values: 1m,2m,3m,...,10m,...,60m etc. Default value: 5m + #- name: provisioner + # args: ["--capacity-poll-interval=5m"] controller: envs: diff --git a/operatorconfig/driverconfig/powerflex/v2.8.0/controller.yaml b/operatorconfig/driverconfig/powerflex/v2.8.0/controller.yaml index 7fe32312d..b546dcbaf 100644 --- a/operatorconfig/driverconfig/powerflex/v2.8.0/controller.yaml +++ b/operatorconfig/driverconfig/powerflex/v2.8.0/controller.yaml @@ -68,6 +68,13 @@ rules: - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["create", "list", "watch", "delete", "update"] + # Permissions for CSIStorageCapacity + - apiGroups: ["storage.k8s.io"] + resources: ["csistoragecapacities"] + verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] + - apiGroups: ["apps"] + resources: ["replicasets"] + verbs: ["get"] --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 @@ -141,9 +148,20 @@ spec: - "--v=5" - "--default-fstype=ext4" - "--extra-create-metadata" + - "--enable-capacity=true" + - "--capacity-ownerref-level=2" + - "--capacity-poll-interval=5m" env: - name: ADDRESS value: /var/run/csi/csi.sock + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name volumeMounts: - name: socket-dir mountPath: /var/run/csi diff --git a/operatorconfig/driverconfig/powerflex/v2.8.0/csidriver.yaml b/operatorconfig/driverconfig/powerflex/v2.8.0/csidriver.yaml index 716e28201..9fdb2dfa0 100644 --- a/operatorconfig/driverconfig/powerflex/v2.8.0/csidriver.yaml +++ b/operatorconfig/driverconfig/powerflex/v2.8.0/csidriver.yaml @@ -6,6 +6,7 @@ spec: fsGroupPolicy: ReadWriteOnceWithFSType attachRequired: true podInfoOnMount: true + storageCapacity: false volumeLifecycleModes: - Persistent - Ephemeral \ No newline at end of file diff --git a/pkg/drivers/commonconfig.go b/pkg/drivers/commonconfig.go index dcfc981c9..91b156d78 100644 --- a/pkg/drivers/commonconfig.go +++ b/pkg/drivers/commonconfig.go @@ -398,6 +398,8 @@ func GetCSIDriver(ctx context.Context, cr csmv1.ContainerStorageModule, operator YamlString = ModifyPowerScaleCR(YamlString, cr, "CSIDriverSpec") case "powermax": YamlString = ModifyPowermaxCR(YamlString, cr, "CSIDriverSpec") + case "powerflex": + YamlString = ModifyPowerflexCR(YamlString, cr, "CSIDriverSpec") case "unity": YamlString = ModifyUnityCR(YamlString, cr, "CSIDriverSpec") } diff --git a/pkg/drivers/powerflex.go b/pkg/drivers/powerflex.go index 1e94c600e..966642798 100644 --- a/pkg/drivers/powerflex.go +++ b/pkg/drivers/powerflex.go @@ -232,6 +232,7 @@ func ModifyPowerflexCR(yamlString string, cr csmv1.ContainerStorageModule, fileT renameSdcEnabled := "" renameSdcPrefix := "" maxVolumesPerNode := "" + storageCapacity := "false" nfsAcls := "" externalAscess := "" enableQuota := "" @@ -265,10 +266,14 @@ func ModifyPowerflexCR(yamlString string, cr csmv1.ContainerStorageModule, fileT yamlString = strings.ReplaceAll(yamlString, CsiRenameSdcEnabled, renameSdcEnabled) yamlString = strings.ReplaceAll(yamlString, CsiPrefixRenameSdc, renameSdcPrefix) yamlString = strings.ReplaceAll(yamlString, CsiVxflexosMaxVolumesPerNode, maxVolumesPerNode) + case "CSIDriverSpec": + if cr.Spec.Driver.CSIDriverSpec.StorageCapacity { + storageCapacity = "true" + } + yamlString = strings.ReplaceAll(yamlString, CsiStorageCapacityEnabled, storageCapacity) yamlString = strings.ReplaceAll(yamlString, CsiVxflexosNfsAcls, nfsAcls) yamlString = strings.ReplaceAll(yamlString, CsiVxflexosExternaAccess, externalAscess) yamlString = strings.ReplaceAll(yamlString, CsiVxflexosQuotaEnabled, enableQuota) - } return yamlString } diff --git a/samples/storage_csm_powerflex_v280.yaml b/samples/storage_csm_powerflex_v280.yaml index 2583ae365..87a55381d 100644 --- a/samples/storage_csm_powerflex_v280.yaml +++ b/samples/storage_csm_powerflex_v280.yaml @@ -11,6 +11,11 @@ spec: # Allowed values: ReadWriteOnceWithFSType, File , None # Default value: ReadWriteOnceWithFSType fSGroupPolicy: "File" + # storageCapacity: Helps the scheduler to schedule the pod on a node satisfying the topology constraints, only if the requested capacity is available on the storage array + # Allowed values: + # true: enable storage capacity tracking + # false: disable storage capacity tracking + storageCapacity: true configVersion: v2.8.0 replicas: 1 dnsPolicy: ClusterFirstWithHostNet @@ -56,6 +61,11 @@ spec: - name: csi-external-health-monitor-controller enabled: false args: ["--monitor-interval=60s"] + # Uncomment the following to configure how often external-provisioner polls the driver to detect changed capacity + # Configure when the storageCapacity is set as "true" + # Allowed values: 1m,2m,3m,...,10m,...,60m etc. Default value: 5m + #- name: provisioner + # args: ["--capacity-poll-interval=5m"] controller: envs: diff --git a/tests/config/driverconfig/powerflex/v2.8.0/controller.yaml b/tests/config/driverconfig/powerflex/v2.8.0/controller.yaml index 2b45da56d..470177ccc 100644 --- a/tests/config/driverconfig/powerflex/v2.8.0/controller.yaml +++ b/tests/config/driverconfig/powerflex/v2.8.0/controller.yaml @@ -68,6 +68,13 @@ rules: - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["create", "list", "watch", "delete", "update"] + # Permissions for CSIStorageCapacity + - apiGroups: ["storage.k8s.io"] + resources: ["csistoragecapacities"] + verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] + - apiGroups: ["apps"] + resources: ["replicasets"] + verbs: ["get"] --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 @@ -141,9 +148,20 @@ spec: - "--v=5" - "--default-fstype=ext4" - "--extra-create-metadata" + - "--enable-capacity=true" + - "--capacity-ownerref-level=2" + - "--capacity-poll-interval=5m" env: - name: ADDRESS value: /var/run/csi/csi.sock + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name volumeMounts: - name: socket-dir mountPath: /var/run/csi diff --git a/tests/config/driverconfig/powerflex/v2.8.0/csidriver.yaml b/tests/config/driverconfig/powerflex/v2.8.0/csidriver.yaml index 716e28201..00e2196b1 100644 --- a/tests/config/driverconfig/powerflex/v2.8.0/csidriver.yaml +++ b/tests/config/driverconfig/powerflex/v2.8.0/csidriver.yaml @@ -6,6 +6,7 @@ spec: fsGroupPolicy: ReadWriteOnceWithFSType attachRequired: true podInfoOnMount: true + storageCapacity: true volumeLifecycleModes: - Persistent - Ephemeral \ No newline at end of file diff --git a/tests/e2e/testfiles/storage_csm_powerflex.yaml b/tests/e2e/testfiles/storage_csm_powerflex.yaml index 89e7d2793..ffc967090 100644 --- a/tests/e2e/testfiles/storage_csm_powerflex.yaml +++ b/tests/e2e/testfiles/storage_csm_powerflex.yaml @@ -11,6 +11,11 @@ spec: # Allowed values: ReadWriteOnceWithFSType, File , None # Default value: ReadWriteOnceWithFSType fSGroupPolicy: "File" + # storageCapacity: Helps the scheduler to schedule the pod on a node satisfying the topology constraints, only if the requested capacity is available on the storage array + # Allowed values: + # true: enable storage capacity tracking + # false: disable storage capacity tracking + storageCapacity: true configVersion: v2.8.0 replicas: 1 dnsPolicy: ClusterFirstWithHostNet @@ -59,6 +64,11 @@ spec: - name: csi-external-health-monitor-controller enabled: false args: ["--monitor-interval=60s"] + # Uncomment the following to configure how often external-provisioner polls the driver to detect changed capacity + # Configure when the storageCapacity is set as "true" + # Allowed values: 1m,2m,3m,...,10m,...,60m etc. Default value: 5m + #- name: provisioner + # args: ["--capacity-poll-interval=5m"] controller: envs: