# 错误：此卷源不支持卷扩展

- **ID:** `kubernetes/volume-expand-error-feature-gate`
- **领域:** kubernetes
- **类别:** config_error
- **错误码:** `K8S-VOL-002`
- **验证级别:** ai_generated
- **修复率:** 78%

## 根因

PersistentVolumeClaim 的存储类没有设置 'allowVolumeExpansion: true'，或者 CSI 驱动程序不支持在线扩展。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| kubernetes 1.21 | active | — | — |
| kubernetes 1.22 | active | — | — |
| kubernetes 1.24 | active | — | — |
| kubernetes 1.26 | active | — | — |

## 解决方案

1. ```
   修补存储类以启用扩展：`kubectl patch storageclass <storage-class-name> -p '{"allowVolumeExpansion": true}'`。然后重试 PVC 大小调整。
   ```
2. ```
   如果 CSI 驱动程序不支持扩展，请迁移到支持扩展的其他存储类，或使用带有新 PVC 的 StatefulSet 并手动复制数据。
   ```

## 无效尝试

- **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% 失败率)
- **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% 失败率)
