commit 7b42a1468c7b83b054dc60af0495b0f76e1ee510 parent 2ae6f273c084f12fd9c3ad0130e7d36eadb3f430 Author: MTRNord <mtrnord1@gmail.com> Date: Sun, 11 May 2025 14:52:29 +0200 Fix osd placement Diffstat:
| M | infrastructure/controllers/rook.yaml | | | 82 | ++++++++++++++++++++++++++++++++++++++++---------------------------------------- |
1 file changed, 41 insertions(+), 41 deletions(-)
diff --git a/infrastructure/controllers/rook.yaml b/infrastructure/controllers/rook.yaml @@ -59,47 +59,6 @@ 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: - 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: - - 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: @@ -127,6 +86,47 @@ spec: portable: true encrypted: false tuneFastDeviceClass: true + # 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: + 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: + - 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 volumeClaimTemplates: - metadata: name: "data"