Interview Prep/Kubernetes/Pod startup failures

Pods stay in `ContainerCreating` with `Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "...": plugin type="aws-cni" ... failed to assign an IP address to container`.

IntermediateTroubleshootingPod startup failures
Answer

Likely causes → The CNI plugin cannot give the Pod an IP: subnet or node IP pool exhausted, CNI DaemonSet unhealthy on that node, or IPAM state corruption after a crash.

Diagnose →

kubectl get pods -n kube-system -o wide | grep -E 'aws-node|calico|cilium' | grep <node>
kubectl logs -n kube-system <cni-pod-on-node> --tail=100
kubectl describe node <node> | grep -A5 Allocatable

Fix → Restart the CNI Pod on that node, free or add IP capacity (bigger subnet, prefix delegation on EKS), and cordon/replace the node if IPAM is corrupt.

Prevent → Alert on CNI Pod restarts and subnet free IPs; size Pod CIDRs for peak plus surge during rollouts.

All Kubernetes questions Roadmap: Kubernetes core

More on Pod startup failures