持久卷可以调整大小吗? [英] Can a Persistent Volume be resized?

查看:99
本文介绍了持久卷可以调整大小吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在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:

  1. 编辑PVC(kubectl edit pvc $your_pvc)以指定新大小.要编辑的键是spec.resources.requests.storage:
  1. Edit the PVC (kubectl edit pvc $your_pvc) to specify the new size. The key to edit is spec.resources.requests.storage:

  1. 使用音量终止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.

这篇关于持久卷可以调整大小吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆