Interview Prep/Real-World Interview/Kubernetes cluster-level

On EKS, new pods stay in `ContainerCreating` with "failed to assign an IP address to container" and aws-node logs show "InsufficientFreeAddressesInSubnet".

IntermediateTroubleshootingKubernetes cluster-level
Answer

Likely causes → The Amazon VPC CNI gives every pod a real VPC IP. The node subnets have run out of free addresses, or the node hit its ENI/IP-per-instance limit. Warm IP pools (WARM_ENI_TARGET) can reserve many addresses that no pod uses.

Diagnose →

aws ec2 describe-subnets --subnet-ids $SUBNETS --query 'Subnets[].[SubnetId,CidrBlock,AvailableIpAddressCount]' -o table
kubectl -n kube-system logs ds/aws-node -c aws-node | grep -i insufficient | tail
kubectl -n kube-system get ds aws-node -o jsonpath='{.spec.template.spec.containers[0].env}' | jq

Fix → Lower warm pool targets (WARM_IP_TARGET=2, MINIMUM_IP_TARGET), enable prefix delegation (ENABLE_PREFIX_DELEGATION=true) for more pods per node, and add subnets from a secondary CIDR (for example 100.64.0.0/16) with custom networking.

Prevent → Plan pod IP space when designing the VPC (large /19 or bigger node subnets), and alert on AvailableIpAddressCount per subnet.

All Real-World Interview questions Roadmap: Interview readiness

More on Kubernetes cluster-level