diff --git a/charts/cluster-addons/templates/openstack/csi-cinder.yaml b/charts/cluster-addons/templates/openstack/csi-cinder.yaml index 4f98325..9a0d54a 100644 --- a/charts/cluster-addons/templates/openstack/csi-cinder.yaml +++ b/charts/cluster-addons/templates/openstack/csi-cinder.yaml @@ -55,7 +55,7 @@ spec: - secret: name: {{ include "cluster-addons.componentName" (list . "csi-cinder") }}-config key: overrides -{{- if .Values.openstack.csiCinder.storageClass.enabled }} +{{- if .Values.openstack.csiCinder.defaultStorageClass.enabled }} --- apiVersion: addons.stackhpc.com/v1alpha1 kind: Manifests @@ -72,27 +72,50 @@ spec: releaseName: csi-cinder-storageclass manifestSources: - template: | - {{- with .Values.openstack.csiCinder.storageClass }} + {{- with .Values.openstack.csiCinder.defaultStorageClass }} apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: {{ .name }} - {{- if .isDefault }} annotations: storageclass.kubernetes.io/is-default-class: "true" - {{- end }} provisioner: cinder.csi.openstack.org parameters: availability: {{ .availabilityZone }} {{- with .volumeType }} type: {{ . }} {{- end }} + {{- with .fstype }} + fstype: {{ . }} + {{- end }} reclaimPolicy: {{ .reclaimPolicy }} allowVolumeExpansion: {{ .allowVolumeExpansion }} - volumeBindingMode: WaitForFirstConsumer + volumeBindingMode: {{ .volumeBindingMode }} {{- with .allowedTopologies }} allowedTopologies: {{ toYaml . | nindent 6 }} {{- end }} {{- end }} +{{- range $rangeItem := .Values.openstack.csiCinder.additionalStorageClasses }} + - template: | + apiVersion: storage.k8s.io/v1 + kind: StorageClass + metadata: + name: {{ $rangeItem.name }} + provisioner: cinder.csi.openstack.org + parameters: + availability: {{ $rangeItem.availabilityZone }} + {{- with $rangeItem.volumeType }} + type: {{ . }} + {{- end }} + {{- with $rangeItem.fstype }} + fstype: {{ . }} + {{- end }} + reclaimPolicy: {{ $rangeItem.reclaimPolicy }} + allowVolumeExpansion: {{ $rangeItem.allowVolumeExpansion }} + volumeBindingMode: {{ $rangeItem.volumeBindingMode }} + {{- with $rangeItem.allowedTopologies }} + allowedTopologies: {{ toYaml . | nindent 6 }} + {{- end }} +{{- end }} {{- end }} {{- end }} diff --git a/charts/cluster-addons/values.yaml b/charts/cluster-addons/values.yaml index 29d8f4c..6dd2414 100644 --- a/charts/cluster-addons/values.yaml +++ b/charts/cluster-addons/values.yaml @@ -68,13 +68,11 @@ openstack: version: 2.28.1 values: {} # Variables affecting the definition of the storage class - storageClass: + defaultStorageClass: # Indicates if the storage class should be enabled enabled: true # The name of the storage class name: csi-cinder - # Indicates if the storage class should be annotated as the default storage class - isDefault: true # The reclaim policy for the storage class reclaimPolicy: Delete # Indicates if volume expansion is allowed @@ -84,9 +82,30 @@ openstack: # The Cinder volume type to use for volumes provisioned by the storage class # If not given, the default volume type will be used volumeType: + # The volumeBindingMode field controls when volume binding and dynamic provisioning should occur. + volumeBindingMode: WaitForFirstConsumer # The allowed topologies for the storage class allowedTopologies: - + # Filesystem type supported by Kubernetes. Defaults to "ext4" + # fstype: + additionalStorageClasses: [] + # - name: additional-storage-classname + # The reclaim policy for the storage class + # reclaimPolicy: Delete + # The reclaim policy for the storage class + # allowVolumeExpansion: true + # The Cinder availability zone to use for volumes provisioned by the storage class + # availabilityZone: nova + # The Cinder volume type to use for volumes provisioned by the storage class + # If not given, the default volume type will be used + # volumeType: + # The volumeBindingMode field controls when volume binding and dynamic provisioning should occur. + # Required for additionalStorageClasses. + # volumeBindingMode: WaitForFirstConsumer + # The allowed topologies for the storage class + # allowedTopologies: + # Filesystem type supported by Kubernetes. Defaults to "ext4" + # fstype: k8sKeystoneAuth: enabled: false targetNamespace: kube-system