helm: allow custom labels and annotations for storage classes

Storage classes were missing the possilbilty to attach custom labels and
annotations. This change brings it on par with VolumeSnapshotClass
objects.

Signed-off-by: Peter Dahlberg <catdog2@tuxzone.org>
(cherry picked from commit de82481d80)
This commit is contained in:
Peter Dahlberg authored and Mergify committed 2024-06-12 13:34:29 +00:00
1 parent dbe24136ca
commit ed89e36c9f
7 files changed
+52 -4

No files matched your search

@@ -80,6 +80,8 @@ The `cephBlockPools` array in the values file will define a list of CephBlockPoo
| `storageClass.enabled` | Whether a storage class is deployed alongside the CephBlockPool | `true` |
| `storageClass.isDefault` | Whether the storage class will be the default storage class for PVCs. See [PersistentVolumeClaim documentation](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims) for details. | `true` |
| `storageClass.name` | The name of the storage class | `ceph-block` |
| `storageClass.annotations` | Additional storage class annotations | `{}` |
| `storageClass.labels` | Additional storage class labels | `{}` |
| `storageClass.parameters` | See [Block Storage](../Storage-Configuration/Block-Storage-RBD/block-storage.md) documentation or the helm values.yaml for suitable values | see values.yaml |
| `storageClass.reclaimPolicy` | The default [Reclaim Policy](https://kubernetes.io/docs/concepts/storage/storage-classes/#reclaim-policy) to apply to PVCs created with this storage class. | `Delete` |
| `storageClass.allowVolumeExpansion` | Whether [volume expansion](https://kubernetes.io/docs/concepts/storage/storage-classes/#allow-volume-expansion) is allowed by default. | `true` |
@@ -96,6 +98,8 @@ The `cephFileSystems` array in the values file will define a list of CephFileSys
| `spec` | The CephFileSystem spec, see the [CephFilesystem CRD](../CRDs/Shared-Filesystem/ceph-filesystem-crd.md) documentation. | see values.yaml |
| `storageClass.enabled` | Whether a storage class is deployed alongside the CephFileSystem | `true` |
| `storageClass.name` | The name of the storage class | `ceph-filesystem` |
| `storageClass.annotations` | Additional storage class annotations | `{}` |
| `storageClass.labels` | Additional storage class labels | `{}` |
| `storageClass.pool` | The name of [Data Pool](../CRDs/Shared-Filesystem/ceph-filesystem-crd.md#pools), without the filesystem name prefix | `data0` |
| `storageClass.parameters` | See [Shared Filesystem](../Storage-Configuration/Shared-Filesystem-CephFS/filesystem-storage.md) documentation or the helm values.yaml for suitable values | see values.yaml |
| `storageClass.reclaimPolicy` | The default [Reclaim Policy](https://kubernetes.io/docs/concepts/storage/storage-classes/#reclaim-policy) to apply to PVCs created with this storage class. | `Delete` |
@@ -111,6 +115,8 @@ The `cephObjectStores` array in the values file will define a list of CephObject
| `spec` | The CephObjectStore spec, see the [CephObjectStore CRD](../CRDs/Object-Storage/ceph-object-store-crd.md) documentation. | see values.yaml |
| `storageClass.enabled` | Whether a storage class is deployed alongside the CephObjectStore | `true` |
| `storageClass.name` | The name of the storage class | `ceph-bucket` |
| `storageClass.annotations` | Additional storage class annotations | `{}` |
| `storageClass.labels` | Additional storage class labels | `{}` |
| `storageClass.parameters` | See [Object Store storage class](../Storage-Configuration/Object-Storage-RGW/ceph-object-bucket-claim.md) documentation or the helm values.yaml for suitable values | see values.yaml |
| `storageClass.reclaimPolicy` | The default [Reclaim Policy](https://kubernetes.io/docs/concepts/storage/storage-classes/#reclaim-policy) to apply to PVCs created with this storage class. | `Delete` |
| `ingress.enabled` | Enable an ingress for the object store | `false` |
@@ -109,6 +109,8 @@ The `cephBlockPools` array in the values file will define a list of CephBlockPoo
| `storageClass.enabled` | Whether a storage class is deployed alongside the CephBlockPool | `true` |
| `storageClass.isDefault` | Whether the storage class will be the default storage class for PVCs. See [PersistentVolumeClaim documentation](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims) for details. | `true` |
| `storageClass.name` | The name of the storage class | `ceph-block` |
| `storageClass.annotations` | Additional storage class annotations | `{}` |
| `storageClass.labels` | Additional storage class labels | `{}` |
| `storageClass.parameters` | See [Block Storage](../Storage-Configuration/Block-Storage-RBD/block-storage.md) documentation or the helm values.yaml for suitable values | see values.yaml |
| `storageClass.reclaimPolicy` | The default [Reclaim Policy](https://kubernetes.io/docs/concepts/storage/storage-classes/#reclaim-policy) to apply to PVCs created with this storage class. | `Delete` |
| `storageClass.allowVolumeExpansion` | Whether [volume expansion](https://kubernetes.io/docs/concepts/storage/storage-classes/#allow-volume-expansion) is allowed by default. | `true` |
@@ -125,6 +127,8 @@ The `cephFileSystems` array in the values file will define a list of CephFileSys
| `spec` | The CephFileSystem spec, see the [CephFilesystem CRD](../CRDs/Shared-Filesystem/ceph-filesystem-crd.md) documentation. | see values.yaml |
| `storageClass.enabled` | Whether a storage class is deployed alongside the CephFileSystem | `true` |
| `storageClass.name` | The name of the storage class | `ceph-filesystem` |
| `storageClass.annotations` | Additional storage class annotations | `{}` |
| `storageClass.labels` | Additional storage class labels | `{}` |
| `storageClass.pool` | The name of [Data Pool](../CRDs/Shared-Filesystem/ceph-filesystem-crd.md#pools), without the filesystem name prefix | `data0` |
| `storageClass.parameters` | See [Shared Filesystem](../Storage-Configuration/Shared-Filesystem-CephFS/filesystem-storage.md) documentation or the helm values.yaml for suitable values | see values.yaml |
| `storageClass.reclaimPolicy` | The default [Reclaim Policy](https://kubernetes.io/docs/concepts/storage/storage-classes/#reclaim-policy) to apply to PVCs created with this storage class. | `Delete` |
@@ -140,6 +144,8 @@ The `cephObjectStores` array in the values file will define a list of CephObject
| `spec` | The CephObjectStore spec, see the [CephObjectStore CRD](../CRDs/Object-Storage/ceph-object-store-crd.md) documentation. | see values.yaml |
| `storageClass.enabled` | Whether a storage class is deployed alongside the CephObjectStore | `true` |
| `storageClass.name` | The name of the storage class | `ceph-bucket` |
| `storageClass.annotations` | Additional storage class annotations | `{}` |
| `storageClass.labels` | Additional storage class labels | `{}` |
| `storageClass.parameters` | See [Object Store storage class](../Storage-Configuration/Object-Storage-RGW/ceph-object-bucket-claim.md) documentation or the helm values.yaml for suitable values | see values.yaml |
| `storageClass.reclaimPolicy` | The default [Reclaim Policy](https://kubernetes.io/docs/concepts/storage/storage-classes/#reclaim-policy) to apply to PVCs created with this storage class. | `Delete` |
| `ingress.enabled` | Enable an ingress for the object store | `false` |
@@ -14,8 +14,15 @@ apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ $blockpool.storageClass.name }}
{{- if $blockpool.storageClass.labels }}
labels:
{{ toYaml $blockpool.storageClass.labels | indent 4 }}
{{- end }}
annotations:
storageclass.kubernetes.io/is-default-class: "{{ if default false $blockpool.storageClass.isDefault }}true{{ else }}false{{ end }}"
{{- if $blockpool.storageClass.annotations }}
{{ toYaml $blockpool.storageClass.annotations | indent 4 }}
{{- end }}
{{- if $root.Values.csiDriverNamePrefix }}
provisioner: {{ $root.Values.csiDriverNamePrefix }}.rbd.csi.ceph.com
{{- else }}
@@ -22,10 +22,16 @@ apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ $ecblockpool.storageClass.name }}
{{- if $ecblockpool.storageClass.isDefault }}
{{- if $ecblockpool.storageClass.labels }}
labels:
{{ toYaml $ecblockpool.storageClass.labels | indent 4 }}
{{- end }}
annotations:
storageclass.kubernetes.io/is-default-class: "true"
{{end}}
storageclass.kubernetes.io/is-default-class: "{{ if default false $ecblockpool.storageClass.isDefault }}true{{ else }}false{{ end }}"
{{- if $ecblockpool.storageClass.annotations }}
{{ toYaml $ecblockpool.storageClass.annotations | indent 4 }}
{{- end }}
{{- if $root.Values.csiDriverNamePrefix }}
provisioner: {{ $root.Values.csiDriverNamePrefix }}.rbd.csi.ceph.com
{{- else }}
@@ -33,8 +33,15 @@ apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ $filesystem.storageClass.name }}
{{- if $filesystem.storageClass.labels }}
labels:
{{ toYaml $filesystem.storageClass.labels | indent 4 }}
{{- end }}
annotations:
storageclass.kubernetes.io/is-default-class: "{{ if default false $filesystem.storageClass.isDefault }}true{{ else }}false{{ end }}"
{{- if $filesystem.storageClass.annotations }}
{{ toYaml $filesystem.storageClass.annotations | indent 4 }}
{{- end }}
{{- if $root.Values.csiDriverNamePrefix }}
provisioner: {{ $root.Values.csiDriverNamePrefix }}.cephfs.csi.ceph.com
{{- else }}
@@ -14,6 +14,14 @@ apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ $objectstore.storageClass.name }}
{{- if $objectstore.storageClass.labels }}
labels:
{{ toYaml $objectstore.storageClass.labels | indent 4 }}
{{- end }}
{{- if $objectstore.storageClass.annotations }}
annotations:
{{ toYaml $objectstore.storageClass.annotations | indent 4 }}
{{- end }}
provisioner: {{ $root.Release.Namespace }}.ceph.rook.io/bucket
reclaimPolicy: {{ default "Delete" $objectstore.storageClass.reclaimPolicy }}
volumeBindingMode: {{ default "Immediate" $objectstore.storageClass.volumeBindingMode }}
+9 -1
View File
@@ -452,6 +452,8 @@ cephBlockPools:
storageClass:
enabled: true
name: ceph-block
annotations: { }
labels: { }
isDefault: true
reclaimPolicy: Delete
allowVolumeExpansion: true
@@ -534,6 +536,8 @@ cephFileSystems:
reclaimPolicy: Delete
allowVolumeExpansion: true
volumeBindingMode: "Immediate"
annotations: { }
labels: { }
mountOptions: []
# see https://github.com/rook/rook/blob/master/Documentation/Storage-Configuration/Shared-Filesystem-CephFS/filesystem-storage.md#provision-storage for available configuration
parameters:
@@ -606,6 +610,8 @@ cephObjectStores:
name: ceph-bucket
reclaimPolicy: Delete
volumeBindingMode: "Immediate"
annotations: { }
labels: { }
# see https://github.com/rook/rook/blob/master/Documentation/Storage-Configuration/Object-Storage-RGW/ceph-object-bucket-claim.md#storageclass for available configuration
parameters:
# note: objectStoreNamespace and objectStoreName are configured by the chart
@@ -669,8 +675,10 @@ cephObjectStores:
# storageClass:
# provisioner: rook-ceph.rbd.csi.ceph.com # csi-provisioner-name
# enabled: true
# name: rook-ceph-block
# name: rook-ceph-block
# isDefault: false
# annotations: { }
# labels: { }
# allowVolumeExpansion: true
# reclaimPolicy: Delete