From 06f9751b1657cfbd0fd4fd7c6be89a21d4283498 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 --- charts/cinder-csi-plugin/Chart.yaml | 2 +- .../templates/storageclass.yaml | 24 +++++++++++++++++++ charts/cinder-csi-plugin/values.yaml | 6 +++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/charts/cinder-csi-plugin/Chart.yaml b/charts/cinder-csi-plugin/Chart.yaml index 5a74d5927c..a61cc625a3 100644 --- a/charts/cinder-csi-plugin/Chart.yaml +++ b/charts/cinder-csi-plugin/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: v1.28.0 description: Cinder CSI Chart for OpenStack name: openstack-cinder-csi -version: 2.29.0-alpha.2 +version: 2.29.0-alpha.3 home: https://github.com/kubernetes/cloud-provider-openstack icon: https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png maintainers: diff --git a/charts/cinder-csi-plugin/templates/storageclass.yaml b/charts/cinder-csi-plugin/templates/storageclass.yaml index 704c30038b..071110cca9 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.parameters.type }} + type: {{ .Values.storageClass.parameters.type }} + {{ end }} + {{ if .Values.storageClass.parameters.availabilityZone }} + availabilityZone: {{ .Values.storageClass.parameters.availabilityZone }} + {{ end }} + {{ range .Values.storageClass.parameters.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.parameters.type }} + type: {{ .Values.storageClass.parameters.type }} + {{ end }} + {{ if .Values.storageClass.parameters.availabilityZone }} + availabilityZone: {{ .Values.storageClass.parameters.availabilityZone }} + {{ end }} + {{ range .Values.storageClass.parameters.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..3fb32678c1 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