From 96bed85c32c9ff1f79c57c8685c90778c8b5f8ab Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Mon, 15 Sep 2025 16:32:40 -0500 Subject: [PATCH] nova: ensure /etc/nova/nova.conf.d is always loaded Moving forward to better support partial configs that override the base config, ensure that the /etc/nova/nova.conf.d directory is loaded after the main configuration files. Change-Id: Ic735cf39d53d55a2975a5a2975686c7f9f560c22 Signed-off-by: Doug Goldstein --- nova/templates/bin/_health-probe.py.tpl | 6 ++++-- nova/templates/bin/_nova-compute-ironic.sh.tpl | 3 ++- nova/templates/bin/_nova-compute.sh.tpl | 3 ++- nova/templates/bin/_nova-conductor.sh.tpl | 3 ++- nova/templates/bin/_nova-console-proxy.sh.tpl | 11 +++++++---- nova/templates/bin/_nova-scheduler.sh.tpl | 3 ++- nova/templates/daemonset-compute.yaml | 6 ++++++ nova/templates/deployment-conductor.yaml | 4 ++++ nova/templates/deployment-scheduler.yaml | 4 ++++ releasenotes/notes/nova-7f3dbce1333752b8.yaml | 5 +++++ 10 files changed, 38 insertions(+), 10 deletions(-) create mode 100644 releasenotes/notes/nova-7f3dbce1333752b8.yaml diff --git a/nova/templates/bin/_health-probe.py.tpl b/nova/templates/bin/_health-probe.py.tpl index 04e95d01a5..384f99c5c3 100644 --- a/nova/templates/bin/_health-probe.py.tpl +++ b/nova/templates/bin/_health-probe.py.tpl @@ -26,7 +26,9 @@ Script returns failure to Kubernetes only when sys.stderr.write() writes to pod's events on failures. Usage example for Nova Compute: -# python health-probe.py --config-file /etc/nova/nova.conf \ +# python health-probe.py \ +# --config-file /etc/nova/nova.conf \ +# --config-dir /etc/nova/nova.conf.d \ # --service-queue-name compute """ @@ -204,7 +206,7 @@ def test_rpc_liveness(): cfg.CONF.register_cli_opt(cfg.BoolOpt('use-fqdn', default=False, required=False)) - cfg.CONF(sys.argv[1:]) + cfg.CONF(sys.argv[1:], project='nova') log.logging.basicConfig(level=log.{{ .Values.health_probe.logging.level }}) diff --git a/nova/templates/bin/_nova-compute-ironic.sh.tpl b/nova/templates/bin/_nova-compute-ironic.sh.tpl index 0535723b33..6de3019894 100644 --- a/nova/templates/bin/_nova-compute-ironic.sh.tpl +++ b/nova/templates/bin/_nova-compute-ironic.sh.tpl @@ -18,4 +18,5 @@ set -ex exec nova-compute \ --config-file /etc/nova/nova-compute.conf \ - --config-file /etc/nova/nova-ironic.conf + --config-file /etc/nova/nova-ironic.conf \ + --config-dir /etc/nova/nova.conf.d diff --git a/nova/templates/bin/_nova-compute.sh.tpl b/nova/templates/bin/_nova-compute.sh.tpl index 702e3b9211..a1a91015e3 100644 --- a/nova/templates/bin/_nova-compute.sh.tpl +++ b/nova/templates/bin/_nova-compute.sh.tpl @@ -28,5 +28,6 @@ exec nova-compute \ --config-file /tmp/pod-shared/nova-compute-fqdn.conf \ {{- end }} {{- if .Values.conf.hypervisor.address_search_enabled }} - --config-file /tmp/pod-shared/nova-hypervisor.conf + --config-file /tmp/pod-shared/nova-hypervisor.conf \ {{- end }} + --config-dir /etc/nova/nova.conf.d diff --git a/nova/templates/bin/_nova-conductor.sh.tpl b/nova/templates/bin/_nova-conductor.sh.tpl index 0f7d5b1f33..bb04f2b495 100644 --- a/nova/templates/bin/_nova-conductor.sh.tpl +++ b/nova/templates/bin/_nova-conductor.sh.tpl @@ -16,4 +16,5 @@ limitations under the License. set -x exec nova-conductor \ - --config-file /etc/nova/nova.conf + --config-file /etc/nova/nova.conf \ + --config-dir /etc/nova/nova.conf.d diff --git a/nova/templates/bin/_nova-console-proxy.sh.tpl b/nova/templates/bin/_nova-console-proxy.sh.tpl index d9f1472150..19bee60655 100644 --- a/nova/templates/bin/_nova-console-proxy.sh.tpl +++ b/nova/templates/bin/_nova-console-proxy.sh.tpl @@ -20,13 +20,16 @@ console_kind="{{- .Values.console.console_kind -}}" if [ "${console_kind}" == "novnc" ] ; then exec nova-novncproxy \ --config-file /etc/nova/nova.conf \ - --config-file /tmp/pod-shared/nova-vnc.ini + --config-file /tmp/pod-shared/nova-vnc.ini \ + --config-dir /etc/nova/nova.conf.d elif [ "${console_kind}" == "spice" ] ; then exec nova-spicehtml5proxy\ --config-file /etc/nova/nova.conf \ - --config-file /tmp/pod-shared/nova-spice.ini + --config-file /tmp/pod-shared/nova-spice.ini \ + --config-dir /etc/nova/nova.conf.d elif [ "${console_kind}" == "serial" ] ; then exec nova-serialproxy\ --config-file /etc/nova/nova.conf \ - --config-file /tmp/pod-shared/nova-serial.ini -fi \ No newline at end of file + --config-file /tmp/pod-shared/nova-serial.ini \ + --config-dir /etc/nova/nova.conf.d +fi diff --git a/nova/templates/bin/_nova-scheduler.sh.tpl b/nova/templates/bin/_nova-scheduler.sh.tpl index dc000372da..2bf76dd604 100644 --- a/nova/templates/bin/_nova-scheduler.sh.tpl +++ b/nova/templates/bin/_nova-scheduler.sh.tpl @@ -17,4 +17,5 @@ limitations under the License. set -xe exec nova-scheduler \ - --config-file /etc/nova/nova.conf + --config-file /etc/nova/nova.conf \ + --config-dir /etc/nova/nova.conf.d diff --git a/nova/templates/daemonset-compute.yaml b/nova/templates/daemonset-compute.yaml index 464c16ec15..5d266d07a3 100644 --- a/nova/templates/daemonset-compute.yaml +++ b/nova/templates/daemonset-compute.yaml @@ -19,6 +19,8 @@ exec: - /tmp/health-probe.py - --config-file - /etc/nova/nova.conf + - --config-dir + - /etc/nova/nova.conf.d - --service-queue-name - compute - --liveness-probe @@ -34,6 +36,8 @@ exec: - /tmp/health-probe.py - --config-file - /etc/nova/nova.conf + - --config-dir + - /etc/nova/nova.conf.d - --service-queue-name - compute {{- if .Values.pod.use_fqdn.compute }} @@ -48,6 +52,8 @@ exec: - /tmp/health-probe.py - --config-file - /etc/nova/nova.conf + - --config-dir + - /etc/nova/nova.conf.d - --service-queue-name - compute - --liveness-probe diff --git a/nova/templates/deployment-conductor.yaml b/nova/templates/deployment-conductor.yaml index 9a4570974b..5ce7d8e1e7 100644 --- a/nova/templates/deployment-conductor.yaml +++ b/nova/templates/deployment-conductor.yaml @@ -19,6 +19,8 @@ exec: - /tmp/health-probe.py - --config-file - /etc/nova/nova.conf + - --config-dir + - /etc/nova/nova.conf.d - --service-queue-name - conductor - --liveness-probe @@ -31,6 +33,8 @@ exec: - /tmp/health-probe.py - --config-file - /etc/nova/nova.conf + - --config-dir + - /etc/nova/nova.conf.d - --service-queue-name - conductor {{- end }} diff --git a/nova/templates/deployment-scheduler.yaml b/nova/templates/deployment-scheduler.yaml index 2e6c7e6fb3..ea60b75c62 100644 --- a/nova/templates/deployment-scheduler.yaml +++ b/nova/templates/deployment-scheduler.yaml @@ -19,6 +19,8 @@ exec: - /tmp/health-probe.py - --config-file - /etc/nova/nova.conf + - --config-dir + - /etc/nova/nova.conf.d - --service-queue-name - scheduler - --liveness-probe @@ -31,6 +33,8 @@ exec: - /tmp/health-probe.py - --config-file - /etc/nova/nova.conf + - --config-dir + - /etc/nova/nova.conf.d - --service-queue-name - scheduler {{- end }} diff --git a/releasenotes/notes/nova-7f3dbce1333752b8.yaml b/releasenotes/notes/nova-7f3dbce1333752b8.yaml new file mode 100644 index 0000000000..4f5f23069f --- /dev/null +++ b/releasenotes/notes/nova-7f3dbce1333752b8.yaml @@ -0,0 +1,5 @@ +--- +nova: + - | + Ensure that the nova chart always loads config overrides from /etc/nova/nova.conf.d +...