StorageClassNotFound
KubernetesERRORNotableStorageHIGH confidence

StorageClass referenced in PVC does not exist

Production Risk

PVC will never be provisioned; stateful workloads are permanently unavailable without manual intervention.

What this means

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.

Why it happens
  1. 1storageClassName in the PVC refers to a StorageClass that was never created
  2. 2Workload migrated from a different cluster with a different set of StorageClasses
  3. 3Typo in the storageClassName field
  4. 4StorageClass was deleted after PVCs were created
How to reproduce

PVC is permanently Pending; events show StorageClass not found.

trigger — this will error
trigger — this will error
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

List available StorageClasses and update the PVC
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

Create the missing StorageClass
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.

Sources
Official documentation ↗

Kubernetes Documentation

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All Kubernetes errors