# Error: volume expansion is not supported for this volume source

- **ID:** `kubernetes/volume-expand-error-feature-gate`
- **Domain:** kubernetes
- **Category:** config_error
- **Error Code:** `K8S-VOL-002`
- **Verification:** ai_generated
- **Fix Rate:** 78%

## Root Cause

The PersistentVolumeClaim's storage class does not have 'allowVolumeExpansion: true', or the CSI driver does not support online expansion.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| kubernetes 1.21 | active | — | — |
| kubernetes 1.22 | active | — | — |
| kubernetes 1.24 | active | — | — |
| kubernetes 1.26 | active | — | — |

## Workarounds

1. **Patch the storage class to enable expansion: `kubectl patch storageclass <storage-class-name> -p '{"allowVolumeExpansion": true}'`. Then retry the PVC resize.** (85% success)
   ```
   Patch the storage class to enable expansion: `kubectl patch storageclass <storage-class-name> -p '{"allowVolumeExpansion": true}'`. Then retry the PVC resize.
   ```
2. **If the CSI driver does not support expansion, migrate to a different storage class that supports it, or use a StatefulSet with a new PVC and copy data manually.** (70% success)
   ```
   If the CSI driver does not support expansion, migrate to a different storage class that supports it, or use a StatefulSet with a new PVC and copy data manually.
   ```

## Dead Ends

- **Manually edit the PVC spec to increase size without checking the storage class.** — The controller will reject the request because the storage class does not allow expansion; the PVC will remain unchanged. (90% fail)
- **Delete and recreate the PVC with a larger size.** — This destroys the existing data unless you have a backup, and it does not enable expansion for future use. (75% fail)
