commit 6ba3212ee71e6cb0af6db952f55785b0ea3d038f parent 7c5402b7dd51b4308b2bd10a410206293429a9f7 Author: MTRNord <mtrnord1@gmail.com> Date: Sun, 11 May 2025 14:39:21 +0200 Fix osd placement Diffstat:
| M | infrastructure/controllers/rook.yaml | | | 49 | +++++++++++++++++++++++++++++++++++++++---------- |
1 file changed, 39 insertions(+), 10 deletions(-)
diff --git a/infrastructure/controllers/rook.yaml b/infrastructure/controllers/rook.yaml @@ -59,25 +59,54 @@ spec: cephClusterSpec: cephVersion: image: quay.io/ceph/ceph:v19.2.2 + # Since the OSDs could end up on any node, an effort needs to be made to spread the OSDs + # across nodes as much as possible. Unfortunately the pod anti-affinity breaks down + # as soon as you have more than one OSD per node. The topology spread constraints will + # give us an even spread on K8s 1.18 or newer. placement: - osd: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: topology.kubernetes.io/zone + topologySpreadConstraints: + - maxSkew: 1 + topologyKey: kubernetes.io/hostname + whenUnsatisfiable: ScheduleAnyway + labelSelector: + matchExpressions: + - key: app + operator: In + values: + - rook-ceph-osd + preparePlacement: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + topologyKey: kubernetes.io/hostname + labelSelector: + matchExpressions: + - key: app operator: In values: - - hel1-dc2 - - fsn1-dc14 - - nbg1-dc3 + - rook-ceph-osd + - key: app + operator: In + values: + - rook-ceph-osd-prepare + topologySpreadConstraints: + - maxSkew: 1 + topologyKey: topology.kubernetes.io/zone + whenUnsatisfiable: DoNotSchedule + labelSelector: + matchExpressions: + - key: app + operator: In + values: + - rook-ceph-osd-prepare mgr: count: 2 modules: - name: rook enabled: true mon: - count: 3 + count: 2 allowMultiplePerNode: false volumeClaimTemplate: spec: