Interview Prep/AWS/ECS, EKS, ECR and Lambda

An Ingress never gets an ALB, and the AWS Load Balancer Controller logs `Failed build model due to couldn't auto-discover subnets: unable to resolve at least one subnet`.

IntermediateTroubleshootingECS, EKS, ECR and Lambda
Answer

Likely causes → The subnets do not have the discovery tags: kubernetes.io/role/elb=1 for public subnets (internet-facing) or kubernetes.io/role/internal-elb=1 for private ones. Another cause: fewer than two AZs qualify.

Diagnose →

kubectl -n kube-system logs deploy/aws-load-balancer-controller | tail -30
kubectl describe ingress web -n prod
aws ec2 describe-subnets --filters Name=vpc-id,Values=vpc-0abc \
  --query 'Subnets[].[SubnetId,AvailabilityZone,Tags[?starts_with(Key,`kubernetes.io/role`)]]'

Fix →

aws ec2 create-tags --resources subnet-0pub1 subnet-0pub2 --tags Key=kubernetes.io/role/elb,Value=1

Or list the subnets explicitly with the annotation alb.ingress.kubernetes.io/subnets. Also check that the controller's IAM role has the current policy, because new features need new permissions.

Prevent → Tag subnets in the VPC module, and pin the controller and its IAM policy version together.

aws All AWS questions Roadmap: EKS, ECS & serverless on AWS

More on ECS, EKS, ECR and Lambda