From 3fbe7a8c7784852e76d11c0c77c626500da00cd9 Mon Sep 17 00:00:00 2001 From: james-choncholas Date: Sun, 25 Aug 2024 18:17:45 -0400 Subject: [PATCH] helm: optionally set userID and userKey in cephfs chart According to https://github.com/ceph/ceph-csi/issues/4467 the cephfs static provisioner expect userID and userKey in the credential secret. Add these values to the helm chart so that they are only included in the templated yaml if the values are non-empty. Signed-off-by: james-choncholas --- charts/ceph-csi-cephfs/README.md | 4 +++- charts/ceph-csi-cephfs/templates/secret.yaml | 6 ++++++ charts/ceph-csi-cephfs/values.yaml | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/charts/ceph-csi-cephfs/README.md b/charts/ceph-csi-cephfs/README.md index 1769e3f28..2033ca3ad 100644 --- a/charts/ceph-csi-cephfs/README.md +++ b/charts/ceph-csi-cephfs/README.md @@ -194,7 +194,9 @@ charts and their default values. | `secret.create` | Specifies whether the secret should be created | `false` | | `secret.name` | Specifies the cephFS secret name | `csi-cephfs-secret` | | `secret.adminID` | Specifies the admin ID of the cephFS secret | `` | -| `secret.adminKey` | Specifies the key that corresponds to the adminID | `<Ceph auth key corresponding to ID above>` | +| `secret.adminKey` | Specifies the key that corresponds to the adminID | `""` | +| `secret.userID` | Specifies the user ID of the cephFS secret. Optional, used for static provisioned PVC. | `""` | +| `secret.userKey` | Specifies the key that corresponds to the userID. Optional, used for static provisioned PVC. | `<Ceph auth key corresponding to ID above>` | | `selinuxMount` | Mount the host /etc/selinux inside pods to support selinux-enabled filesystems | `true` | | `CSIDriver.fsGroupPolicy` | Specifies the fsGroupPolicy for the CSI driver object | `File` | | `CSIDriver.seLinuxMount` | Specify for efficient SELinux volume relabeling | `true` | diff --git a/charts/ceph-csi-cephfs/templates/secret.yaml b/charts/ceph-csi-cephfs/templates/secret.yaml index bd5b99a4b..4ac013b75 100644 --- a/charts/ceph-csi-cephfs/templates/secret.yaml +++ b/charts/ceph-csi-cephfs/templates/secret.yaml @@ -14,6 +14,12 @@ metadata: heritage: {{ .Release.Service }} {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} stringData: + {{- if .Values.secret.userID }} + userID: {{ .Values.secret.userID }} + {{- end }} + {{- if .Values.secret.userKey }} + userKey: {{ .Values.secret.userKey }} + {{- end }} adminID: {{ .Values.secret.adminID }} adminKey: {{ .Values.secret.adminKey }} {{- end -}} diff --git a/charts/ceph-csi-cephfs/values.yaml b/charts/ceph-csi-cephfs/values.yaml index f2cc91b25..4b5208464 100644 --- a/charts/ceph-csi-cephfs/values.yaml +++ b/charts/ceph-csi-cephfs/values.yaml @@ -331,6 +331,9 @@ secret: # specified in the storage class adminID: <plaintext ID> adminKey: <Ceph auth key corresponding to ID above> + # User credentials are required for the static provisioned PVC. + userID: "" + userKey: "" # This is a sample configmap that helps define a Ceph configuration as required # by the CSI plugins.