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 →
- Run
aws eks create-access-entry --cluster-name prod --principal-arn <node-role-arn> --type EC2_LINUX - 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.
More on ECS, EKS, ECR and Lambda
`docker push 111111111111.dkr.ecr.us-east-1.amazonaws.com/api:1.4` fails with `no basic auth credentials` (or `denied: Your authorization token has expired. Reauthenticate and try again.`).BeginnerFargate tasks stop with `CannotPullContainerError: pull image manifest has been retried 5 time(s): failed to resolve ref ... dial tcp 52.x.x.x:443: i/o timeout`.Intermediate`ResourceInitializationError: unable to pull secrets or registry auth: ... AccessDeniedException: User: arn:aws:sts::111111111111:assumed-role/ecsTaskExecutionRole/... is not authorized to perform: secretsmanager:GetSecretValue`.IntermediateA task stops with `Essential container in task exited`, exit code 137, and reason `OutOfMemoryError: Container killed due to memory usage`.BeginnerThe ECS service event says `service api was unable to place a task because no container instance met all of its requirements. The closest matching container-instance ... has insufficient memory available.`IntermediateAn ECS deployment rolls back automatically, and the event says `deployment failed: tasks failed to start` from the circuit breaker.Advanced