如何允许 Kubernetes 存储类的物理卷声明 (PVC) 调整大小
调整 Kubernetes 物理卷声明大小的前提是你在 PVC 所属的存储类(此示例为 standard 存储类)中允许卷扩展。
我们可以通过为该存储类设置 allowVolumeExpansion: true 来允许此操作。
可以使用以下命令轻松地即时修补配置
kubectl-patch-storageclass.sh
kubectl patch storageclass/"standard" \
--namespace "default" \
--patch '{"allowVolumeExpansion": true}'记住你可能需要根据使用的存储类和命名空间进行调整。但是,对于任何标准配置,命名空间 default 和存储类 standard 将是你需要的。
Check out similar posts by category:
Kubernetes
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow