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.
In more detail
Affinity keeps chatty workloads together; anti-affinity keeps replicas apart so one failure does not take them all. Hard anti-affinity with more replicas than domains leaves the extra pods Pending. Topology spread constraints are often a gentler way to balance replicas.
Related terms
- node affinity — Rules in a pod spec that say which nodes the pod must run on, or would prefer, based on node labels such as zone or hardware.
- 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.
- topology domain — A group of nodes that tend to fail together, such as one zone or one machine, identified by a shared node label.
Taught in
- Requests, Limits, Quotas And Horizontal Autoscaling — Kubernetes: Production-Grade Container Orchestration
- Node Affinity, Pod Affinity And Topology Spread — Kubernetes: Production-Grade Container Orchestration