Sub topic 8
Pending because a PersistentVolumeClaim is unbound
This chapter assumes you know how to read the Events section of kubectl describe and that you understand PersistentVolumeClaims (PVCs) and StorageClasses at a basic level. A PVC is a request for storage. The cluster must bind it to a PersistentVolume (PV) before a pod can use it.
How an unbound claim blocks a pod
The scheduler will not place a pod until every PVC it references can be bound. If a claim stays unbound, the pod stays Pending. The container never starts, so there are no logs to read. The evidence is in events.
Start with the pod's events:
kubectl describe pod web | grep -A 10 'Events:'A typical message is:
Warning FailedScheduling default-scheduler 0/3 nodes are available: pod has unbound immediate PersistentVolumeClaims.This message points at storage, not CPU or taints. Next, check the claim:
kubectl get pvc
kubectl describe pvc data
kubectl get storageclassA claim with STATUS of Pending is the problem. The events at the bottom of describe pvc usually say why.
Common causes
| PVC event or symptom | Likely cause | Fix |
|---|---|---|
| `no persistent volumes available for this claim and no storage class is set` | No default StorageClass and no `storageClassName` on the claim | Set `storageClassName`, or mark a default class |
| `storageclass ... not found` | Typo in the class name | Correct the name to match `kubectl get storageclass` |
| Provisioning errors such as `ProvisioningFailed` | The dynamic provisioner is broken, lacks permissions, or has hit a quota | Read the provisioner's error and fix the underlying issue |
| Static PV exists but is not used | The PV's capacity, access mode, or class does not match the claim | Align the claim and PV fields |
| `waiting for first consumer to be created before binding` | The class uses `volumeBindingMode: WaitForFirstConsumer` | Usually normal. Look for a different scheduling problem on the pod |
With WaitForFirstConsumer, the PVC deliberately stays Pending until the scheduler picks a node. This lets the volume be created in the same zone as the pod. If the pod cannot schedule for another reason, fix that reason and the claim will bind.
A claim that binds
This claim names its class explicitly, so it does not depend on a default:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: data
spec:
accessModes:
- ReadWriteOnce
storageClassName: standard
resources:
requests:
storage: 1GiExercise
A pod is Pending with the event "pod has unbound immediate PersistentVolumeClaims". kubectl get pvc shows the claim as Pending, and kubectl describe pvc says the storage class "fast" was not found. What do you check and change?
Show answer
Run kubectl get storageclass to see which classes exist. Then set storageClassName on the claim to an existing class, or create the missing "fast" class. Recreate the claim, since this field cannot be changed on an existing one. Once the claim binds, the pod can be scheduled.