Introduction A PVC stuck in Pending state means Kubernetes cannot find or create a matching PersistentVolume. This blocks pods that require persistent storage from scheduling.
Symptoms - `kubectl get pvc` shows STATUS = Pending - `kubectl describe pvc` shows: "waiting for first consumer to be created before binding" or "no persistent volumes available" - Pod scheduling fails due to unbound volumes - Events show: "FailedBinding: no persistent volumes available for this claim"
Common Causes - No StorageClass matching the PVC request - Storage provisioner not running (e.g., rook-ceph, ebs-csi) - Insufficient storage capacity in the cluster - Node affinity rules preventing volume creation on available nodes - CSI driver not installed or misconfigured
Step-by-Step Fix 1. **Check PVC details and storage class**: ```bash kubectl describe pvc <pvc-name> -n <namespace> kubectl get storageclass ```
- 1.Verify storage provisioner is running:
- 2.```bash
- 3.kubectl get pods -n kube-system | grep -E "ebs-csi|gce-pd|azure-disk|rook|csi"
- 4.
` - 5.Check available PVs:
- 6.```bash
- 7.kubectl get pv
- 8.kubectl get pv -o jsonpath='{range .items[*]}{.metadata.name} {.status.phase} {.spec.capacity.storage}{"\n"}{end}'
- 9.
` - 10.Create a matching StorageClass:
- 11.```yaml
- 12.apiVersion: storage.k8s.io/v1
- 13.kind: StorageClass
- 14.metadata:
- 15.name: gp3-retain
- 16.provisioner: ebs.csi.aws.com
- 17.parameters:
- 18.type: gp3
- 19.fsType: ext4
- 20.volumeBindingMode: WaitForFirstConsumer
- 21.reclaimPolicy: Retain
- 22.
`