diff --git a/ironic/templates/bin/_ironic-api.sh.tpl b/ironic/templates/bin/_ironic-api.sh.tpl index 04ad463844..ebec607b9a 100644 --- a/ironic/templates/bin/_ironic-api.sh.tpl +++ b/ironic/templates/bin/_ironic-api.sh.tpl @@ -23,7 +23,8 @@ OPTIONS=" --config-file /tmp/pod-shared/swift.conf" function start () { exec ironic-api \ --config-file /etc/ironic/ironic.conf \ - ${OPTIONS} + ${OPTIONS} \ + --config-dir /etc/ironic/ironic.conf.d } function stop () { diff --git a/ironic/templates/bin/_ironic-conductor.sh.tpl b/ironic/templates/bin/_ironic-conductor.sh.tpl index 29bc5b3f0d..09d81271ef 100644 --- a/ironic/templates/bin/_ironic-conductor.sh.tpl +++ b/ironic/templates/bin/_ironic-conductor.sh.tpl @@ -26,4 +26,5 @@ OPTIONS=" --config-file /tmp/pod-shared/swift.conf" exec ironic-conductor \ --config-file /etc/ironic/ironic.conf \ --config-file /tmp/pod-shared/conductor-local-ip.conf \ - ${OPTIONS} + ${OPTIONS} \ + --config-dir /etc/ironic/ironic.conf.d diff --git a/ironic/templates/deployment-api.yaml b/ironic/templates/deployment-api.yaml index c0fde9da1e..433ab826b2 100644 --- a/ironic/templates/deployment-api.yaml +++ b/ironic/templates/deployment-api.yaml @@ -17,6 +17,7 @@ limitations under the License. {{- $mounts_ironic_api := .Values.pod.mounts.ironic_api.ironic_api }} {{- $mounts_ironic_api_init := .Values.pod.mounts.ironic_api.init_container }} +{{- $etcSources := .Values.pod.etcSources.ironic_api }} {{- $serviceAccountName := "ironic-api" }} {{ tuple $envAll "api" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} @@ -113,6 +114,9 @@ spec: mountPath: /etc/ironic/ironic.conf subPath: ironic.conf readOnly: true + - name: ironic-etc-snippets + mountPath: /etc/ironic/ironic.conf.d/ + readOnly: true {{- if .Values.conf.ironic.DEFAULT.log_config_append }} - name: ironic-etc mountPath: {{ .Values.conf.ironic.DEFAULT.log_config_append }} @@ -139,6 +143,14 @@ spec: secret: secretName: ironic-etc defaultMode: 0444 + - name: ironic-etc-snippets +{{- if $etcSources }} + projected: + sources: +{{ toYaml $etcSources | indent 14 }} +{{- else }} + emptyDir: {} +{{ end }} - name: pod-shared emptyDir: {} {{ if $mounts_ironic_api.volumes }}{{ toYaml $mounts_ironic_api.volumes | indent 8 }}{{ end }} diff --git a/ironic/templates/statefulset-conductor.yaml b/ironic/templates/statefulset-conductor.yaml index fcb65c1488..84aef76f0e 100644 --- a/ironic/templates/statefulset-conductor.yaml +++ b/ironic/templates/statefulset-conductor.yaml @@ -17,6 +17,7 @@ limitations under the License. {{- $mounts_ironic_conductor := .Values.pod.mounts.ironic_conductor.ironic_conductor }} {{- $mounts_ironic_conductor_init := .Values.pod.mounts.ironic_conductor.init_container }} +{{- $etcSources := .Values.pod.etcSources.ironic_conductor }} {{- $serviceAccountName := "ironic-conductor" }} {{ tuple $envAll "conductor" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} @@ -171,6 +172,9 @@ spec: mountPath: /etc/ironic/ironic.conf subPath: ironic.conf readOnly: true + - name: ironic-etc-snippets + mountPath: /etc/ironic/ironic.conf.d/ + readOnly: true {{- if .Values.conf.ironic.DEFAULT.log_config_append }} - name: ironic-etc mountPath: {{ .Values.conf.ironic.DEFAULT.log_config_append }} @@ -251,6 +255,14 @@ spec: secret: secretName: ironic-etc defaultMode: 0444 + - name: ironic-etc-snippets +{{- if $etcSources }} + projected: + sources: +{{ toYaml $etcSources | indent 14 }} +{{- else }} + emptyDir: {} +{{ end }} - name: host-var-lib-ironic hostPath: path: /var/lib/ironic diff --git a/ironic/values.yaml b/ironic/values.yaml index efc17b05aa..3d71059564 100644 --- a/ironic/values.yaml +++ b/ironic/values.yaml @@ -727,6 +727,13 @@ pod: ironic_db_sync: volumeMounts: volumes: + # -- This allows users to add Kubernetes Projected Volumes to be mounted at /etc/ironic/ironic.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: + ironic_api: [] + ironic_conductor: [] + ironic_db_sync: [] replicas: api: 1 conductor: 1 diff --git a/releasenotes/notes/ironic-c0de8abe9970dca0.yaml b/releasenotes/notes/ironic-c0de8abe9970dca0.yaml new file mode 100644 index 0000000000..adecde4996 --- /dev/null +++ b/releasenotes/notes/ironic-c0de8abe9970dca0.yaml @@ -0,0 +1,7 @@ +--- +ironic: + - | + Allow users to add additional sources to the Projected Volume that is mounted + at /etc/ironic/ironic.conf.d/ so they may more easily override configs or provide + additional configs for the various services in the chart. +...