From f53b31e030ea24769d80c54ac7201114da2a6f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Sat, 24 Aug 2024 23:22:34 +0300 Subject: [PATCH] bind: Use topology spread constraint instead of anti affinity rules --- bind/bind-secondary.yaml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/bind/bind-secondary.yaml b/bind/bind-secondary.yaml index 249e838..2a49e74 100644 --- a/bind/bind-secondary.yaml +++ b/bind/bind-secondary.yaml @@ -76,16 +76,13 @@ spec: name: bind-readonly-secret - name: bind-data emptyDir: {} - affinity: - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - bind-secondary - topologyKey: "kubernetes.io/hostname" + topologySpreadConstraints: + - maxSkew: 1 + topologyKey: topology.kubernetes.io/zone + whenUnsatisfiable: DoNotSchedule + labelSelector: + matchLabels: + app: bind-secondary --- apiVersion: v1 kind: Service