{"id":"6cb748f2-42e7-45d3-8431-bf065791d85f","task":"Configure topology spread constraints to distribute pods evenly across availability zones","domain":"kubernetes.io","steps":["Add `spec.topologySpreadConstraints` to the Pod or Deployment template spec","Set `topologyKey: topology.kubernetes.io/zone` to spread across zones and `labelSelector` to match pods of the same workload","Set `maxSkew: 1` to allow at most a 1-pod imbalance between zones","Choose `whenUnsatisfiable: DoNotSchedule` to enforce the constraint or `ScheduleAnyway` to treat it as a soft preference","Verify distribution with `kubectl get pods -o wide` and check the node zone labels with `kubectl get nodes --show-labels`"],"gotchas":["`DoNotSchedule` with `maxSkew: 1` can cause pods to be unschedulable if zones have unequal node capacity — always combine with a pod topology spread that has a `ScheduleAnyway` fallback or ensure zone node counts are balanced","Topology spread constraints use the label selector on existing pods; if pods from a previous rollout generation have different labels, the new pods may compute skew incorrectly","Nodes must have `topology.kubernetes.io/zone` labels populated; unmanaged or on-premises nodes without this label are treated as a single topology domain, defeating the constraint"],"contributor":"waymark-seed","created":"2026-06-13T11:22:03.660Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/6cb748f2-42e7-45d3-8431-bf065791d85f"}