From 3bf65dc14b6c6924ecd60b8d277f01d9c5f88029 Mon Sep 17 00:00:00 2001 From: karthikk92 <92289639+karthikk92@users.noreply.github.com> Date: Fri, 4 Aug 2023 12:22:02 +0530 Subject: [PATCH] CSIUnity v2.8.0 release (#248) * Updated v2.8.0 unity driver version * addressed review comments on values.yaml file update --- charts/container-storage-modules/Chart.yaml | 2 +- charts/container-storage-modules/values.yaml | 7 +++++- charts/csi-unity/Chart.yaml | 6 ++--- charts/csi-unity/templates/_helpers.tpl | 11 ++++++++++ charts/csi-unity/templates/controller.yaml | 23 ++++++++++++++++++++ charts/csi-unity/templates/csidriver.yaml | 3 ++- charts/csi-unity/values.yaml | 18 +++++++++++++-- 7 files changed, 62 insertions(+), 8 deletions(-) diff --git a/charts/container-storage-modules/Chart.yaml b/charts/container-storage-modules/Chart.yaml index d5e6afe8..c1034331 100644 --- a/charts/container-storage-modules/Chart.yaml +++ b/charts/container-storage-modules/Chart.yaml @@ -60,7 +60,7 @@ dependencies: condition: csi-vxflexos.enabled - name: csi-unity - version: 2.7.0 + version: 2.8.0 repository: https://dell.github.io/helm-charts condition: csi-unity.enabled diff --git a/charts/container-storage-modules/values.yaml b/charts/container-storage-modules/values.yaml index 9816554f..180828a9 100644 --- a/charts/container-storage-modules/values.yaml +++ b/charts/container-storage-modules/values.yaml @@ -317,7 +317,7 @@ csi-vxflexos: ######################## csi-unity: enabled: false - version: "v2.7.0" + version: "v2.8.0" # certSecretCount: Represents number of certificate secrets, which user is going to create for # ssl authentication. (unity-cert-0..unity-cert-n) @@ -436,6 +436,11 @@ csi-unity: # tenantName - Tenant name that need to added while adding host entry to the array. tenantName: "" +# Storage Capacity Tracking +# Note: Capacity tracking is supported in kubernetes v1.24 and above, this feature will be automatically disabled in older versions. +storageCapacity: + enabled: true + images: driverRepository: dellemc diff --git a/charts/csi-unity/Chart.yaml b/charts/csi-unity/Chart.yaml index c1a1c271..4258903f 100644 --- a/charts/csi-unity/Chart.yaml +++ b/charts/csi-unity/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 -appVersion: 2.7.0 +appVersion: 2.8.0 name: csi-unity -version: 2.7.0 +version: 2.8.0 description: | Unity XT CSI (Container Storage Interface) driver Kubernetes integration. This chart includes everything required to provision via CSI as @@ -17,4 +17,4 @@ keywords: sources: - https://github.com/dell/csi-unity maintainers: -- name: DellEMC +- name: DellEMC \ No newline at end of file diff --git a/charts/csi-unity/templates/_helpers.tpl b/charts/csi-unity/templates/_helpers.tpl index e5bc0130..d64acb2c 100644 --- a/charts/csi-unity/templates/_helpers.tpl +++ b/charts/csi-unity/templates/_helpers.tpl @@ -48,3 +48,14 @@ Return the appropriate sidecar images based on k8s version {{- end -}} {{- end -}} {{- end -}} + +{{/* +Return true if storage capacity tracking is enabled and is supported based on k8s version +*/}} +{{- define "csi-unity.isStorageCapacitySupported" -}} +{{- if eq .Values.storageCapacity.enabled true -}} + {{- if and (eq .Capabilities.KubeVersion.Major "1") (ge (trimSuffix "+" .Capabilities.KubeVersion.Minor) "24") -}} + {{- true -}} + {{- end -}} +{{- end -}} +{{- end -}} diff --git a/charts/csi-unity/templates/controller.yaml b/charts/csi-unity/templates/controller.yaml index 2cf81728..2b126072 100644 --- a/charts/csi-unity/templates/controller.yaml +++ b/charts/csi-unity/templates/controller.yaml @@ -83,6 +83,18 @@ rules: - apiGroups: [""] resources: ["persistentvolumeclaims/status"] verbs: ["update", "patch"] + # Permissions for CSIStorageCapacity + {{- if eq (include "csi-unity.isStorageCapacitySupported" .) "true" }} + - apiGroups: ["storage.k8s.io"] + resources: ["csistoragecapacities"] + verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] + - apiGroups: [""] + resources: ["pods"] + verbs: ["get"] + - apiGroups: ["apps"] + resources: ["replicasets"] + verbs: ["get"] + {{- end }} --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 @@ -188,9 +200,20 @@ spec: - "--leader-election" - "--leader-election-namespace={{ .Release.Namespace }}" - "--default-fstype={{ .Values.defaultFsType | default "ext4" }}" + - "--enable-capacity={{ (include "csi-unity.isStorageCapacitySupported" .) | default false }}" + - "--capacity-ownerref-level=2" + - "--capacity-poll-interval={{ .Values.storageCapacity.pollInterval | default "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/charts/csi-unity/templates/csidriver.yaml b/charts/csi-unity/templates/csidriver.yaml index f38d58ee..f9d57239 100644 --- a/charts/csi-unity/templates/csidriver.yaml +++ b/charts/csi-unity/templates/csidriver.yaml @@ -3,9 +3,10 @@ kind: CSIDriver metadata: name: csi-unity.dellemc.com spec: + storageCapacity: {{ (include "csi-unity.isStorageCapacitySupported" .) | default false }} attachRequired: true podInfoOnMount: true volumeLifecycleModes: - Persistent - Ephemeral - fsGroupPolicy: {{ .Values.fsGroupPolicy }} + fsGroupPolicy: {{ .Values.fsGroupPolicy }} \ No newline at end of file diff --git a/charts/csi-unity/values.yaml b/charts/csi-unity/values.yaml index 5cca28ff..04e2eef5 100644 --- a/charts/csi-unity/values.yaml +++ b/charts/csi-unity/values.yaml @@ -3,8 +3,8 @@ # version: version of this values file # Note: Do not change this value -# Examples : "v2.7.0" , "nightly" -version: "v2.7.0" +# Examples : "v2.8.0" , "nightly" +version: "v2.8.0" # LogLevel is used to set the logging level of the driver. # Allowed values: "error", "warn"/"warning", "info", "debug" @@ -242,6 +242,20 @@ maxUnityVolumesPerNode: 0 # Examples : "tenant2" , "tenant3" tenantName: "" +# Storage Capacity Tracking +# Note: Capacity tracking is supported in kubernetes v1.24 and above, this feature will be automatically disabled in older versions. +storageCapacity: + # enabled : Enable/Disable storage capacity tracking + # Allowed values: + # true: enable storage capacity tracking + # false: disable storage capacity tracking + # Default value: true + enabled: true + # pollInterval : Configure how often external-provisioner polls the driver to detect changed capacity + # Allowed values: 1m,2m,3m,...,10m,...,60m etc + # Default value: 5m + pollInterval: 5m + images: # "driver" defines the container image, used for the driver container. driverRepository: dellemc