From eefa6715b87d1928c1e046d56d5d6712bf2fd682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20Gagn=C3=A9?= Date: Thu, 26 Feb 2026 16:28:08 -0500 Subject: [PATCH] feat(manila): allow users to provide configs in manila.conf.d MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow users to provide additional projected volumes to be mounted into the various deployments, statefulsets, and jobs that the manila chart has in the /etc/manila/manila.conf.d/ path. This allows for users to provide service account or database secrets via different operators as well as provide ways to use the chart to define common deployments while being able to have site specific overrides. Change-Id: Ie8b8e1851061897ece5015697db2dcfe8df0fea3 Signed-off-by: Mathieu Gagné --- manila/templates/bin/_manila-data.sh.tpl | 3 ++- manila/templates/bin/_manila-scheduler.sh.tpl | 3 ++- manila/templates/bin/_manila-share.sh.tpl | 1 + manila/templates/deployment-api.yaml | 12 ++++++++++++ manila/templates/deployment-data.yaml | 12 ++++++++++++ manila/templates/deployment-scheduler.yaml | 12 ++++++++++++ manila/templates/deployment-share.yaml | 12 ++++++++++++ manila/values.yaml | 9 +++++++++ releasenotes/notes/manila-a5beeacdb577dd23.yaml | 7 +++++++ 9 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/manila-a5beeacdb577dd23.yaml diff --git a/manila/templates/bin/_manila-data.sh.tpl b/manila/templates/bin/_manila-data.sh.tpl index 6e7346442e..4ff71e3e51 100644 --- a/manila/templates/bin/_manila-data.sh.tpl +++ b/manila/templates/bin/_manila-data.sh.tpl @@ -16,4 +16,5 @@ limitations under the License. set -ex exec manila-data \ - --config-file /etc/manila/manila.conf + --config-file /etc/manila/manila.conf \ + --config-dir /etc/manila/manila.conf.d diff --git a/manila/templates/bin/_manila-scheduler.sh.tpl b/manila/templates/bin/_manila-scheduler.sh.tpl index 82c1848c72..c0db3b49ac 100644 --- a/manila/templates/bin/_manila-scheduler.sh.tpl +++ b/manila/templates/bin/_manila-scheduler.sh.tpl @@ -16,4 +16,5 @@ limitations under the License. set -ex exec manila-scheduler \ - --config-file /etc/manila/manila.conf + --config-file /etc/manila/manila.conf \ + --config-dir /etc/manila/manila.conf.d diff --git a/manila/templates/bin/_manila-share.sh.tpl b/manila/templates/bin/_manila-share.sh.tpl index 68fde6613c..565d79ba50 100644 --- a/manila/templates/bin/_manila-share.sh.tpl +++ b/manila/templates/bin/_manila-share.sh.tpl @@ -17,6 +17,7 @@ limitations under the License. set -ex exec manila-share \ --config-file /etc/manila/manila.conf \ + --config-dir /etc/manila/manila.conf.d \ {{- if and ( empty .Values.conf.manila.generic.service_network_host ) ( .Values.pod.use_fqdn.share ) }} --config-file /tmp/pod-shared/manila-share-fqdn.conf {{- end }} diff --git a/manila/templates/deployment-api.yaml b/manila/templates/deployment-api.yaml index cdb117f49e..a86d0f143d 100644 --- a/manila/templates/deployment-api.yaml +++ b/manila/templates/deployment-api.yaml @@ -17,6 +17,7 @@ limitations under the License. {{- $mounts_manila_api := .Values.pod.mounts.manila_api.manila_api }} {{- $mounts_manila_api_init := .Values.pod.mounts.manila_api.init_container }} +{{- $etcSources := .Values.pod.etcSources.manila_api }} {{- $serviceAccountName := "manila-api" }} {{ tuple $envAll "api" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} @@ -99,6 +100,9 @@ spec: mountPath: /etc/manila/manila.conf subPath: manila.conf readOnly: true + - name: manila-etc-snippets + mountPath: /etc/manila/manila.conf.d/ + readOnly: true - name: manila-etc mountPath: /etc/manila/manila-api-uwsgi.ini subPath: manila-api-uwsgi.ini @@ -139,6 +143,14 @@ spec: secret: secretName: manila-etc defaultMode: 0444 + - name: manila-etc-snippets +{{- if $etcSources }} + projected: + sources: +{{ toYaml $etcSources | indent 14 }} +{{- else }} + emptyDir: {} +{{ end }} - name: manila-bin configMap: name: manila-bin diff --git a/manila/templates/deployment-data.yaml b/manila/templates/deployment-data.yaml index 8be7e2d1c9..44a0f124d6 100644 --- a/manila/templates/deployment-data.yaml +++ b/manila/templates/deployment-data.yaml @@ -17,6 +17,7 @@ limitations under the License. {{- $mounts_manila_data := .Values.pod.mounts.manila_data.manila_data }} {{- $mounts_manila_data_init := .Values.pod.mounts.manila_data.init_container }} +{{- $etcSources := .Values.pod.etcSources.manila_data }} {{- $serviceAccountName := "manila-data" }} {{ tuple $envAll "data" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} @@ -84,6 +85,9 @@ spec: mountPath: /etc/manila/manila.conf subPath: manila.conf readOnly: true + - name: manila-etc-snippets + mountPath: /etc/manila/manila.conf.d/ + readOnly: true {{- if .Values.conf.manila.DEFAULT.log_config_append }} - name: manila-etc mountPath: {{ .Values.conf.manila.DEFAULT.log_config_append }} @@ -116,6 +120,14 @@ spec: secret: secretName: manila-etc defaultMode: 0444 + - name: manila-etc-snippets +{{- if $etcSources }} + projected: + sources: +{{ toYaml $etcSources | indent 14 }} +{{- else }} + emptyDir: {} +{{ end }} - name: manila-bin configMap: name: manila-bin diff --git a/manila/templates/deployment-scheduler.yaml b/manila/templates/deployment-scheduler.yaml index f9e1d7988f..35b2e8cb55 100644 --- a/manila/templates/deployment-scheduler.yaml +++ b/manila/templates/deployment-scheduler.yaml @@ -17,6 +17,7 @@ limitations under the License. {{- $mounts_manila_scheduler := .Values.pod.mounts.manila_scheduler.manila_scheduler }} {{- $mounts_manila_scheduler_init := .Values.pod.mounts.manila_scheduler.init_container }} +{{- $etcSources := .Values.pod.etcSources.manila_scheduler }} {{- $serviceAccountName := "manila-scheduler" }} {{ tuple $envAll "scheduler" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} @@ -84,6 +85,9 @@ spec: mountPath: /etc/manila/manila.conf subPath: manila.conf readOnly: true + - name: manila-etc-snippets + mountPath: /etc/manila/manila.conf.d/ + readOnly: true {{- if .Values.conf.manila.DEFAULT.log_config_append }} - name: manila-etc mountPath: {{ .Values.conf.manila.DEFAULT.log_config_append }} @@ -116,6 +120,14 @@ spec: secret: secretName: manila-etc defaultMode: 0444 + - name: manila-etc-snippets +{{- if $etcSources }} + projected: + sources: +{{ toYaml $etcSources | indent 14 }} +{{- else }} + emptyDir: {} +{{ end }} - name: manila-bin configMap: name: manila-bin diff --git a/manila/templates/deployment-share.yaml b/manila/templates/deployment-share.yaml index e0fb223463..6ee91e738b 100644 --- a/manila/templates/deployment-share.yaml +++ b/manila/templates/deployment-share.yaml @@ -17,6 +17,7 @@ limitations under the License. {{- $mounts_manila_share := .Values.pod.mounts.manila_share.manila_share }} {{- $mounts_manila_share_init := .Values.pod.mounts.manila_share.init_container }} +{{- $etcSources := .Values.pod.etcSources.manila_share }} {{- $serviceAccountName := "manila-share" }} {{ tuple $envAll "share" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} @@ -130,6 +131,9 @@ spec: mountPath: /etc/manila/manila.conf subPath: manila.conf readOnly: true + - name: manila-etc-snippets + mountPath: /etc/manila/manila.conf.d/ + readOnly: true - name: manila-etc mountPath: /etc/manila/rootwrap.conf subPath: rootwrap.conf @@ -204,6 +208,14 @@ spec: secret: secretName: manila-etc defaultMode: 0444 + - name: manila-etc-snippets +{{- if $etcSources }} + projected: + sources: +{{ toYaml $etcSources | indent 14 }} +{{- else }} + emptyDir: {} +{{ end }} - name: manila-bin configMap: name: manila-bin diff --git a/manila/values.yaml b/manila/values.yaml index 1b73112f30..8f21bf76da 100644 --- a/manila/values.yaml +++ b/manila/values.yaml @@ -146,6 +146,15 @@ pod: manila_db_sync: volumeMounts: volumes: + # -- This allows users to add Kubernetes Projected Volumes to be mounted at /etc/manila/manila.conf.d/ + ## This is a list of projected volume source objects for each deployment/statefulset/daemonset/cronjob + ## https://kubernetes.io/docs/concepts/storage/projected-volumes/ + etcSources: + manila_api: [] + manila_scheduler: [] + manila_data: [] + manila_share: [] + manila_db_sync: [] replicas: api: 1 data: 1 diff --git a/releasenotes/notes/manila-a5beeacdb577dd23.yaml b/releasenotes/notes/manila-a5beeacdb577dd23.yaml new file mode 100644 index 0000000000..52442ef846 --- /dev/null +++ b/releasenotes/notes/manila-a5beeacdb577dd23.yaml @@ -0,0 +1,7 @@ +--- +manila: + - | + Allow users to add additional sources to the Projected Volume that is mounted + at /etc/manila/manila.conf.d/ so they may more easily override configs or provide + additional configs for the various services in the chart. +...