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. 1.Verify storage provisioner is running:
  2. 2.```bash
  3. 3.kubectl get pods -n kube-system | grep -E "ebs-csi|gce-pd|azure-disk|rook|csi"
  4. 4.`
  5. 5.Check available PVs:
  6. 6.```bash
  7. 7.kubectl get pv
  8. 8.kubectl get pv -o jsonpath='{range .items[*]}{.metadata.name} {.status.phase} {.spec.capacity.storage}{"\n"}{end}'
  9. 9.`
  10. 10.Create a matching StorageClass:
  11. 11.```yaml
  12. 12.apiVersion: storage.k8s.io/v1
  13. 13.kind: StorageClass
  14. 14.metadata:
  15. 15.name: gp3-retain
  16. 16.provisioner: ebs.csi.aws.com
  17. 17.parameters:
  18. 18.type: gp3
  19. 19.fsType: ext4
  20. 20.volumeBindingMode: WaitForFirstConsumer
  21. 21.reclaimPolicy: Retain
  22. 22.`

Prevention - Ensure CSI drivers are installed before deploying stateful workloads - Use WaitForFirstConsumer binding mode for better scheduling - Monitor available storage capacity in the cluster - Set up alerts for PVC Pending state - Pre-provision PVs for critical workloads