feat(octavia): allow users to provide configs in octavia.conf.d

Allow users to provide additional projected volumes to be mounted into
the various deployments, statefulsets, and jobs that the octavia chart has
in the /etc/octavia/octavia.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: I7f7ac87f437c93e047b9a90f8774bbb9e50c1f9f
Signed-off-by: Mathieu Gagné <mgagne@calavera.ca>
This commit is contained in:
Mathieu Gagné
2026-02-19 13:34:26 -05:00
parent de768d35e6
commit e9048f4d60
11 changed files with 87 additions and 4 deletions

View File

@@ -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 () {

View File

@@ -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 () {

View File

@@ -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 () {

View File

@@ -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 () {

View File

@@ -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

View File

@@ -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

View File

@@ -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 }}

View File

@@ -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 }}

View File

@@ -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 }}

View File

@@ -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

View File

@@ -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.
...