PVC stuck in Pending: why your PersistentVolumeClaim will not bind

Reproduced on k3s v1.31.5 (k3d) with kubectl v1.36.1 and the local-path provisioner v0.0.30 that ships with k3s. The EBS CSI driver steps were not run in the lab.

What you see

$ kubectl get storageclass
NAME                   PROVISIONER             RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
local-path (default)   rancher.io/local-path   Delete          WaitForFirstConsumer   false                  35s

$ kubectl get pvc -n lab
NAME        STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   VOLUMEATTRIBUTESCLASS   AGE
data-rwx    Pending                                      local-path     <unset>                 15s
data-typo   Pending                                      fast-ssd       <unset>                 15s
data-wffc   Pending                                      local-path     <unset>                 15s

$ kubectl describe pvc data-typo -n lab
StorageClass:  fast-ssd
Status:        Pending
Used By:       <none>
Events:
  Type     Reason              Age               From                         Message
  Warning  ProvisioningFailed  4s (x2 over 15s)  persistentvolume-controller  storageclass.storage.k8s.io "fast-ssd" not found

$ kubectl describe pvc data-wffc -n lab
Events:
  Type    Reason                Age               From                         Message
  Normal  WaitForFirstConsumer  4s (x2 over 15s)  persistentvolume-controller  waiting for first consumer to be created before binding

# after a pod that uses each claim is created
$ kubectl get pvc,pod -n lab
NAME                              STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS
persistentvolumeclaim/data-rwx    Pending                                                                        local-path
persistentvolumeclaim/data-typo   Pending                                                                        fast-ssd
persistentvolumeclaim/data-wffc   Bound     pvc-cce1e24e-fe10-4de8-9b9e-a643bf119f69   1Gi        RWO            local-path

NAME           READY   STATUS    RESTARTS   AGE
pod/use-rwx    0/1     Pending   0          40s
pod/use-typo   0/1     Pending   0          40s
pod/use-wffc   1/1     Running   0          40s

$ kubectl describe pod use-typo -n lab
  Warning  FailedScheduling  40s  default-scheduler  0/1 nodes are available: pod has unbound immediate PersistentVolumeClaims. preemption: 0/1 nodes are available: 1 Preemption is not helpful for scheduling.

$ kubectl describe pvc data-rwx -n lab
  Warning  ProvisioningFailed  25s (x2 over 40s)  rancher.io/local-path_local-path-provisioner-...  failed to provision volume with StorageClass "local-path": NodePath only supports ReadWriteOnce and ReadWriteOncePod (1.22+) access modes

# provisioner scaled to zero
$ kubectl describe pvc data-noprov -n lab
  Normal  ExternalProvisioning  14s (x4 over 45s)  persistentvolume-controller  Waiting for a volume to be created either by the external provisioner 'rancher.io/local-path' or manually by the system administrator. If volume creation is delayed, please verify that the provisioner is running and correctly registered.

$ kubectl patch pvc data-typo -n lab -p '{"spec":{"storageClassName":"local-path"}}'
The PersistentVolumeClaim "data-typo" is invalid: spec: Forbidden: spec is immutable after creation except resources.requests and volumeAttributesClassName for bound claims

What it means

A PVC is a request for storage. It stays Pending until it is bound to a PersistentVolume. With dynamic provisioning, the provisioner named in the StorageClass creates that volume. Without one, a matching PersistentVolume must already exist.

The StorageClass volumeBindingMode decides when the volume is made. Immediate makes it as soon as the claim exists. WaitForFirstConsumer waits until a pod that uses the claim is scheduled, so the volume is made where the pod can run. A WaitForFirstConsumer claim with no pod is Pending on purpose. That is not a failure.

A Pending claim also holds its pod back. In our lab the pod on the claim with a missing StorageClass stayed Pending with pod has unbound immediate PersistentVolumeClaims. The local-path claim bound as soon as its pod was scheduled and that pod went to Running.

Common causes

The StorageClass does not exist

The claim names a StorageClass that is not in the cluster. Often it is a typo, or a class name copied from another cluster or cloud.

How to tell: ProvisioningFailed event: storageclass.storage.k8s.io "<name>" not found. The STORAGECLASS column shows a name that kubectl get storageclass does not list.

It is waiting for a pod (WaitForFirstConsumer)

The class uses WaitForFirstConsumer and no pod that uses the claim has been scheduled yet. Either no pod uses it, or that pod is stuck in Pending for its own reason.

How to tell: Event WaitForFirstConsumer: waiting for first consumer to be created before binding. If a pod exists but cannot be scheduled, the event is WaitForPodScheduled: waiting for pod <pod> to be scheduled.

The provisioner or CSI driver is not running

The provisioner named in the StorageClass is not installed, has crashed or has no permission to create disks. On EKS, gp2 and gp3 volumes need the EBS CSI driver and an IAM role for it.

How to tell: ExternalProvisioning event: Waiting for a volume to be created either by the external provisioner. No ProvisioningSucceeded or ProvisioningFailed event follows it.

The provisioner refused the request

The provisioner ran but could not make the volume. The access mode is not supported, the size is outside what the backend allows or the cloud quota is used up.

How to tell: ProvisioningFailed event with the provisioner's own message. In our lab a ReadWriteMany claim on local-path got NodePath only supports ReadWriteOnce and ReadWriteOncePod.

No StorageClass is set and there is no default

A claim with storageClassName set to an empty string only binds to a PersistentVolume made by hand. A claim with no storageClassName gets the default class. If there is no default, nothing provisions it.

How to tell: FailedBinding event: no persistent volumes available for this claim and no storage class is set.

No static PersistentVolume matches

With volumes made by hand, the claim only binds to one with enough capacity, the same access mode, the same class and a matching selector. A volume left Released by an old claim is not reused until its claimRef is cleared.

How to tell: kubectl get pv shows Available or Released volumes, but the claim stays Pending with FailedBinding events.

How to diagnose it

  1. kubectl get pvc -n <namespace>

    Find the Pending claims and read the STORAGECLASS column. An empty value means no class was set and no default was applied.

  2. kubectl describe pvc <pvc> -n <namespace>

    Read the Events. ProvisioningFailed, WaitForFirstConsumer, ExternalProvisioning and FailedBinding each point at a different cause above. Used By names the pod, if any.

  3. kubectl get storageclass

    Check that the class exists. Note its PROVISIONER, its VOLUMEBINDINGMODE and which class is marked (default).

  4. kubectl describe pod <pod> -n <namespace>

    For a WaitForFirstConsumer claim, read the pod's FailedScheduling message. The claim is waiting on the pod, so fix the pod's scheduling first.

  5. kubectl get pods -A -o wide | grep -i -E 'csi|provisioner'

    The provisioner or CSI controller pods should be Running. Missing pods mean the driver is not installed. Restarts mean it is failing.

  6. kubectl logs -n kube-system deploy/ebs-csi-controller -c csi-provisioner --since=30m

    This is the EBS CSI driver on EKS. Use your own driver's namespace and deployment. Look for permission or quota errors that match the claim.

  7. kubectl get pv

    For volumes made by hand, compare capacity, access modes and STORAGECLASS with the claim. A Released volume needs its claimRef removed before a new claim can bind.

How to fix it

Recreate the claim with the right StorageClass

storageClassName cannot be changed on an existing claim. In our lab kubectl patch was refused with spec is immutable after creation. Delete the claim and create it again with a class from kubectl get storageclass.

kubectl delete pvc <pvc> -n <namespace>
kubectl apply -f <pvc-with-correct-class>.yaml

Trade-off: A Pending claim has no volume, so deleting it loses no data. For a StatefulSet the claim comes from volumeClaimTemplates, which cannot be edited in place either. You have to recreate the StatefulSet with --cascade=orphan.

Install or fix the provisioner

Install the CSI driver the class names, such as the EBS CSI driver on EKS. Give it the cloud permissions it needs and check that its controller pods are Running.

Trade-off: A new driver is another component to upgrade and watch. Until it has the right permissions, claims move from no events to ProvisioningFailed, which can look like a new problem.

Get the consumer pod scheduled

For WaitForFirstConsumer, the claim binds once a pod that uses it is scheduled. Fix the pod's own FailedScheduling reason, such as a nodeSelector that no node matches.

Trade-off: Do not switch the class to Immediate just to make the claim bind early. The volume can then be made in a zone where the pod cannot run. The pod then fails with volume node affinity conflict.

Mark one StorageClass as the default

Claims with no storageClassName then get this class. Since Kubernetes 1.28, existing claims with no class set are also given the new default.

kubectl patch storageclass <class> -p '{"metadata":{"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'

Trade-off: Keep only one default. With more than one, Kubernetes uses the newest, which may not be the one you meant. A claim with storageClassName set to an empty string is never changed.

Ask for an access mode the class supports

Use ReadWriteOnce with block storage such as EBS or local-path. Use a file storage class, such as EFS or NFS, when several pods must write at once.

Trade-off: File storage is often slower and priced in a different way. The access mode cannot be changed on a claim, so moving data means a new claim and a copy.

How to stop it coming back

  • Check the storageClassName in each chart and manifest against kubectl get storageclass on every target cluster.
  • Keep exactly one default StorageClass per cluster.
  • Alert on claims that stay Pending, but leave out WaitForFirstConsumer claims that have no pod yet.
  • Watch the CSI driver's controller pods like any other critical workload.

How KubeGraf investigates it

Specialist agents pull the logs, events, metrics, workloads and recent deploys for the failing workload into one view. How KubeGraf handles Kubernetes incidents.

Frequently asked questions

Why is my PersistentVolumeClaim pending?

Nothing has made or matched a volume for it yet. The events from kubectl describe pvc name the reason, such as a missing StorageClass, a provisioner error or no default class.

What does waiting for first consumer to be created before binding mean?

The StorageClass uses the WaitForFirstConsumer binding mode. The volume is only made once a pod that uses the claim is scheduled. Until then Pending is normal.

How do I check which StorageClass a PVC uses?

kubectl get pvc shows it in the STORAGECLASS column. kubectl get storageclass lists the classes that exist and marks the default one.

Why is my PVC pending on EKS?

On EKS, dynamic EBS volumes need the EBS CSI driver. If the driver or its IAM permissions are missing, the claim stays Pending. Check that the ebs-csi-controller pods are running and read their logs.

Can I change the StorageClass of a PVC?

No. The class cannot be changed after the claim is created. Delete the Pending claim and create it again with the right class.

Last updated . Try KubeGraf Freemium.

Related

Kubernetes documentation