diff --git a/octavia/templates/bin/_octavia-driver-agent.sh.tpl b/octavia/templates/bin/_octavia-driver-agent.sh.tpl index 056d34f07e..afc621e65a 100644 --- a/octavia/templates/bin/_octavia-driver-agent.sh.tpl +++ b/octavia/templates/bin/_octavia-driver-agent.sh.tpl @@ -21,7 +21,8 @@ COMMAND="${@:-start}" function start () { exec octavia-driver-agent \ - --config-file /etc/octavia/octavia.conf + --config-file /etc/octavia/octavia.conf \ + --config-dir /etc/octavia/octavia.conf.d } function stop () { diff --git a/octavia/templates/bin/_octavia-health-manager.sh.tpl b/octavia/templates/bin/_octavia-health-manager.sh.tpl index 3a42066871..93cdedf83b 100644 --- a/octavia/templates/bin/_octavia-health-manager.sh.tpl +++ b/octavia/templates/bin/_octavia-health-manager.sh.tpl @@ -28,7 +28,8 @@ EOF dhclient -v o-hm0 -cf /tmp/dhclient.conf exec octavia-health-manager \ - --config-file /etc/octavia/octavia.conf + --config-file /etc/octavia/octavia.conf \ + --config-dir /etc/octavia/octavia.conf.d } function stop () { diff --git a/octavia/templates/bin/_octavia-housekeeping.sh.tpl b/octavia/templates/bin/_octavia-housekeeping.sh.tpl index a4cd2f060f..bec94b382f 100644 --- a/octavia/templates/bin/_octavia-housekeeping.sh.tpl +++ b/octavia/templates/bin/_octavia-housekeeping.sh.tpl @@ -21,7 +21,8 @@ COMMAND="${@:-start}" function start () { exec octavia-housekeeping \ - --config-file /etc/octavia/octavia.conf + --config-file /etc/octavia/octavia.conf \ + --config-dir /etc/octavia/octavia.conf.d } function stop () { diff --git a/octavia/templates/bin/_octavia-worker.sh.tpl b/octavia/templates/bin/_octavia-worker.sh.tpl index db5a2a5f4c..21d9e5d0f0 100644 --- a/octavia/templates/bin/_octavia-worker.sh.tpl +++ b/octavia/templates/bin/_octavia-worker.sh.tpl @@ -28,7 +28,8 @@ EOF dhclient -v o-w0 -cf /tmp/dhclient.conf exec octavia-worker \ - --config-file /etc/octavia/octavia.conf + --config-file /etc/octavia/octavia.conf \ + --config-dir /etc/octavia/octavia.conf.d } function stop () { diff --git a/octavia/templates/daemonset-health-manager.yaml b/octavia/templates/daemonset-health-manager.yaml index 06afc18e74..939ef04dae 100644 --- a/octavia/templates/daemonset-health-manager.yaml +++ b/octavia/templates/daemonset-health-manager.yaml @@ -24,6 +24,7 @@ limitations under the License. {{- $mounts_octavia_health_manager := .Values.pod.mounts.octavia_health_manager.octavia_health_manager }} {{- $mounts_octavia_health_manager_init := .Values.pod.mounts.octavia_health_manager.init_container }} +{{- $etcSources := .Values.pod.etcSources.octavia_health_manager }} --- apiVersion: apps/v1 kind: DaemonSet @@ -113,6 +114,9 @@ spec: mountPath: /etc/octavia/octavia.conf subPath: octavia.conf readOnly: true + - name: octavia-etc-snippets + mountPath: /etc/octavia/octavia.conf.d/ + readOnly: true {{- if .Values.conf.octavia.DEFAULT.log_config_append }} - name: octavia-etc mountPath: {{ .Values.conf.octavia.DEFAULT.log_config_append }} @@ -131,6 +135,14 @@ spec: secret: secretName: {{ $configMapName }} defaultMode: 0444 + - name: octavia-etc-snippets +{{- if $etcSources }} + projected: + sources: +{{ toYaml $etcSources | indent 14 }} +{{- else }} + emptyDir: {} +{{ end }} - name: pod-shared emptyDir: {} - name: run diff --git a/octavia/templates/daemonset-worker.yaml b/octavia/templates/daemonset-worker.yaml index 4455f84b94..9436044c02 100644 --- a/octavia/templates/daemonset-worker.yaml +++ b/octavia/templates/daemonset-worker.yaml @@ -24,6 +24,7 @@ limitations under the License. {{- $mounts_octavia_worker := .Values.pod.mounts.octavia_worker.octavia_worker }} {{- $mounts_octavia_worker_init := .Values.pod.mounts.octavia_worker.init_container }} +{{- $etcSources := .Values.pod.etcSources.octavia_worker }} --- apiVersion: apps/v1 kind: DaemonSet @@ -113,6 +114,9 @@ spec: mountPath: /etc/octavia/octavia.conf subPath: octavia.conf readOnly: true + - name: octavia-etc-snippets + mountPath: /etc/octavia/octavia.conf.d/ + readOnly: true {{- if .Values.conf.octavia.DEFAULT.log_config_append }} - name: octavia-etc mountPath: {{ .Values.conf.octavia.DEFAULT.log_config_append }} @@ -131,6 +135,14 @@ spec: secret: secretName: {{ $configMapName }} defaultMode: 0444 + - name: octavia-etc-snippets +{{- if $etcSources }} + projected: + sources: +{{ toYaml $etcSources | indent 14 }} +{{- else }} + emptyDir: {} +{{ end }} - name: pod-shared emptyDir: {} - name: run diff --git a/octavia/templates/deployment-api.yaml b/octavia/templates/deployment-api.yaml index 62bad25809..e4b4285e42 100644 --- a/octavia/templates/deployment-api.yaml +++ b/octavia/templates/deployment-api.yaml @@ -37,6 +37,8 @@ httpGet: {{- $serviceAccountName := "octavia-api" }} {{ tuple $envAll "api" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} + +{{- $etcSources := .Values.pod.etcSources.octavia_api }} --- apiVersion: apps/v1 kind: Deployment @@ -101,6 +103,9 @@ spec: mountPath: /etc/octavia/octavia.conf subPath: octavia.conf readOnly: true + - name: octavia-etc-snippets + mountPath: /etc/octavia/octavia.conf.d/ + readOnly: true - name: octavia-etc mountPath: /etc/octavia/octavia-api-uwsgi.ini subPath: octavia-api-uwsgi.ini @@ -127,5 +132,13 @@ spec: secret: secretName: octavia-etc defaultMode: 0444 + - name: octavia-etc-snippets +{{- if $etcSources }} + projected: + sources: +{{ toYaml $etcSources | indent 14 }} +{{- else }} + emptyDir: {} +{{ end }} {{ if $mounts_octavia_api.volumes }}{{ toYaml $mounts_octavia_api.volumes | indent 8 }}{{ end }} {{- end }} diff --git a/octavia/templates/deployment-driver-agent.yaml b/octavia/templates/deployment-driver-agent.yaml index 79880d6f3a..3ee09741c4 100644 --- a/octavia/templates/deployment-driver-agent.yaml +++ b/octavia/templates/deployment-driver-agent.yaml @@ -27,6 +27,8 @@ limitations under the License. {{- $serviceAccountName := "octavia-driver-agent" }} {{ tuple $envAll "driver_agent" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} + +{{- $etcSources := .Values.pod.etcSources.octavia_driver_agent }} --- apiVersion: apps/v1 kind: Deployment @@ -85,6 +87,9 @@ spec: mountPath: /etc/octavia/octavia.conf subPath: octavia.conf readOnly: true + - name: octavia-etc-snippets + mountPath: /etc/octavia/octavia.conf.d/ + readOnly: true {{- if .Values.conf.octavia.DEFAULT.log_config_append }} - name: octavia-etc mountPath: {{ .Values.conf.octavia.DEFAULT.log_config_append }} @@ -113,5 +118,13 @@ spec: secret: secretName: octavia-etc defaultMode: 0444 + - name: octavia-etc-snippets +{{- if $etcSources }} + projected: + sources: +{{ toYaml $etcSources | indent 14 }} +{{- else }} + emptyDir: {} +{{ end }} {{ if $mounts_octavia_driver_agent.volumes }}{{ toYaml $mounts_octavia_driver_agent.volumes | indent 8 }}{{ end }} {{- end }} diff --git a/octavia/templates/deployment-housekeeping.yaml b/octavia/templates/deployment-housekeeping.yaml index d514232e7a..6a3acfc930 100644 --- a/octavia/templates/deployment-housekeeping.yaml +++ b/octavia/templates/deployment-housekeeping.yaml @@ -22,6 +22,8 @@ limitations under the License. {{- $serviceAccountName := "octavia-housekeeping" }} {{ tuple $envAll "housekeeping" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} + +{{- $etcSources := .Values.pod.etcSources.octavia_housekeeping }} --- apiVersion: apps/v1 kind: Deployment @@ -82,6 +84,9 @@ spec: mountPath: /etc/octavia/octavia.conf subPath: octavia.conf readOnly: true + - name: octavia-etc-snippets + mountPath: /etc/octavia/octavia.conf.d/ + readOnly: true {{- if .Values.conf.octavia.DEFAULT.log_config_append }} - name: octavia-etc mountPath: {{ .Values.conf.octavia.DEFAULT.log_config_append }} @@ -100,5 +105,13 @@ spec: secret: secretName: octavia-etc defaultMode: 0444 + - name: octavia-etc-snippets +{{- if $etcSources }} + projected: + sources: +{{ toYaml $etcSources | indent 14 }} +{{- else }} + emptyDir: {} +{{ end }} {{ if $mounts_octavia_housekeeping.volumes }}{{ toYaml $mounts_octavia_housekeeping.volumes | indent 8 }}{{ end }} {{- end }} diff --git a/octavia/values.yaml b/octavia/values.yaml index aa11399419..2f17088c93 100644 --- a/octavia/values.yaml +++ b/octavia/values.yaml @@ -702,6 +702,15 @@ pod: octavia_bootstrap: volumeMounts: volumes: + # -- This allows users to add Kubernetes Projected Volumes to be mounted at /etc/octavia/octavia.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: + octavia_api: [] + octavia_driver_agent: [] + octavia_worker: [] + octavia_housekeeping: [] + octavia_health_manager: [] replicas: api: 1 driver_agent: 1 diff --git a/releasenotes/notes/octavia-3c13346818a743cc.yaml b/releasenotes/notes/octavia-3c13346818a743cc.yaml new file mode 100644 index 0000000000..6921501ff1 --- /dev/null +++ b/releasenotes/notes/octavia-3c13346818a743cc.yaml @@ -0,0 +1,7 @@ +--- +octavia: + - | + Allow users to add additional sources to the Projected Volume that is mounted + at /etc/octavia/octavia.conf.d/ so they may more easily override configs or provide + additional configs for the various services in the chart. +...