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: DoNotSchedule

Related terms

Taught in

References