From 59a0d0034993a06bb0cd587e6b7ea046d231428e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20S=C3=BDkora?= Date: Fri, 2 Dec 2022 12:14:57 +0100 Subject: [PATCH] helm: allow to specify allowed topologies for storage class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomáš Sýkora (cherry picked from commit 57babee11f075d8cad642702e8d3d43929ba3341) --- Documentation/Helm-Charts/ceph-cluster-chart.gotmpl.md | 1 + Documentation/Helm-Charts/ceph-cluster-chart.md | 1 + .../charts/rook-ceph-cluster/templates/cephblockpool.yaml | 6 ++++++ deploy/charts/rook-ceph-cluster/values.yaml | 6 ++++++ 4 files changed, 14 insertions(+) diff --git a/Documentation/Helm-Charts/ceph-cluster-chart.gotmpl.md b/Documentation/Helm-Charts/ceph-cluster-chart.gotmpl.md index 8a719c877..24b275865 100644 --- a/Documentation/Helm-Charts/ceph-cluster-chart.gotmpl.md +++ b/Documentation/Helm-Charts/ceph-cluster-chart.gotmpl.md @@ -75,6 +75,7 @@ The `cephBlockPools` array in the values file will define a list of CephBlockPoo | `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 | `[]` | +| `storageClass.allowedTopologies` | Specifies the [allowedTopologies](https://kubernetes.io/docs/concepts/storage/storage-classes/#allowed-topologies) for storageClass | `[]` | ### **Ceph File Systems** diff --git a/Documentation/Helm-Charts/ceph-cluster-chart.md b/Documentation/Helm-Charts/ceph-cluster-chart.md index dc69cf4fd..fa5a8a7dc 100644 --- a/Documentation/Helm-Charts/ceph-cluster-chart.md +++ b/Documentation/Helm-Charts/ceph-cluster-chart.md @@ -102,6 +102,7 @@ The `cephBlockPools` array in the values file will define a list of CephBlockPoo | `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 | `[]` | +| `storageClass.allowedTopologies` | Specifies the [allowedTopologies](https://kubernetes.io/docs/concepts/storage/storage-classes/#allowed-topologies) for storageClass | `[]` | ### **Ceph File Systems** diff --git a/deploy/charts/rook-ceph-cluster/templates/cephblockpool.yaml b/deploy/charts/rook-ceph-cluster/templates/cephblockpool.yaml index b7db65566..70cefd007 100644 --- a/deploy/charts/rook-ceph-cluster/templates/cephblockpool.yaml +++ b/deploy/charts/rook-ceph-cluster/templates/cephblockpool.yaml @@ -30,5 +30,11 @@ mountOptions: - {{ . }} {{- end }} {{- end }} +{{ if $blockpool.storageClass.allowedTopologies }} +allowedTopologies: +{{ with $blockpool.storageClass.allowedTopologies }} +{{ toYaml . | indent 2 }} +{{ end }} +{{ end }} {{ end }} {{ end }} diff --git a/deploy/charts/rook-ceph-cluster/values.yaml b/deploy/charts/rook-ceph-cluster/values.yaml index 7abd25247..0c2307689 100644 --- a/deploy/charts/rook-ceph-cluster/values.yaml +++ b/deploy/charts/rook-ceph-cluster/values.yaml @@ -417,6 +417,12 @@ cephBlockPools: reclaimPolicy: Delete allowVolumeExpansion: true mountOptions: [] + # see https://kubernetes.io/docs/concepts/storage/storage-classes/#allowed-topologies + allowedTopologies: [] +# - matchLabelExpressions: +# - key: rook-ceph-role +# values: +# - storage-node # 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.