K8S-VOL-002
kubernetes
config_error
ai_generated
true
错误:此卷源不支持卷扩展
Error: volume expansion is not supported for this volume source
ID: kubernetes/volume-expand-error-feature-gate
78%修复率
82%置信度
1证据数
2023-09-20首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| kubernetes 1.21 | active | — | — | — |
| kubernetes 1.22 | active | — | — | — |
| kubernetes 1.24 | active | — | — | — |
| kubernetes 1.26 | active | — | — | — |
根因分析
PersistentVolumeClaim 的存储类没有设置 'allowVolumeExpansion: true',或者 CSI 驱动程序不支持在线扩展。
English
The PersistentVolumeClaim's storage class does not have 'allowVolumeExpansion: true', or the CSI driver does not support online expansion.
官方文档
https://kubernetes.io/docs/concepts/storage/persistent-volumes/#expanding-persistent-volumes-claims解决方案
-
修补存储类以启用扩展:`kubectl patch storageclass <storage-class-name> -p '{"allowVolumeExpansion": true}'`。然后重试 PVC 大小调整。 -
如果 CSI 驱动程序不支持扩展,请迁移到支持扩展的其他存储类,或使用带有新 PVC 的 StatefulSet 并手动复制数据。
无效尝试
常见但无效的做法:
-
Manually edit the PVC spec to increase size without checking the storage class.
90% 失败
The controller will reject the request because the storage class does not allow expansion; the PVC will remain unchanged.
-
Delete and recreate the PVC with a larger size.
75% 失败
This destroys the existing data unless you have a backup, and it does not enable expansion for future use.