Can a Persistent Volume be resized?

google-kubernetes-engine, kubernetes

Solution

Yes, as of 1.11, persistent volumes can be resized on certain cloud providers. To increase volume size:

- Edit the PVC (`kubectl edit pvc $your_pvc`) to specify the new size. The key to edit is `spec.resources.requests.storage`:

- Terminate the pod using the volume.

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.

Problem

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?

Original source