mirror of
https://gitlab.kube.huskypup.net/Scooby/Homelabv4.git
synced 2026-08-21 05:26:49 +00:00
Remove dedicated DB devices from Rook-Ceph OSD configuration
Remove metadataDevice (sdb) from all 4 nodes in cluster-values.yaml since the SATA SSDs are slower than the NVMe data drives. Add temporary Kyverno mutate policy to protect existing OSD deployments when the operator is re-enabled - replaces expand-bluefs with a no-op and adds conditional block.db symlink creation based on BlueStore label detection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
34a7cf95d0
commit
511ba55b30
@@ -0,0 +1,63 @@
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
metadata:
|
||||
name: fix-rook-osd-metadata-device
|
||||
annotations:
|
||||
policies.kyverno.io/title: Fix Rook OSD Metadata Device
|
||||
policies.kyverno.io/category: Rook-Ceph
|
||||
policies.kyverno.io/severity: high
|
||||
policies.kyverno.io/description: >-
|
||||
Temporary policy to fix rook-ceph OSD deployments that use metadataDevice.
|
||||
Replaces expand-bluefs with a no-op and adds conditional block.db symlink
|
||||
creation. Remove this policy after all OSDs are recreated without DB devices.
|
||||
spec:
|
||||
background: false
|
||||
rules:
|
||||
- name: fix-osd-init-containers
|
||||
match:
|
||||
any:
|
||||
- resources:
|
||||
kinds:
|
||||
- Deployment
|
||||
namespaces:
|
||||
- rook-ceph
|
||||
selector:
|
||||
matchLabels:
|
||||
app: rook-ceph-osd
|
||||
mutate:
|
||||
patchStrategicMerge:
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
initContainers:
|
||||
- name: expand-bluefs
|
||||
command: ["/bin/true"]
|
||||
args: []
|
||||
- name: create-block-db-symlink
|
||||
image: quay.io/ceph/ceph:v19.2.0
|
||||
command: ["/bin/bash", "-c"]
|
||||
args:
|
||||
- |
|
||||
set -e
|
||||
# Only create block.db symlink if /dev/sdb has a valid BlueStore label
|
||||
if ! ceph-bluestore-tool show-label --dev /dev/sdb 2>/dev/null; then
|
||||
echo "No BlueStore label on /dev/sdb, skipping block.db symlink"
|
||||
exit 0
|
||||
fi
|
||||
echo "BlueStore label found on /dev/sdb"
|
||||
# Find OSD data directory under rook data path
|
||||
for d in /var/lib/rook/rook-ceph/*/; do
|
||||
if [ -L "$d/block" ]; then
|
||||
ln -sf /dev/sdb "$d/block.db"
|
||||
echo "Created block.db -> /dev/sdb in $d"
|
||||
break
|
||||
fi
|
||||
done
|
||||
securityContext:
|
||||
privileged: true
|
||||
runAsUser: 0
|
||||
volumeMounts:
|
||||
- name: rook-data
|
||||
mountPath: /var/lib/rook
|
||||
- name: devices
|
||||
mountPath: /dev
|
||||
Reference in New Issue
Block a user