A Simple Config to Reduce Cross-AZ traffic of EKS Workloads
In this post, we will explore how "Traffic Distribution" helps in reducing the cross-AZ data transfer of EKS workloads.
- An EKS cluster;
- Three worker nodes, distributed to three AZs evenly;
- An AWS Distro for OpenTelemetry collector to ingest tracing data to AWS X-Ray;
- A sample retail store application;


AZ | # of UI pods | # of Catalog pods |
---|---|---|
AZ1 | 1 | 1 |
AZ2 | 1 | 1 |
AZ3 | 1 | 1 |


trafficDistribution
.endpointslices
information of the catalog service.hint
of AZ information was added to each endpoint.trafficDistribution
, traffic from UI are only routed to Catalog endpoint in the same AZ.
AZ | # of UI pods | # of Catalog pods |
---|---|---|
AZ1 | 1 | 0 |
AZ2 | 1 | 2 |
AZ3 | 1 | 1 |

- A1 has no target endpoint in the same AZ, so its traffic is routed to all AZs;
- A2 has two target endpoints in the same AZ, so its traffic is load balanced to B1 and B2 in the same AZ;
- A3 has one target endpoint in the same AZ, so its traffic is routed to the B3 in the same AZ;

AZ | # of UI pods | # of Catalog pods |
---|---|---|
AZ1 | 1 | 1 |
AZ2 | 2 | 1 |
AZ3 | 0 | 1 |

- A1 has one target endpoint in the same AZ, so its traffic is routed to B1 the same AZs;
- A2 and A3 are in the same AZ, their traffic are routed to B2 in the same AZ;
- B3 is not in this Trace Map at all, because there is no traffic to B3;

Case # | UI pods | Catalog pods | Result |
---|---|---|---|
Case 1 | 1:1:1 | 1:1:1 | Load balanced and no cross-AZ traffic. |
Case 2 | 1:1:1 | 0:2:1 | Traffic from AZ1 is routed to other AZs; Load NOT balanced. |
Case 3 | 1:2:0 | 1:1:1 | Catalog in AZ3 has no incoming traffic; Load NOT balanced. |
- Avoid traffic imbalance and potential overload;
- Keep data transfer within the same AZ.
Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.