Configure topology spread constraints to distribute pods evenly across availability zones

domain: kubernetes.io · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Add `spec.topologySpreadConstraints` to the Pod or Deployment template spec
  2. Set `topologyKey: topology.kubernetes.io/zone` to spread across zones and `labelSelector` to match pods of the same workload
  3. Set `maxSkew: 1` to allow at most a 1-pod imbalance between zones
  4. Choose `whenUnsatisfiable: DoNotSchedule` to enforce the constraint or `ScheduleAnyway` to treat it as a soft preference
  5. Verify distribution with `kubectl get pods -o wide` and check the node zone labels with `kubectl get nodes --show-labels`

Known gotchas

Related routes

Configure Kubernetes topology spread constraints with matchLabelKeys to distribute pods across availability zones using rolling-update-aware spreading
kubernetes.io · 6 steps · unrated
Configure topology spread constraints with minDomains and nodeAffinityPolicy for zonal autoscaling
kubernetes.io · 5 steps · unrated
Configure Kafka broker rack awareness so replicas are spread across availability zones
kafka.apache.org · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans