Interview Prep/Kubernetes/Storage and volumes

A PVC is `Pending` with `no persistent volumes available for this claim and no storage class is set`.

BeginnerTroubleshootingStorage and volumes
Answer

Likely causes → The PVC has no storageClassName and the cluster has no default StorageClass, so it waits for a manually created PV that never comes.

Diagnose →

kubectl get storageclass          # look for "(default)"
kubectl get pvc data -o jsonpath='{.spec.storageClassName}{"\n"}'

Fix → Mark a class as default, or set storageClassName on the PVC:

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

Existing Pending PVCs without a class get the default retroactively on recent versions; otherwise recreate them.

Prevent → Exactly one default StorageClass, created at cluster bootstrap.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Storage and volumes