Kubernetes Pod Affinity and Anti-Affinity
Kubernetes Pod Affinity and Anti-Affinity are scheduling rules that place a Pod based on the labels of Pods already running. Affinity puts a Pod close to matching Pods (for example, an app next to its cache on the same node), and anti-affinity keeps it away from them, which spreads replicas across nodes or zones. A topology key defines what "close" means, and each rule is either required or preferred.

See also Kubernetes Pod Topology Spread Constraints, Kubernetes PodDisruptionBudget (PDB), Kubernetes PriorityClass, Kubernetes Readiness Probe, Kubernetes ReplicaSet, Kubernetes Resource Requests and Limits.