From d22e7a1bdb01da31633147f5c920879d8a590d5e Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Wed, 1 Sep 2021 20:26:15 +0530 Subject: [PATCH] helm: update templates for ceph.conf updated cephfs and rbd templates to configure the ceph.conf content. Signed-off-by: Madhu Rajanna --- .../ceph-csi-cephfs/templates/ceph-conf.yaml | 15 ++++++++++++++ .../templates/nodeplugin-daemonset.yaml | 5 +++++ .../templates/provisioner-deployment.yaml | 5 +++++ charts/ceph-csi-cephfs/values.yaml | 20 +++++++++++++++++++ charts/ceph-csi-rbd/templates/ceph-conf.yaml | 15 ++++++++++++++ .../templates/nodeplugin-daemonset.yaml | 5 +++++ .../templates/provisioner-deployment.yaml | 7 +++++++ charts/ceph-csi-rbd/values.yaml | 20 +++++++++++++++++++ 8 files changed, 92 insertions(+) create mode 100644 charts/ceph-csi-cephfs/templates/ceph-conf.yaml create mode 100644 charts/ceph-csi-rbd/templates/ceph-conf.yaml diff --git a/charts/ceph-csi-cephfs/templates/ceph-conf.yaml b/charts/ceph-csi-cephfs/templates/ceph-conf.yaml new file mode 100644 index 000000000..25c773bca --- /dev/null +++ b/charts/ceph-csi-cephfs/templates/ceph-conf.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: ceph-config + namespace: {{ .Release.Namespace }} + labels: + app: {{ include "ceph-csi-cephfs.name" . }} + chart: {{ include "ceph-csi-cephfs.chart" . }} + component: {{ .Values.nodeplugin.name }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: + ceph.conf: | +{{ tpl .Values.cephconf . | indent 4 }} + keyring: "" diff --git a/charts/ceph-csi-cephfs/templates/nodeplugin-daemonset.yaml b/charts/ceph-csi-cephfs/templates/nodeplugin-daemonset.yaml index 9d518d962..8a4c43c05 100644 --- a/charts/ceph-csi-cephfs/templates/nodeplugin-daemonset.yaml +++ b/charts/ceph-csi-cephfs/templates/nodeplugin-daemonset.yaml @@ -118,6 +118,8 @@ spec: - mountPath: /lib/modules name: lib-modules readOnly: true + - name: ceph-config + mountPath: /etc/ceph/ - name: ceph-csi-config mountPath: /etc/ceph-csi-config/ - name: keys-tmp-dir @@ -182,6 +184,9 @@ spec: - name: host-dev hostPath: path: /dev + - name: ceph-config + configMap: + name: ceph-config - name: ceph-csi-config configMap: name: {{ .Values.configMapName | quote }} diff --git a/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml b/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml index c8ba5e2a4..053f5dd3e 100644 --- a/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml +++ b/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml @@ -173,6 +173,8 @@ spec: readOnly: true - name: host-dev mountPath: /dev + - name: ceph-config + mountPath: /etc/ceph/ - name: ceph-csi-config mountPath: /etc/ceph-csi-config/ - name: keys-tmp-dir @@ -217,6 +219,9 @@ spec: - name: host-dev hostPath: path: /dev + - name: ceph-config + configMap: + name: ceph-config - name: ceph-csi-config configMap: name: {{ .Values.configMapName | quote }} diff --git a/charts/ceph-csi-cephfs/values.yaml b/charts/ceph-csi-cephfs/values.yaml index effca9b49..d01274b98 100644 --- a/charts/ceph-csi-cephfs/values.yaml +++ b/charts/ceph-csi-cephfs/values.yaml @@ -275,6 +275,26 @@ secret: adminID: adminKey: <Ceph auth key corresponding to ID above> +# This is a sample configmap that helps define a Ceph configuration as required +# by the CSI plugins. +# Sample ceph.conf available at +# https://github.com/ceph/ceph/blob/master/src/sample.ceph.conf Detailed +# documentation is available at +# https://docs.ceph.com/en/latest/rados/configuration/ceph-conf/ +cephconf: | + [global] + auth_cluster_required = cephx + auth_service_required = cephx + auth_client_required = cephx + + # Workaround for http://tracker.ceph.com/issues/23446 + fuse_set_user_groups = false + + # ceph-fuse which uses libfuse2 by default has write buffer size of 2KiB + # adding 'fuse_big_writes = true' option by default to override this limit + # see https://github.com/ceph/ceph-csi/issues/1928 + fuse_big_writes = true + ######################################################### # Variables for 'internal' use please use with caution! # ######################################################### diff --git a/charts/ceph-csi-rbd/templates/ceph-conf.yaml b/charts/ceph-csi-rbd/templates/ceph-conf.yaml new file mode 100644 index 000000000..a9a6f0026 --- /dev/null +++ b/charts/ceph-csi-rbd/templates/ceph-conf.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: ceph-config + namespace: {{ .Release.Namespace }} + labels: + app: {{ include "ceph-csi-rbd.name" . }} + chart: {{ include "ceph-csi-rbd.chart" . }} + component: {{ .Values.nodeplugin.name }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: + ceph.conf: | +{{ tpl .Values.cephconf . | indent 4 }} + keyring: "" diff --git a/charts/ceph-csi-rbd/templates/nodeplugin-daemonset.yaml b/charts/ceph-csi-rbd/templates/nodeplugin-daemonset.yaml index 003fbf5ec..76b45bf38 100644 --- a/charts/ceph-csi-rbd/templates/nodeplugin-daemonset.yaml +++ b/charts/ceph-csi-rbd/templates/nodeplugin-daemonset.yaml @@ -114,6 +114,8 @@ spec: readOnly: true - name: ceph-csi-config mountPath: /etc/ceph-csi-config/ + - name: ceph-config + mountPath: /etc/ceph/ - name: ceph-csi-encryption-kms-config mountPath: /etc/ceph-csi-encryption-kms-config/ - name: plugin-dir @@ -190,6 +192,9 @@ spec: - name: lib-modules hostPath: path: /lib/modules + - name: ceph-config + configMap: + name: ceph-config - name: ceph-csi-config configMap: name: {{ .Values.configMapName | quote }} diff --git a/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml b/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml index a92e17368..d4b2426f6 100644 --- a/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml +++ b/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml @@ -181,6 +181,8 @@ spec: readOnly: true - name: ceph-csi-config mountPath: /etc/ceph-csi-config/ + - name: ceph-config + mountPath: /etc/ceph/ - name: ceph-csi-encryption-kms-config mountPath: /etc/ceph-csi-encryption-kms-config/ - name: keys-tmp-dir @@ -213,6 +215,8 @@ spec: mountPath: /etc/ceph-csi-config/ - name: keys-tmp-dir mountPath: /tmp/csi/keys + - name: ceph-config + mountPath: /etc/ceph/ resources: {{ toYaml .Values.nodeplugin.plugin.resources | indent 12 }} {{- end }} @@ -254,6 +258,9 @@ spec: - name: lib-modules hostPath: path: /lib/modules + - name: ceph-config + configMap: + name: ceph-config - name: ceph-csi-config configMap: name: {{ .Values.configMapName | quote }} diff --git a/charts/ceph-csi-rbd/values.yaml b/charts/ceph-csi-rbd/values.yaml index 8a00d96d9..1e967cc20 100644 --- a/charts/ceph-csi-rbd/values.yaml +++ b/charts/ceph-csi-rbd/values.yaml @@ -372,6 +372,26 @@ secret: # Encryption passphrase encryptionPassphrase: test_passphrase +# This is a sample configmap that helps define a Ceph configuration as required +# by the CSI plugins. +# Sample ceph.conf available at +# https://github.com/ceph/ceph/blob/master/src/sample.ceph.conf Detailed +# documentation is available at +# https://docs.ceph.com/en/latest/rados/configuration/ceph-conf/ +cephconf: | + [global] + auth_cluster_required = cephx + auth_service_required = cephx + auth_client_required = cephx + + # Workaround for http://tracker.ceph.com/issues/23446 + fuse_set_user_groups = false + + # ceph-fuse which uses libfuse2 by default has write buffer size of 2KiB + # adding 'fuse_big_writes = true' option by default to override this limit + # see https://github.com/ceph/ceph-csi/issues/1928 + fuse_big_writes = true + ######################################################### # Variables for 'internal' use please use with caution! # #########################################################