StorageClass referenced in PVC does not exist
Production Risk
PVC will never be provisioned; stateful workloads are permanently unavailable without manual intervention.
StorageClassNotFound occurs when a PersistentVolumeClaim specifies a storageClassName that does not exist as a StorageClass resource in the cluster. The PVC remains permanently Pending and will never be provisioned. This is a common error when migrating workloads between clusters with different storage configurations.
- 1storageClassName in the PVC refers to a StorageClass that was never created
- 2Workload migrated from a different cluster with a different set of StorageClasses
- 3Typo in the storageClassName field
- 4StorageClass was deleted after PVCs were created
PVC is permanently Pending; events show StorageClass not found.
kubectl describe pvc my-pvc | grep -A 5 "Events:" # Warning ProvisioningFailed persistentvolume-controller # storageclass.storage.k8s.io "fast-ssd" not found kubectl get storageclass
expected output
Warning ProvisioningFailed ... storageclass.storage.k8s.io "fast-ssd" not found
Fix 1
List available StorageClasses and update the PVC
WHEN PVC references a non-existent StorageClass
kubectl get storageclass # NAME PROVISIONER RECLAIMPOLICY AGE # standard (default) kubernetes.io/gce-pd Delete 10d # Delete and recreate PVC with correct storageClassName kubectl delete pvc my-pvc # Edit the PVC manifest to use an existing StorageClass kubectl apply -f pvc.yaml
Why this works
PVCs cannot be edited after creation for immutable fields; recreating with the correct StorageClass resolves the issue.
Fix 2
Create the missing StorageClass
WHEN The StorageClass should exist but was not deployed
apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: fast-ssd provisioner: kubernetes.io/gce-pd parameters: type: pd-ssd
Why this works
Creating the StorageClass object allows the provisioner to fulfil the PVC request.
Kubernetes Documentation
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev