manifest: merge rook-config-override ConfigMap into ceph.conf

The toolbox was not respecting the rook-config-override ConfigMap,
resulting in a minimal ceph.conf with only mon_host and keyring settings.
This made it difficult to run diagnostic commands that require custom
configuration parameters.

This change mounts the rook-config-override ConfigMap in all toolbox
variants and merges its contents into the generated ceph.conf. The
merge happens after writing the base config with mon endpoints, and
is re-applied whenever mon endpoints change.

The toolbox now has consistent behavior with other Rook-managed Ceph
daemons (mon, mgr, osd, mds, rgw) which already respect config overrides.

Signed-off-by: Matthew N. Heler <matthew.heler@hotmail.com>
This commit is contained in:
Matthew N. Heler
2025-11-18 13:43:14 -06:00
parent de8c2d2033
commit 9570d141de
4 changed files with 45 additions and 0 deletions
+7
View File
@@ -27,6 +27,9 @@ spec:
mountPath: /etc/rook
- name: ceph-admin-secret
mountPath: /var/lib/rook-ceph-mon
- name: rook-config-override
mountPath: /etc/rook-config-override
readOnly: true
containers:
- name: script
image: docker.io/rook/ceph:master
@@ -57,6 +60,10 @@ spec:
items:
- key: data
path: mon-endpoints
- name: rook-config-override
configMap:
name: rook-config-override
optional: true
- name: ceph-config
emptyDir: {}
restartPolicy: Never
@@ -35,6 +35,7 @@ spec:
CEPH_CONFIG="/etc/ceph/ceph.conf"
MON_CONFIG="/etc/rook/mon-endpoints"
KEYRING_FILE="/etc/ceph/keyring"
CONFIG_OVERRIDE="/etc/rook-config-override/config"
# create a ceph config file in its default location so ceph/rados tools can be used
# without specifying any arguments
@@ -55,6 +56,13 @@ spec:
[client.admin]
keyring = ${KEYRING_FILE}
EOF
# Merge the config override if it exists and is not empty
if [ -f "${CONFIG_OVERRIDE}" ] && [ -s "${CONFIG_OVERRIDE}" ]; then
echo "$DATE merging config override from ${CONFIG_OVERRIDE}"
echo "" >> ${CEPH_CONFIG}
cat ${CONFIG_OVERRIDE} >> ${CEPH_CONFIG}
fi
}
# watch the endpoints config file and update if the mon endpoints ever change
@@ -114,6 +122,9 @@ spec:
- name: ceph-admin-secret
mountPath: /var/lib/rook-ceph-mon
readOnly: true
- name: rook-config-override
mountPath: /etc/rook-config-override
readOnly: true
volumes:
- name: ceph-admin-secret
secret:
@@ -128,6 +139,10 @@ spec:
items:
- key: data
path: mon-endpoints
- name: rook-config-override
configMap:
name: rook-config-override
optional: true
- name: ceph-config
emptyDir: {}
tolerations:
+15
View File
@@ -29,6 +29,7 @@ spec:
CEPH_CONFIG="/etc/ceph/ceph.conf"
MON_CONFIG="/etc/rook/mon-endpoints"
KEYRING_FILE="/etc/ceph/keyring"
CONFIG_OVERRIDE="/etc/rook-config-override/config"
# create a ceph config file in its default location so ceph/rados tools can be used
# without specifying any arguments
@@ -49,6 +50,13 @@ spec:
[client.admin]
keyring = ${KEYRING_FILE}
EOF
# Merge the config override if it exists and is not empty
if [ -f "${CONFIG_OVERRIDE}" ] && [ -s "${CONFIG_OVERRIDE}" ]; then
echo "$DATE merging config override from ${CONFIG_OVERRIDE}"
echo "" >> ${CEPH_CONFIG}
cat ${CONFIG_OVERRIDE} >> ${CEPH_CONFIG}
fi
}
# watch the endpoints config file and update if the mon endpoints ever change
@@ -108,6 +116,9 @@ spec:
- name: ceph-admin-secret
mountPath: /var/lib/rook-ceph-mon
readOnly: true
- name: rook-config-override
mountPath: /etc/rook-config-override
readOnly: true
volumes:
- name: ceph-admin-secret
secret:
@@ -122,6 +133,10 @@ spec:
items:
- key: data
path: mon-endpoints
- name: rook-config-override
configMap:
name: rook-config-override
optional: true
- name: ceph-config
emptyDir: {}
tolerations:
+8
View File
@@ -17,6 +17,7 @@
CEPH_CONFIG="/etc/ceph/ceph.conf"
MON_CONFIG="/etc/rook/mon-endpoints"
KEYRING_FILE="/etc/ceph/keyring"
CONFIG_OVERRIDE="/etc/rook-config-override/config"
# create a ceph config file in its default location so ceph/rados tools can be used
# without specifying any arguments
@@ -37,6 +38,13 @@ mon_host = ${mon_endpoints}
[client.admin]
keyring = ${KEYRING_FILE}
EOF
# Merge the config override if it exists and is not empty
if [ -f "${CONFIG_OVERRIDE}" ] && [ -s "${CONFIG_OVERRIDE}" ]; then
echo "$DATE merging config override from ${CONFIG_OVERRIDE}"
echo "" >> ${CEPH_CONFIG}
cat ${CONFIG_OVERRIDE} >> ${CEPH_CONFIG}
fi
}
# watch the endpoints config file and update if the mon endpoints ever change