Kubernetes persistent volume resize

3/3/2017

What would a be good approach to fix storage issues when your services run out of the presistent volume free space?

For example I have a gitlab service running on kubernetes installed with Helm Chart. I have used the default settings, but now I ran out of free space for gitlab. What would be the ideal approach to fix this issue?

  • Is there anyway I can increase the PV in size?
  • Should I somehow backup the gitlab data, recreate it with more storage?
  • Can I somehow backup and restore data from PV-s so there is no dataloss? I am open to any suggestion about how to deal with the issue when your PersistentVolume is getting full!

Thank you for your answers, Bence Pjatacsuk

-- Pjatacsuk Bence
gitlab
kubernetes

1 Answer

4/5/2017

Is there anyway I can increase the PV in size?

There is no official way to increase PV size in Kubernetes for now, actually I don't think this is Kubernetes' responsibility. Here's the related issue.

But you can increase it manually in two steps:

  1. Increase PV size in the backend storage, eg. resize GCE pd
  2. Change that PV size definition in Kubernetes cluster, eg. kubectl edit pv <pv_id>

As for data backup and restore, it depends on your backend storage. You can backup your PV (eg. create a snapshot) -> create a new one based on it -> and increase the size -> create a new pod with same definition but bind the larger size PV to it.

-- Crazykev
Source: StackOverflow