# persistentvolumeclaim is stuck in Pending state

- **ID:** `kubernetes/pvc-stuck-pending-no-storage-class`
- **Domain:** kubernetes
- **Category:** resource_error
- **Verification:** ai_generated
- **Fix Rate:** 82%

## Root Cause

The PersistentVolumeClaim cannot bind because the requested storage class does not exist, the provisioner is not deployed, or no matching PersistentVolume is available.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Kubernetes 1.28.x | active | — | — |
| Kubernetes 1.29.x | active | — | — |
| CSI drivers v1.30.x | active | — | — |

## Workarounds

1. **Check StorageClass existence: `kubectl get storageclass`. If the requested class (e.g., 'fast') is missing, create it: `kubectl apply -f - <<EOF
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: fast
provisioner: kubernetes.io/aws-ebs
parameters:
  type: gp3
EOF`** (85% success)
   ```
   Check StorageClass existence: `kubectl get storageclass`. If the requested class (e.g., 'fast') is missing, create it: `kubectl apply -f - <<EOF
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: fast
provisioner: kubernetes.io/aws-ebs
parameters:
  type: gp3
EOF`
   ```
2. **If using a CSI driver, verify the driver is deployed: `kubectl get csidrivers`. If missing, install the driver (e.g., EBS CSI driver: `kubectl apply -k "github.com/kubernetes-sigs/aws-ebs-csi-driver/deploy/kubernetes/overlays/stable/?ref=master"`).** (80% success)
   ```
   If using a CSI driver, verify the driver is deployed: `kubectl get csidrivers`. If missing, install the driver (e.g., EBS CSI driver: `kubectl apply -k "github.com/kubernetes-sigs/aws-ebs-csi-driver/deploy/kubernetes/overlays/stable/?ref=master"`).
   ```
3. **Describe the PVC for detailed events: `kubectl describe pvc <pvc-name> -n <namespace>`. Look for 'waiting for first consumer to be created before binding' which indicates dynamic provisioning is waiting for a pod. If so, create a pod that uses the PVC.** (90% success)
   ```
   Describe the PVC for detailed events: `kubectl describe pvc <pvc-name> -n <namespace>`. Look for 'waiting for first consumer to be created before binding' which indicates dynamic provisioning is waiting for a pod. If so, create a pod that uses the PVC.
   ```

## Dead Ends

- **Delete and recreate the PVC with the same spec.** — Recreating the same PVC without fixing the storage class or provisioner will result in the same Pending state. (85% fail)
- **Manually create a PersistentVolume without matching the PVC's storage class or size.** — A manually created PV must match the PVC's storage class, access modes, and size (or be larger) to bind. Mismatched PVs will remain unbound. (70% fail)
- **Set storageClassName to empty string to use default class without verifying existence.** — If no default StorageClass exists, the PVC will still be Pending. Use `kubectl get storageclass` to verify. (60% fail)
