From edc438ac2698eddd893aabed43795d12f1a0915c Mon Sep 17 00:00:00 2001 From: sakshi-1505 Date: Sun, 15 Oct 2023 19:38:37 +0530 Subject: [PATCH] feat: add support for parametes for storageClass Signed-off-by: sakshi-1505 --- .../templates/storageclass.yaml | 24 +++++++++++++++++++ charts/cinder-csi-plugin/values.yaml | 6 +++++ 2 files changed, 30 insertions(+) diff --git a/charts/cinder-csi-plugin/templates/storageclass.yaml b/charts/cinder-csi-plugin/templates/storageclass.yaml index 704c30038b..54a5db7aeb 100644 --- a/charts/cinder-csi-plugin/templates/storageclass.yaml +++ b/charts/cinder-csi-plugin/templates/storageclass.yaml @@ -9,6 +9,18 @@ metadata: {{- end }} provisioner: cinder.csi.openstack.org reclaimPolicy: Delete +{{ if .Values.storageClass.parameters.enabled }} +parameters: + {{ if .Values.storageClass.type }} + type: {{ .Values.storageClass.type }} + {{ end }} + {{ if .Values.storageClass.availabilityZone }} + availabilityZone: {{ .Values.storageClass.availabilityZone }} + {{ end }} + {{ range .Values.storageClass.additionalParameters }} + {{ .key }}: {{ .value }} + {{ end }} +{{ end }} allowVolumeExpansion: {{ .Values.storageClass.delete.allowVolumeExpansion }} --- apiVersion: storage.k8s.io/v1 @@ -21,5 +33,17 @@ metadata: {{- end }} provisioner: cinder.csi.openstack.org reclaimPolicy: Retain +{{ if .Values.storageClass.parameters.enabled }} +parameters: + {{ if .Values.storageClass.type }} + type: {{ .Values.storageClass.type }} + {{ end }} + {{ if .Values.storageClass.availabilityZone }} + availabilityZone: {{ .Values.storageClass.availabilityZone }} + {{ end }} + {{ range .Values.storageClass.additionalParameters }} + {{ .key }}: {{ .value }} + {{ end }} +{{ end }} allowVolumeExpansion: {{ .Values.storageClass.retain.allowVolumeExpansion }} {{- end }} \ No newline at end of file diff --git a/charts/cinder-csi-plugin/values.yaml b/charts/cinder-csi-plugin/values.yaml index a454a48e6d..ba00288f88 100644 --- a/charts/cinder-csi-plugin/values.yaml +++ b/charts/cinder-csi-plugin/values.yaml @@ -160,6 +160,12 @@ secret: storageClass: enabled: true + parameters: + enabled: false + type: gp2 + availabilityZone: us-east-1a + additionalParameters: + volumeSize: 10Gi delete: isDefault: false allowVolumeExpansion: true