DevOpsil
KubernetesHigh

Fix: Kubernetes PVC Stuck in Pending State

PVC status shows Pending indefinitely

!Symptoms

  • PVC status shows Pending indefinitely
  • Pods using the PVC are stuck in Pending state
  • kubectl describe pvc shows 'waiting for first consumer'
  • No PersistentVolume is being dynamically provisioned

?Root Causes

  • No StorageClass configured or default StorageClass missing
  • StorageClass provisioner not installed (e.g., EBS CSI driver, NFS provisioner)
  • WaitForFirstConsumer binding mode but no pod scheduled to the same zone
  • Insufficient cloud provider quota for volumes (EBS, Persistent Disk)
  • Storage class parameters don't match available zones or disk types

#Diagnosis Steps

  1. 1Run `kubectl describe pvc <name>` and check events for provisioning errors
  2. 2Run `kubectl get sc` to verify StorageClass exists and check the default annotation
  3. 3Run `kubectl get pv` to see if a matching PersistentVolume exists
  4. 4Check cloud provider quotas: `aws service-quotas` or GCP console
  5. 5Verify CSI driver pods are running: `kubectl get pods -n kube-system | grep csi`

>Fix

  1. 1Install the required CSI driver (e.g., `aws-ebs-csi-driver`, `gcp-pd-csi-driver`)
  2. 2Create a default StorageClass: add `storageclass.kubernetes.io/is-default-class: true` annotation
  3. 3If WaitForFirstConsumer, ensure a pod referencing the PVC is scheduled
  4. 4Increase cloud provider volume quotas if at limit
  5. 5Manually create a PV matching the PVC's requirements as a temporary fix

*Prevention

  • Include CSI drivers in cluster bootstrapping automation
  • Always define a default StorageClass in your cluster config
  • Monitor cloud provider quotas with alerts
  • Use Immediate binding mode for non-topology-constrained workloads
  • Test PVC provisioning in staging before relying on it in production

Related Error Messages

waiting for first consumer to be created before bindingno persistent volumes available for this claimstorageclass.storage.k8s.io not foundfailed to provision volume with StorageClass