Interview Prep/Kubernetes/Scheduling, Resources & Autoscaling

What are topology spread constraints?

IntermediateConceptScheduling, Resources & Autoscaling
Answer

They spread matching Pods evenly across domains with a tolerated maxSkew, topologyKey and whenUnsatisfiable (DoNotSchedule or ScheduleAnyway). They give even distribution that anti-affinity cannot (it is all-or-nothing).

topologySpreadConstraints:
- maxSkew: 1
  topologyKey: topology.kubernetes.io/zone
  whenUnsatisfiable: DoNotSchedule
  labelSelector: { matchLabels: { app: web } }
All Kubernetes questions Roadmap: Kubernetes core

More on Scheduling, Resources & Autoscaling