Q: A PVC is stuck in `Pending` state. What do you check?
1. No matching PV — check if a PV exists with matching storageClassName, accessMode, and enough capacity: kubectl get pv.
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: "In our production Kubernetes clusters running microservices on EKS/AKS, this was a classic operational challenge. When addressing this question, I walk the interviewer through our production incident runbook: isolating the blast radius, checking diagnostic logs and metrics, and applying a safe fix."
Initial Diagnostics & Root Cause Analysis
- No matching PV — check if a PV exists with matching
storageClassName,accessMode, and enough capacity:kubectl get pv. - StorageClass doesn't exist —
kubectl get storageclass. If the PVC references a storage class that doesn't exist, it stays Pending. - Dynamic provisioner not working — if using dynamic provisioning (like AWS EBS CSI driver), check if the CSI driver pods are running:
kubectl get pods -n kube-system | grep csi.
Remediation & Permanent Safeguards
Execute the resolution runbook and verify workload health:
- Volume binding mode — if the StorageClass has
volumeBindingMode: WaitForFirstConsumer, the PVC stays Pending until a pod that uses it is scheduled. That's normal behavior.
- No matching PV — check if a PV exists with matching storageClassName, accessMode, and enough capa...
- StorageClass doesn't exist — kubectl get storageclass. If the PVC references a storage class that...
- Dynamic provisioner not working — if using dynamic provisioning (like AWS EBS CSI driver), check ...
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
- Restarting a crashing container without examining preceding termination logs via kubectl logs --previous when configuring stuck Pending state Restarting the pod flushes ephemeral container runtime state, destroying vital panic stack traces and fatal initialization logs.
-
Misdiagnosing an application boot crash as a failure of aggressive liveness probes when configuring stuck Pending state
Liveness probes with short timeouts or high failure thresholds kill slow-starting applications repeatedly, causing false
CrashLoopBackOffloops. -
Neglecting node taints, tolerations, and resource quotas when diagnosing pods stuck in Pending when configuring stuck Pending state
Pods remain
Pendingwhen scheduler predicates fail;kubectl describe podreveals whether CPU/memory exhaustion or taints prevent placement. - Invoking kubectl delete pod --force --grace-period=0 indiscriminately on unready pods when configuring stuck Pending state Forced deletion bypasses kubelet cleanup and can cause multi-attach errors on PersistentVolumes (PVs) or split-brain on stateful workloads.