Skip to content

Commit

Permalink
feat: add support for parametes for storageClass
Browse files Browse the repository at this point in the history
Signed-off-by: sakshi-1505 <[email protected]>
  • Loading branch information
sakshi-1505 committed Oct 15, 2023
1 parent 60ad70c commit edc438a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
24 changes: 24 additions & 0 deletions charts/cinder-csi-plugin/templates/storageclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
6 changes: 6 additions & 0 deletions charts/cinder-csi-plugin/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit edc438a

Please sign in to comment.