Cross-AZ data transfer is a top-five line item on the bill. Where does it come from and how do you reduce it?
AdvancedScenarioCost
Answer
Situation read → AWS charges for traffic between AZs in both directions. In Kubernetes, the default is that a request can go to any pod in any AZ, so chatty services multiply it.
What I'd do →
- Find the sources with VPC Flow Logs, grouping by source and destination subnet (each subnet maps to an AZ).
- Turn on topology-aware routing for in-cluster Services so traffic prefers same-zone endpoints:
apiVersion: v1
kind: Service
metadata:
name: orders
spec:
trafficDistribution: PreferClose
- Check the obvious ones: Kafka consumers reading from leaders in other AZs (use rack-aware fetching), replication traffic, and a single NAT gateway shared by all AZs.
- Keep the ALB's cross-zone balancing in mind, and avoid sending logs or metrics to a collector in another AZ.
- Don't trade away resilience: keep replicas in every AZ, only prefer locality.
Why → Locality-aware routing cuts the cost without removing multi-AZ availability.
Interview tip → Say "prefer local, don't pin local"; pinning hurts availability when one AZ is short of pods.
More on Cost
The AWS bill jumped 40% this month and finance wants an explanation by tomorrow. How do you find out why?BeginnerThe "NAT Gateway – data processed" line is $9,000 a month. How do you bring it down?IntermediateCut EKS compute cost by 40% without hurting reliability. What's your plan?AdvancedDev and test environments run 24/7 but are used only during office hours. How do you cut that cost?BeginnerCloudWatch Logs costs more than the EC2 fleet. What do you do?IntermediateFinance asks you to buy commitments. Savings Plans or Reserved Instances, and how much?Intermediate