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

New EKS worker nodes never join; `kubectl get nodes` does not list them, while the EC2 instances are running.

IntermediateTroubleshootingECS, EKS, ECR and Lambda
Answer

Likely causes → The node IAM role has no access entry (type EC2_LINUX) or aws-auth mapping. Other causes: the node SG cannot reach the API endpoint (private endpoint, missing 443 rule), the nodes cannot reach ECR or STS (no NAT or endpoints), or the bootstrap or nodeadm config has the wrong cluster name or CA.

Diagnose →

aws eks list-access-entries --cluster-name prod
aws eks describe-nodegroup --cluster-name prod --nodegroup-name ng-1 --query 'nodegroup.health'
# on the node via SSM:
sudo journalctl -u kubelet --no-pager | tail -50
sudo journalctl -u nodeadm-run --no-pager | tail -20   # AL2023

Fix →

  1. Run aws eks create-access-entry --cluster-name prod --principal-arn <node-role-arn> --type EC2_LINUX
  2. Allow 443 from the node SG to the cluster SG, and add NAT or endpoints (ecr.api, ecr.dkr, s3, sts, ec2)

Prevent → Use managed node groups or Karpenter, which create the access entries, and check node health issues in describe-nodegroup.

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

More on ECS, EKS, ECR and Lambda