How do you spread workloads correctly across AZs on EKS?
IntermediateProductionEKS in Production
Answer
Use topology spread constraints, not just anti-affinity:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
labelSelector: {matchLabels: {app: orders-api}}
Make sure the node provisioner can launch in all AZs (Karpenter respects the constraint when launching). For EBS-backed StatefulSets, volumes are AZ-bound, so use WaitForFirstConsumer storage classes and one replica per AZ.
More on EKS in Production
Managed node groups, self-managed nodes, Fargate, Karpenter or Auto Mode: how do you choose?IntermediateHow do you design Karpenter NodePools for production?AdvancedIRSA or EKS Pod Identity for new clusters?IntermediateHow do you manage who can access the EKS API?IntermediateHow do you run EKS version upgrades safely?AdvancedWhat happens if you stay on an old EKS version?Beginner