kubernetes
storage_error
ai_generated
partial
PersistentVolumeClaim is stuck in Pending state
ID: kubernetes/persistent-volume-pending
80%Fix Rate
85%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 8 | active | — | — | — |
Root Cause
PVC can't find a matching PV. No StorageClass provisioner or no available storage.
genericWorkarounds
-
92% success Check if a default StorageClass exists: kubectl get storageclass
kubectl get storageclass
Sources: https://kubernetes.io/docs/concepts/storage/storage-classes/
-
88% success Create a StorageClass or set one as default if missing
kubectl patch storageclass <name> -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'Sources: https://kubernetes.io/docs/tasks/administer-cluster/change-default-storage-class/
-
80% success For local dev, use local-path provisioner or hostPath
# Install local-path provisioner (for development): kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml # Or use hostPath (single-node only): kind: PersistentVolume spec: hostPath: path: /tmp/data storageClassName: manualSources: https://kubernetes.io/docs/concepts/storage/volumes/#hostpath
Dead Ends
Common approaches that don't work:
-
Manually create a PV with exact specs
55% fail
Manual PVs don't scale and are hard to manage
-
Delete and recreate the PVC
70% fail
Won't help if the underlying issue is no StorageClass or no space
Error Chain
Frequently confused with: