topology spread constraints
Pod rules that keep replicas evenly spread across zones or nodes, allowing at most a set difference, the skew, between any two.
In more detail
topologyKey names the node label that defines a domain, such as topology.kubernetes.io/zone, and it must exist on the nodes. whenUnsatisfiable chooses DoNotSchedule for a hard rule or ScheduleAnyway for a soft one. A maximum skew of one means no zone has more than one extra matching pod.
Example
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotScheduleRelated terms
- topology domain — A group of nodes that tend to fail together, such as one zone or one machine, identified by a shared node label.
- pod affinity — Rules that place a pod near, or with anti-affinity away from, other pods that carry certain labels, measured within a topology such as a node or zone.
- availability zone — One of several isolated groups of data centres inside a cloud region, with separate power and networking so a failure in one does not take down the others.
Taught in
- Node Affinity, Pod Affinity And Topology Spread — Kubernetes: Production-Grade Container Orchestration