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 3ec37b3d3f..3d52dc610f 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 08086689c1..68db017886 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. +...