- Newest
- Most votes
- Most comments
The issue is with the subnets your LoadBalancer is using. It was created in private subnets (with the tag kubernetes.io/role/internal-elb=1), so it can’t receive external traffic.
You need at least one public subnet, with the following tags:
kubernetes.io/role/elb=1
kubernetes.io/cluster/<your-cluster-name>=owned
This subnet also needs a route to an Internet Gateway.
Since you used eksctl create cluster --enable-auto-mode, it likely only created private subnets. If you can recreate the cluster, the best option is to use a YAML config file with properly defined public and private subnets. Or you can manually create a public subnet and associate it with the ELB.
There’s an example here: https://eksctl.io/usage/vpc-networking/#customize-vpc-subnets
The issue you're experiencing is likely related to the subnet configuration for your EKS Auto cluster. It appears that your cluster is currently using only private subnets, which is preventing external access to your load balancer ingress.
To resolve this, you need to ensure that your EKS cluster has both public and private subnets. Here's what you should do:
-
Create or identify public subnets in your VPC. These subnets should have the following tags:
- kubernetes.io/role/elb = 1
- kubernetes.io/cluster/your-cluster-name = shared
-
Keep your existing private subnets, but ensure they have these tags:
- kubernetes.io/role/internal-elb = 1
- kubernetes.io/cluster/your-cluster-name = shared
-
When creating your EKS Auto cluster, specify both public and private subnets. You can do this by modifying your cluster creation command:
eksctl create cluster --enable-auto-mode=True --vpc-public-subnets=subnet-id1,subnet-id2 --vpc-private-subnets=subnet-id3,subnet-id4 ...
Replace subnet-id1, subnet-id2, etc. with your actual subnet IDs.
-
If you've already created the cluster, you can update its VPC configuration:
eksctl utils update-cluster-vpc-config --cluster=my-cluster --region=my-region --vpc-public-subnets=subnet-id1,subnet-id2 --vpc-private-subnets=subnet-id3,subnet-id4 --approve
-
After updating the subnet configuration, you may need to recreate your load balancer to ensure it's properly configured with the new subnet settings.
By setting up both public and private subnets correctly, your load balancer should be able to receive external traffic and route it to your pods. The public subnets will allow the load balancer to have a public-facing endpoint, while the private subnets will host your worker nodes and pods.
Remember to ensure that your security groups are properly configured to allow the necessary inbound traffic to your load balancer and from the load balancer to your pods.
If you're still having issues after making these changes, you may want to check the load balancer controller logs for any specific errors or configuration issues that might be preventing proper target registration or traffic routing.
Sources
The ingress object doesn't creates an ALB to direct traffic to the Kubernetes pods | AWS re:Post
EKS AutoMode - LoadBalancer Functionality | AWS re:Post
Learn about VPC Networking and Load Balancing in EKS Auto Mode - Amazon EKS
Targets are not created in Target Groups | AWS re:Post
Relevant content
- asked 15 days ago
- AWS OFFICIALUpdated 2 years ago
I updated my question - it looks like
eksctl create cluster
creates 4 subents - 2 public & 2 private. I've checked those & the tags look good.