Of course. This is a very common and frustrating error when working with EKS and the AWS Load Balancer Controller. The error message is the key:
unable to resolve at least one subnet. Evaluated 0 subnets
This tells you that the AWS Load Balancer Controller (which is responsible for creating the physical AWS Load Balancer for your istio-ingressgateway service) did not find any subnets that it considered valid for use.
Even though you believe you have tagged your subnets and have available IPs, the controller's discovery process failed to find them. Let's break down why this happens and how to fix it, step-by-step.
The problem is almost always one of these three things:
- Incorrect Subnet Tags: The tags are present, but have typos, wrong values, or are missing a required tag.
- Missing IAM Permissions: The IAM role used by the AWS Load Balancer Controller pod does not have permission to
describe the subnets.
- Mismatched Cluster Name: The controller was installed with a
--cluster-name that doesn't match your actual EKS cluster name, so it's looking for the wrong tags.
Troubleshooting Checklist
Follow these steps precisely to find the issue.
Step 1: Get Your Exact EKS Cluster Name
This is critical because it forms part of the required subnet tag.
# Set your AWS region
export AWS_REGION=us-west-2 # <-- Change to your region
# Get your cluster name
export CLUSTER_NAME=$(aws eks list-clusters --region $AWS_REGION --query "clusters[0]" --output text)
echo "Your EKS Cluster Name is: ${CLUSTER_NAME}"
Keep this CLUSTER_NAME handy.
Step 2: Verify the Subnet Tags (The Most Common Culprit)
The AWS Load Balancer Controller requires two specific tags on each subnet it should use for creating a public Load Balancer.
-
Cluster Ownership Tag: This tells the controller that the subnet belongs to your EKS cluster.
- Tag Key:
kubernetes.io/cluster/<your-cluster-name> (replace <your-cluster-name> with the name from Step 1)
- Tag Value:
shared
-
Role Tag: This tells the controller that the subnet is intended for external load balancers.
- Tag Key:
kubernetes.io/role/elb
- Tag Value:
1 (The value can be empty or 1, but it must exist).
How to Check and Fix:
-
Go to the AWS Console:
- Navigate to VPC -> Subnets.
- Find the subnets associated with your EKS cluster's VPC.
- Select one of the public subnets you want the Istio ingress to use.
- Click on the Tags tab.
-
Verify the tags. You should see exactly this (using an example cluster name my-eks-cluster):
| Key | Value |
|---|
kubernetes.io/cluster/my-eks-cluster | shared |
kubernetes.io/role/elb | 1 |
Note: If you want to create an internal load balancer, the second tag should be kubernetes.io/role/internal-elb with a value of 1. For Istio Ingress Gateway, you almost always want a public one, so use kubernetes.io/role/elb.
-
Repeat for all subnets you want to be available for the load balancer. For high availability, you should have at least two tagged subnets in different Availability Zones.
Step 3: Verify the AWS Load Balancer Controller's Configuration and Permissions
If the tags are correct, the next suspect is the controller itself.
-
Check the Controller Logs for More Clues:
The log you provided is the final error. Look at the logs right before it.
# Find the controller pod
kubectl get pods -n kube-system -l app.kubernetes.io/name=aws-load-balancer-controller
# Check its logs
kubectl logs -n kube-system <your-aws-lbc-pod-name>
-
Verify the Controller's IAM Role (IRSA):
The controller uses an IAM Role for Service Accounts (IRSA) to get AWS permissions.
-
Find the Service Account:
kubectl describe serviceaccount aws-load-balancer-controller -n kube-system
Look for the eks.amazonaws.com/role-arn annotation. This is the IAM role it's using.
-
Check the IAM Role's Permissions:
Go to the AWS IAM console, find that role, and check its attached policy. The policy must include permissions like ec2:DescribeSubnets and ec2:DescribeVpcs. If it can't describe subnets, it will evaluate "0 subnets".
The official policy JSON can be found here: AWS LBC IAM Policy
-
Verify the Controller's --cluster-name Argument:
This is a critical and easy mistake to make. The controller needs to know which cluster it's managing.
kubectl describe deployment aws-load-balancer-controller -n kube-system
Look under spec.template.spec.containers.args. You must see an argument like this:
--cluster-name=<your-cluster-name>
If this name does not exactly match the cluster name from Step 1, the controller will be looking for tags like kubernetes.io/cluster/wrong-name and will find nothing. If it's wrong, you need to update the deployment manifest and re-apply it.
Step 4: Check the Istio Service Annotations
While less likely to cause an "evaluated 0 subnets" error, it's good to check. Your istio-ingressgateway service might have an annotation that tries to force a specific set of subnets.
kubectl get svc istio-ingressgateway -n istio-system -o yaml
Look for an annotation like service.beta.kubernetes.io/aws-load-balancer-subnets.
- If this annotation exists: It will override the auto-discovery based on tags. The controller will ONLY use the subnet IDs listed in this annotation. Make sure those subnets exist and are correctly configured.
- If this annotation does not exist: The controller will fall back to auto-discovery using the tags from Step 2. For troubleshooting, it's often best to remove this annotation to let auto-discovery work.
Summary and Corrective Action
- Fix Tags: The most likely solution is to go to your VPC subnets in the AWS console and add/correct the two required tags:
kubernetes.io/cluster/<your-cluster-name> = shared and kubernetes.io/role/elb = 1.
- Wait and See: After fixing the tags, the AWS Load Balancer Controller will automatically retry. You can check the status of the service:
kubectl get svc istio-ingressgateway -n istio-system --watch
Within a minute or two, an EXTERNAL-IP (which will be a DNS name for the NLB) should appear.
- If Still Failing: Proceed to verify the controller's IAM permissions and its
--cluster-name deployment argument. These are the next most likely causes.