What Is Pod Affinity?
Pod affinity is a scheduling rule that places a pod on a node based on the labels of other pods already running there. Affinity attracts pods toward each other for locality, while anti-affinity spreads them apart for resilience. The rules are scoped by a topology key such as node, zone, or region.
Why it matters
Anti-affinity spreads replicas across failure domains so a single node or zone loss does not take down a whole service. Affinity co-locates tightly coupled pods to cut cross-node network latency.
Related guides
What Is Node Affinity?Node affinity is a Kubernetes scheduling rule that attracts or restricts pods to nodes matching specified lab…
What Are Taints and Tolerations?Taints and tolerations are a Kubernetes mechanism that lets a node repel pods unless those pods explicitly to…
What Is a Pod Disruption Budget?A pod disruption budget limits how many pods of a workload can be voluntarily taken down at once, protecting…