Estimate pod spread outcomes across nodes when podAntiAffinity rules are enforced.
podAntiAffinity (or the more flexible topologySpreadConstraints) prevents replicas from stacking on the same node or zone, trading some scheduling flexibility for resilience — a single node or zone failure can only take out a bounded fraction of replicas. The ceiling on replicas is zones × nodes-per-zone × max-allowed-per-node; requesting more replicas than that ceiling leaves excess pods permanently Pending.
maxReplicas = zones × nodesPerZone × maxPerNode
podAntiAffinity is boolean (avoid/prefer co-location) and gets computationally expensive at scale. topologySpreadConstraints explicitly controls the maximum skew between topology domains (e.g. max 1 pod difference between zones) and is the newer, more scalable, more precise mechanism for even spreading.
With a hard (required) anti-affinity rule, excess pods beyond the ceiling stay Pending indefinitely since no eligible node/zone slot remains — switch to a soft (preferred) rule or add nodes/zones to raise the ceiling.
Cloud availability zones fail independently — spreading replicas evenly means a single zone outage removes at most 1/N of capacity (matching zoneFailureImpactPercent) rather than potentially all of it if replicas happened to cluster in one zone.