问题描述
我正在Kubernetes上运行MySQL部署,但是似乎分配的空间还不够,最初我添加了一个持久卷50GB
,现在我想将其扩展到100GB
.
I'm running a MySQL deployment on Kubernetes however seems like my allocated space was not enough, initially I added a persistent volume of 50GB
and now I'd like to expand that to 100GB
.
我已经看到持久性卷声明在创建后是不可变的,但是我能以某种方式只是调整持久性卷的大小然后重新创建我的声明吗?
I already saw the a persistent volume claim is immutable after creation, but can I somehow just resize the persistent volume and then recreate my claim?
推荐答案
是的,从1.11开始,可以在某些云提供商上调整持久卷的大小.要增加音量,请执行以下操作:
Yes, as of 1.11, persistent volumes can be resized on certain cloud providers. To increase volume size:
- 编辑PVC(
kubectl edit pvc $your_pvc
)以指定新大小.要编辑的键是spec.resources.requests.storage
:
- Edit the PVC (
kubectl edit pvc $your_pvc
) to specify the new size. The key to edit isspec.resources.requests.storage
:
- 使用音量终止Pod.
使用该卷的Pod终止后,文件系统将扩展并且PV
的大小将增加.有关详细信息,请参见上面的链接.
Once the pod using the volume is terminated, the filesystem is expanded and the size of the PV
is increased. See the above link for details.
这篇关于持久卷可以调整大小吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!