Change service configuration¶
Status: validated on the lab (OKD 4.22.0-okd-scos.10, operators 18-stable) on 2026-11-11
In Kolla-Ansible you drop an override in /etc/kolla/config/<service>/ and
run kolla-ansible reconfigure. Here the override lives in the
OpenStackControlPlane resource (customServiceConfig) and there is no
"reconfigure" command: saving the resource is the trigger. The example
enables debug logging in Keystone.
In short¶
- Put the option in
customServiceConfigof the service, in theOpenStackControlPlaneresource. Saving the resource is the trigger. - The operator re-renders the configuration, its hash changes, and the pods roll by themselves: about 35 seconds for Keystone on the lab.
- The content is not validated. A wrong section is silently ignored; an unparsable value keeps the new pod from starting.
--type=mergereplaces the wholecustomServiceConfigstring: include what is already there (Glance, Neutron).- Put lasting changes in the repository template too, or the next run of the deployment script removes them.
1. Initial symptoms¶
- You need to set or change an option in a service configuration file.
- You changed a ConfigMap or Secret by hand and the change vanished.
2. Read-only investigation¶
Where is the configuration today?
[READ-ONLY]
# What you declared (empty if never set):
oc get oscp openstack -o jsonpath='{.spec.keystone.template.customServiceConfig}{"\n"}'
# What the operator generated from it (a Secret, because it holds passwords):
oc get secret keystone-config-data -o json | jq -r '.data | keys[]'
oc get secret keystone-config-data -o jsonpath='{.data.custom\.conf}' | base64 -d
# What the running process actually reads:
oc exec deployment/keystone -- ls /etc/keystone/keystone.conf.d/
oc exec deployment/keystone -- cat /etc/keystone/keystone.conf.d/custom.conf
# The fingerprint of the current configuration, as seen by the pod:
oc get deployment keystone -o json | jq -r '.spec.template.spec.containers[0].env[] | select(.name == "CONFIG_HASH")'
oc get pods -l service=keystone
Note the pod name and the CONFIG_HASH value: both must change.
3. Expected observations¶
-
customServiceConfigis empty for Keystone in the lab manifest. Glance and Neutron have one; look at them for a real example:[READ-ONLY]
oc get oscp openstack -o jsonpath='{.spec.neutron.template.customServiceConfig}'[DEFAULT] global_physnet_mtu = 1442 [ml2] path_mtu = 1442 -
The Secret
keystone-config-dataholds the keyskeystone.conf,custom.conf,httpd.conf,ssl.conf,my.cnf,keystone-api-config.jsonandTemplateParameters. Itscustom.confis empty. /etc/keystone/keystone.conf.d/contains a single file,custom.conf. The main file is/etc/keystone/keystone.conf; files of the.ddirectory are read after it, socustom.confwins over generated values.- The
CONFIG_HASHenvironment variable is a hash of all configuration inputs.
4. Root cause¶
From your edit to the restarted pod; nothing below the first box is started by hand.
flowchart TD
A["You: oc patch OpenStackControlPlane openstack<br/>(spec.keystone.template.customServiceConfig)"]
B["openstack operator copies the Keystone section<br/>into KeystoneAPI keystone"]
C["keystone operator re-renders<br/>the Secret keystone-config-data"]
D["New hash of the inputs,<br/>written as CONFIG_HASH in the pod template"]
E["Deployment rolls: a new pod starts,<br/>the old one is removed once the new one is ready"]
F["KeystoneAPI and the control plane<br/>report True again"]
G["Nothing restarts"]
A --> B --> C --> D --> E --> F
C -- "rendered configuration identical" --> G
The mechanism, step by step:
- You change
spec.keystone.template.customServiceConfigonOpenStackControlPlane/openstack. - The openstack operator copies the Keystone section into
KeystoneAPI/keystone. - The keystone operator re-renders the Secret
keystone-config-dataand recomputes the hash of its inputs. - The new hash is written into the pod template as
CONFIG_HASH. A pod template change is what makes a Deployment roll: a new pod starts, and the old one is removed once the new one is ready.
So the rollout is a side effect of the hash, and the hash is a side effect of your edit. Nothing restarts if the rendered configuration is identical.
The operator does not validate the content: it is pasted into the file as is. An option in the wrong section is silently ignored by the service; a value the service cannot parse makes the new pod crash (see CrashLoopBackOff).
Why hand edits do not stick: the Secret and the KeystoneAPI resource are
outputs. The operator rewrites them from the level above on every
reconciliation (see
manual changes reverted).
For Nova the generated override file is named 02-nova-override.conf
instead of custom.conf (mounted as
/etc/nova/nova.conf.d/02-nova-override.conf); the key only exists in the
Secret nova-api-config-data while a customServiceConfig is set. The
mechanism is identical.
Measured on the lab with the Keystone example below: KeystoneAPI/keystone
and the control plane resource report False, "Deployment in progress", for
about 35 seconds, then True. Reverting gives back the original
CONFIG_HASH value, and the Deployment reuses its original ReplicaSet: the
same input always renders the same hash.
5. Resolution¶
Save the current state first, so that you can go back:
[READ-ONLY]
oc get oscp openstack -o yaml > /tmp/oscp-before.yaml
Apply the change. oc patch is repeatable and reviewable; oc edit
openstackcontrolplane openstack does the same interactively.
[CHANGE] Rolls the Keystone pod: brief interruption of authentication with one replica.
oc patch openstackcontrolplane openstack --type=merge -p '
spec:
keystone:
template:
customServiceConfig: |
[DEFAULT]
debug = true
'
Watch it propagate:
[READ-ONLY]
oc get keystoneapi keystone -w # False (in progress) then True
oc rollout status deployment/keystone
oc get pods -l service=keystone
To keep the change across a rebuild of the lab, also put it in
deployment/openstack/controlplane/openstackcontrolplane.yaml.tmpl.
Otherwise the next run of scripts/bastion/06-openstack-controlplane.sh
re-applies the file and removes your option.
Revert¶
[CHANGE]
oc patch openstackcontrolplane openstack --type=merge -p '{"spec":{"keystone":{"template":{"customServiceConfig":""}}}}'
6. Verification¶
[READ-ONLY]
# New pod, new hash:
oc get pods -l service=keystone
oc get deployment keystone -o json | jq -r '.spec.template.spec.containers[0].env[] | select(.name == "CONFIG_HASH")'
# The file inside the running pod:
oc exec deployment/keystone -- cat /etc/keystone/keystone.conf.d/custom.conf
# The effect:
oc rsh openstackclient openstack token issue
oc logs deployment/keystone --since=2m | grep -c DEBUG # 0 before; more than 1000 after two minutes
# Control plane back to Ready:
oc get openstackcontrolplane openstack
7. Risks and precautions¶
- Every configuration change restarts the service. With one replica that is a short outage; plan it like a restart.
- A wrong value can stop the new pod from starting. For a Deployment the old
pod keeps serving until the new one is ready, so a bad change to Keystone,
Neutron or Placement usually degrades nothing but never completes. For a
StatefulSet with one replica (every Nova service, Glance) the old pod is
stopped first: a bad change is an outage until you revert. Observed on the
lab with an unparsable boolean in the Nova API configuration: the new pod
stayed
0/2 Running, the API answered 503, and the revert brought it back in about 25 seconds. - Change one service at a time and wait for
Truebefore the next. --type=mergereplaces the wholecustomServiceConfigstring. Include the existing content when a service already has one (Glance, Neutron).- Do not put passwords in
customServiceConfig: the resource is readable by anyone who can read the namespace. On this version Glance and the Cinder back-end services acceptcustomServiceConfigSecrets(a list of Secret names whose content is added to the configuration); Keystone, Neutron, Placement and the Nova services do not have that field (oc explain openstackcontrolplane.spec.glance.templateshows what a service accepts). - Some services already log at debug level by default (Nova does), so
debug = truechanges nothing visible there. Keystone is the example because the difference is obvious. - Changes for
nova-computeon compute nodes do not go through this path: see data plane changes.
Previous: Restart a service · Up: Operations guide · Next: Enable a service