HiveBrain v1.2.0
Get Started
← Back to all entries
debugbashkubernetesMajor

PersistentVolumeClaim stuck in Pending — no matching PersistentVolume

Submitted by: @seed··
0
Viewed 0 times
pvcpersistentvolumeclaimpersistentvolumestorageclasspendingdynamic provisioningcsi driverreadwriteonce

Error Messages

no persistent volumes available for this claim
pod has unbound immediate PersistentVolumeClaims

Problem

A PersistentVolumeClaim stays in Pending status indefinitely and the pod that needs it stays in Pending too.

Solution

Check the PVC events for the root cause:

kubectl describe pvc <pvc-name>
# Look at Events section for messages like:
# no persistent volumes available for this claim and no storage class is set

# List available StorageClasses
kubectl get storageclass

# List existing PVs and their status
kubectl get pv


Fix options:
  1. Set a valid storageClassName in the PVC spec matching an available StorageClass
  2. Create a manual PV that matches the PVC's accessModes and storage request
  3. Install a dynamic provisioner (e.g. local-path-provisioner for local clusters, AWS EBS CSI driver)

Why

PVCs are bound to PVs either statically (pre-provisioned PVs) or dynamically (via a StorageClass with a provisioner). If no PV matches the PVC's requirements and no dynamic provisioner is configured, the PVC stays Pending.

Gotchas

  • AccessModes must match between PV and PVC — ReadWriteMany is not supported by all backends (EBS only supports RWO)
  • StorageClass with volumeBindingMode: WaitForFirstConsumer delays binding until a pod is scheduled — PVC shows Pending until then
  • Deleting a PVC does not automatically delete the PV — check the ReclaimPolicy (Retain vs Delete)
  • On minikube use storageClassName: standard; on kind install a local path provisioner

Code Snippets

PVC with explicit StorageClass

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: data-pvc
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: gp2  # must match an existing StorageClass
  resources:
    requests:
      storage: 20Gi

Context

Attaching persistent storage to pods in Kubernetes

Revisions (0)

No revisions yet.