From caa2c8323b9c06a835b62ea022f9e2376110a1de Mon Sep 17 00:00:00 2001 From: Tom Hellier Date: Wed, 1 Dec 2021 10:50:42 +0000 Subject: [PATCH] helm: addition of mountOptions into storage class configuration It should be possible to configure the storage classs mount options, this follows the helm code used by the ceph-csi project for their ceph-csi-rbd and ceph-csi-cephfs helm charts. Signed-off-by: Tom Hellier --- Documentation/helm-ceph-cluster.md | 2 ++ .../charts/rook-ceph-cluster/templates/cephblockpool.yaml | 6 ++++++ .../charts/rook-ceph-cluster/templates/cephfilesystem.yaml | 6 ++++++ deploy/charts/rook-ceph-cluster/values.yaml | 2 ++ 4 files changed, 16 insertions(+) diff --git a/Documentation/helm-ceph-cluster.md b/Documentation/helm-ceph-cluster.md index 46a2fb8a793f..b8167fded0d7 100644 --- a/Documentation/helm-ceph-cluster.md +++ b/Documentation/helm-ceph-cluster.md @@ -88,6 +88,7 @@ The `cephBlockPools` array in the values file will define a list of CephBlockPoo | `storageClass.parameters` | See [Block Storage](ceph-block.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` | +| `storageClass.mountOptions` | Specifies the mount options for storageClass | `[]` | ### Ceph File Systems @@ -101,6 +102,7 @@ The `cephFileSystems` array in the values file will define a list of CephFileSys | `storageClass.name` | The name of the storage class | `ceph-filesystem` | | `storageClass.parameters` | See [Shared Filesystem](ceph-filesystem.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.mountOptions` | Specifies the mount options for storageClass | `[]` | ### Ceph Object Stores diff --git a/deploy/charts/rook-ceph-cluster/templates/cephblockpool.yaml b/deploy/charts/rook-ceph-cluster/templates/cephblockpool.yaml index 41856f5a5287..ad49383808b5 100644 --- a/deploy/charts/rook-ceph-cluster/templates/cephblockpool.yaml +++ b/deploy/charts/rook-ceph-cluster/templates/cephblockpool.yaml @@ -22,5 +22,11 @@ parameters: {{ toYaml $blockpool.storageClass.parameters | indent 2 }} reclaimPolicy: {{ default "Delete" $blockpool.storageClass.reclaimPolicy }} allowVolumeExpansion: {{ default "true" $blockpool.storageClass.allowVolumeExpansion }} +{{- if $blockpool.storageClass.mountOptions }} +mountOptions: + {{- range $blockpool.storageClass.mountOptions }} + - {{ . }} + {{- end }} +{{- end }} {{ end }} {{ end }} diff --git a/deploy/charts/rook-ceph-cluster/templates/cephfilesystem.yaml b/deploy/charts/rook-ceph-cluster/templates/cephfilesystem.yaml index 5c5646bef13a..d2dc1cd12faa 100644 --- a/deploy/charts/rook-ceph-cluster/templates/cephfilesystem.yaml +++ b/deploy/charts/rook-ceph-cluster/templates/cephfilesystem.yaml @@ -23,5 +23,11 @@ parameters: {{ toYaml $filesystem.storageClass.parameters | indent 2 }} reclaimPolicy: {{ default "Delete" $filesystem.storageClass.reclaimPolicy }} allowVolumeExpansion: {{ default "true" $filesystem.storageClass.allowVolumeExpansion }} +{{- if $filesystem.storageClass.mountOptions }} +mountOptions: + {{- range $filesystem.storageClass.mountOptions }} + - {{ . }} + {{- end }} +{{- end }} {{ end }} {{ end }} diff --git a/deploy/charts/rook-ceph-cluster/values.yaml b/deploy/charts/rook-ceph-cluster/values.yaml index 7edc3aae35b2..91ef523da437 100644 --- a/deploy/charts/rook-ceph-cluster/values.yaml +++ b/deploy/charts/rook-ceph-cluster/values.yaml @@ -329,6 +329,7 @@ cephBlockPools: isDefault: true reclaimPolicy: Delete allowVolumeExpansion: true + mountOptions: [] # see https://github.com/rook/rook/blob/master/Documentation/ceph-block.md#provision-storage for available configuration parameters: # (optional) mapOptions is a comma-separated list of map options. @@ -381,6 +382,7 @@ cephFileSystems: name: ceph-filesystem reclaimPolicy: Delete allowVolumeExpansion: true + mountOptions: [] # see https://github.com/rook/rook/blob/master/Documentation/ceph-filesystem.md#provision-storage for available configuration parameters: # The secrets contain Ceph admin credentials.