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.
More on Kubernetes cluster-level
Every `kubectl` command fails with "The connection to the server 10.0.1.10:6443 was refused - did you specify the right host or port?"BeginnerA new deployment's pods stay Pending with "0/5 nodes are available: 5 Insufficient cpu. preemption: 0/5 nodes are available: 5 No preemption victims found for incoming pod."BeginnerPods are Pending, but Cluster Autoscaler won't add nodes; the pod events say "pod didn't trigger scale-up: 2 node(s) didn't match Pod's node affinity/selector, 1 max node group size reached".IntermediateA node goes NotReady and kubelet logs "PLEG is not healthy: pleg was last seen active 3m10s ago; threshold is 3m0s".IntermediateAfter a node was terminated, its pods have shown `Terminating` for two hours and their replacements aren't being created.IntermediateYou deleted a namespace an hour ago and it's still `Terminating`.Intermediate