- Newest
- Most votes
- Most comments
When you say internal traffic, do you have an IP for example thats going via the NAT gateway which should be LOCAL?
Based on the information provided, it appears that your EKS cluster is experiencing unexpected NAT Gateway usage for internal communication, which should typically remain within the VPC. Here are some potential reasons and advice to address this issue:
-
Cluster Endpoint Configuration: Check your EKS cluster's API server endpoint configuration. If only the public endpoint is enabled, Kubernetes API requests originating from within your cluster's VPC will leave the VPC and go through the NAT Gateway. To resolve this, enable both public and private endpoints for your cluster. This allows nodes to communicate with the control plane via private VPC endpoints, keeping traffic within the VPC.
-
VPC DNS Settings: Ensure that your VPC has
enableDnsHostnamesandenableDnsSupportset totrue, and the DHCP options for your VPC includeAmazonProvidedDNSin its domain name servers list. This is necessary for proper routing of traffic to your API server through the private hosted zone created by EKS. -
Security Group Configuration: Verify that the control plane security group allows ingress traffic on port 443 from your node security groups. This ensures that nodes can communicate directly with the API server without going through the NAT Gateway.
-
Networking Add-ons: If you're using alternative networking add-ons or self-managing the default ones (Amazon VPC CNI, CoreDNS, kube-proxy), ensure they are configured correctly to use the cluster's private endpoint.
-
Application-specific Configuration: Review your Spark application configuration to ensure it's not explicitly using public endpoints for internal communication. Make sure it's configured to use private DNS names or IP addresses for internal services.
-
VPC Endpoints: Consider setting up VPC endpoints for other AWS services your application might be using (besides the S3 endpoint you already have). This can help reduce traffic going through the NAT Gateway.
-
Flow Log Analysis: Continue analyzing your VPC Flow Logs to identify the specific sources and destinations of the traffic going through the NAT Gateway. This can help pinpoint which components of your application or cluster are causing the unexpected external communication.
By addressing these points, you should be able to minimize or eliminate unnecessary NAT Gateway usage for internal communication within your EKS cluster.
Sources
VPC and Subnet Considerations - Amazon EKS
Control network access to cluster API server endpoint - Amazon EKS
Amazon EKS introduces cluster creation flexibility for networking add-ons - AWS
Relevant content
asked 4 years ago
- AWS OFFICIALUpdated 2 months ago

When I analyze VPC Log Flow, I can see this.
eni-0dcb57a8cffee73e8 is the ENI for NAT and 100.64.122.174 is my private EKS VPC
version account-id interface-id srcaddr dstaddr srcport dstport protocol packets bytes start end action log-status 2 ... eni-0dcb57a8cffee73e8 100.64.122.174 10.77.153.112 56442 443 6 18 3727 1734692989 1734693008 ACCEPT OK 2 ... eni-0dcb57a8cffee73e8 100.64.122.174 10.77.153.112 58172 443 6 22 7150 1734693027 1734693057 ACCEPT OK 2 ... eni-0dcb57a8cffee73e8 100.64.122.174 10.77.153.112 44000 443 6 18 3727 1734693037 1734693062 ACCEPT OK 2 ... eni-0dcb57a8cffee73e8 10.77.153.112 100.64.122.174 443 38070 6 35 21521 1734692945 1734692973 ACCEPT OK 2 ... eni-0dcb57a8cffee73e8 10.77.153.112 100.64.122.174 443 48458 6 33 21441 1734692800 1734692825 ACCEPT OK 2 ... eni-0dcb57a8cffee73e8 10.77.153.112 100.64.122.174 443 41720 6 20 10155 1734692800 1734692825 ACCEPT OK
If i'm not wrong this should not happen.
Can you confirm the route table is associated to the correct Subents?
Yep, it is connected to the correct subnets
rtb-0342d2f06937fc1d7
vpc-primary-USEA11 - EKS Subnet 2 subnet-0c4d9d7655dd82a0b 100.64.128.0/17 – vpc-primary-USEA11 - EKS Subnet 1 subnet-045a376854b3ddeb8 100.64.0.0/17 –
Just create a Flow Log exclusive for this ENI and I can see a lot of calls to AWS us-west-2 ec2 endpoints, is this normal?