⚡ ~/naveed Interview Prep
⚡ Portfolio Home 👤 About Naveed Bio & Credentials 📫 Contact Naveed Get In Touch ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 1,000+ Scenarios ☸️ Kubernetes Mastery Hub 24 Modules 🎮 DevOps Arcade & Quizzes Subnet Blitz ⚡ 🗺️ DevOps Roadmaps PDFs & Guides 🤖 Morpheus Analysis AI Quant ↗ 🛠️ Developer Tools Utilities 🧪 Labs & Experiments 📄 Interactive CV & Certs 🔗 All Links & Socials ⚡ Join The Dispatch (Weekly SRE Newsletter) →
← Back to All Kubernetes Interview Questions Scenario 190 of 207 in Kubernetes
Senior SRE / Platform Engineer Kubernetes Pod Lifecycle & ContainerCreating Tesla Scale Loop

Q: How would you debug a pod stuck in 'ContainerCreating' during deployment? What are your next 3 CLI commands?

Immediate root cause diagnosis and the exact 3 CLI commands to execute when a Kubernetes pod is stuck indefinitely in the ContainerCreating state.

#Kubernetes #ContainerCreating #CSI #Kubelet #CLI Commands #Tesla #Troubleshooting
🎙️ Candidate Opening & Architectural Context
"When a pod is stuck in ContainerCreating, the Kubernetes control plane has already scheduled the pod to a worker node, but the local kubelet or container runtime (containerd/CRI-O) cannot assemble the runtime sandbox. This is caused by persistent volume mount timeouts, missing Secrets/ConfigMaps, CNI IP allocation failures, or image pull throttling."
Advertisement
⚡ Recommended Practice Lab

Want to master this scenario in a live sandbox? KodeKloud's CKA & CKAD Hands-On Certification Track covers this exact problem with hands-on terminal drills.

🛠️ Production Runbook & Step-by-Step Resolution

Direct Answer: When a pod is stuck in ContainerCreating, the Kubernetes control plane has already scheduled the pod to a worker node, but the local kubelet or container runtime (containerd/CRI-O) cannot assemble the runtime sandbox. This is caused by persistent volume mount timeouts, missing Secrets/ConfigMaps, CNI IP allocation failures, or image pull throttling.

1

Command 1: Inspect Pod Events (kubectl describe pod)

The first command reveals the exact subsystem blocking initialization: Volume Mount, Secret, ConfigMap, or Network Sandbox.

# Command 1:
kubectl describe pod <pod-name> -n <namespace>
# Look at Events table:
# MountVolume.SetUp failed for volume "pvc-storage" : rpc error ...
# FailedCreatePodSandBox: failed to setup network for sandbox ... IPAM error
2

Command 2: Inspect Kubelet Host Logs (journalctl -u kubelet)

If pod events are silent or generic, log into the specific node and query kubelet system logs to see the underlying CRI or CNI failure.

# Command 2:
journalctl -u kubelet --no-pager -n 50
# Reveals containerd socket errors, disk space full, or device mapper timeouts
Advertisement
3

Command 3: Inspect Containerd Runtime & CNI Plugin Logs

If kubelet is waiting on the runtime sandbox, query containerd directly via crictl to inspect failing container tasks and CNI allocations.

# Command 3:
crictl pods --name <pod-name>
# And check containerd logs:
journalctl -u containerd --no-pager -n 50
4

Top Root Causes & Fast Resolution

1. Volume Attachment Timeout: The previous pod replica is still holding an exclusive lock on an EBS/PersistentVolume. Manually terminate the dead pod or detach the stale cloud volume. 2. Missing Secret/ConfigMap: Pod spec references an optional=false Secret that does not exist in the namespace. 3. CNI Subnet Exhaustion: Node cannot allocate an IP address from the VPC/Calico subnet pool.

Pro Tip: Three Command Sequence: 1) kubectl describe pod, 2) journalctl -u kubelet, 3) crictl pods / journalctl -u containerd.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Execute: 1) kubectl describe pod for event errors, 2) journalctl -u kubelet for CRI/CSI errors, and 3) crictl / journalctl -u containerd for sandbox runtime failures. Resolve volume locks and CNI IP pool exhaustion."
⚡ 60-Second Elevator Pitch Talking Points
  • Execute kubectl describe pod to inspect the Events log for volume mount or CNI errors.
  • Run journalctl -u kubelet on the host node to see CRI runtime and sandbox errors.
  • Run crictl pods and journalctl -u containerd to check container runtime timeouts directly.
  • Triage common root causes: stale volume locks from previous pods, missing secrets, or CNI IP exhaustion.
⛔ Critical Candidate Mistakes to Avoid in This Scenario

Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:

  1. Conflating container cgroup OOMKill events (Exit Code 137) with node-level MemoryPressure evictions Exit Code 137 indicates the container cgroup exceeded its limits.memory, whereas Node MemoryPressure triggers kubelet eviction of lower QoS pods.
  2. Increasing memory limits arbitrarily without profiling application heap allocation and memory leak roots Increasing limits for applications with memory leaks merely delays the inevitable OOMKill and increases host resource waste.
  3. Overlooking imagePullSecrets and registry credential expiration during ImagePullBackOff triage Missing or expired private registry authentication tokens block container image pulls before pod bootstrapping can begin.
  4. Omitting startup probes on slow-initializing JVM or inference workloads in Kubernetes Startup probes protect slow-starting applications by pausing liveness and readiness probe evaluation until initial warmup completes.
Advertisement
📥 FREE DOWNLOAD · 101-PAGE COMPANION HANDBOOK
Studying for Kubernetes & SRE Technical Rounds?
Download the complete 100-question PDF field guide covering all 11 core modules with offline diagnostic runbooks.
📥 Download PDF (Free) Read Online Guide →
Want more Kubernetes scenarios?
Explore our complete collection of scenario-based Kubernetes interview runbooks.
Browse All Kubernetes Questions →