Files
my-rook-config/deploy/examples/toolbox-job.yaml
T
Matthew N. Heler 9570d141de 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>
2025-11-18 13:43:14 -06:00

70 lines
2.1 KiB
YAML

apiVersion: batch/v1
kind: Job
metadata:
name: rook-ceph-toolbox-job
namespace: rook-ceph # namespace:cluster
labels:
app: ceph-toolbox-job
spec:
template:
spec:
initContainers:
- name: config-init
image: docker.io/rook/ceph:master
command: ["/usr/local/bin/toolbox.sh"]
args: ["--skip-watch"]
imagePullPolicy: IfNotPresent
env:
- name: ROOK_CEPH_USERNAME
valueFrom:
secretKeyRef:
name: rook-ceph-mon
key: ceph-username
volumeMounts:
- mountPath: /etc/ceph
name: ceph-config
- name: mon-endpoint-volume
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
volumeMounts:
- mountPath: /etc/ceph
name: ceph-config
readOnly: true
command:
- "bash"
- "-c"
- |
# Modify this script to run any ceph, rbd, radosgw-admin, or other commands that could
# be run in the toolbox pod. The output of the commands can be seen by getting the pod log.
#
# example: print the ceph status
ceph status
volumes:
- name: ceph-admin-secret
secret:
secretName: rook-ceph-mon
optional: false
items:
- key: ceph-secret
path: secret.keyring
- name: mon-endpoint-volume
configMap:
name: rook-ceph-mon-endpoints
items:
- key: data
path: mon-endpoints
- name: rook-config-override
configMap:
name: rook-config-override
optional: true
- name: ceph-config
emptyDir: {}
restartPolicy: Never