Kubernetes: How to resize a Persistent Volume?

0 votes

I'm trying to run a SQL deployment on kubernetes but the persistent volume I used is already full. I want to expand its storage but don't know how? The claim seems immutable. But I can create a new claim if there was any way I could resize the PV.

Jan 22 in Kubernetes by shubham
• 6,890 points
455 views

3 answers to this question.

0 votes

It is actually possible to do that in the newer versions of Kuberenetes. I think it started from v1.9 onwards.

Check: https://kubernetes.io/blog/2018/07/12/resizing-persistent-volumes-using-kubernetes/

For your PVC edit the PVC size using:

kubectl edit pvc <PVCname>

Now delete the pods associated with volume. The newly created pods will have access to the expanded storage.

answered Jan 22 by ajs3033
• 7,280 points
+1 vote

This feature is available in newer versions and is still under experimental stage.

Resizing an in-use PersistentVolumeClaim:

feature state: Kubernetes v1.15 (beta)

In this case, you don’t need to delete and recreate a Pod or deployment that is using an existing PVC. Any in-use PVC automatically becomes available to its Pod as soon as its file system has been expanded. This feature has no effect on PVCs that are not in use by a Pod or deployment. You must create a Pod which uses the PVC before the expansion can complete.

Similar to other volume types - FlexVolume volumes can also be expanded when in-use by a pod.

For more info refer to: https://kubernetes.io/docs/concepts/storage/persistent-volumes/

answered Aug 6 by Sirajul
• 38,420 points
+2 votes

That issue happened to me when I was working with PostgreSQL. New Kubernetes versions allow to resize your persistent volumes but it is not supported yet but all the cloud providers, assuming you are working with a managed kubernetes.

You can check how I solved it:

https://www.mendrugory.com/post/kubernetes-persistent-volumes/

answered Oct 1 by Gon
• 180 points

Related Questions In Kubernetes

0 votes
1 answer

Configure a Kubernetes-pod to use persistent volume for storage.

The output shows that the PersistentVolume has ...READ MORE

answered Jul 23 in Kubernetes by Sirajul
• 38,420 points
325 views
+1 vote
1 answer
0 votes
1 answer

How to use gravitational teleport in a container/kubernetes environment?

You can use teleport to augment kubernetes ...READ MORE

answered Jun 28, 2018 in Kubernetes by ajs3033
• 7,280 points
397 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Kubernetes: Can we use multiple claims out of a persistent volume?

The mapping between persistentVolume and persistentVolumeClaim is ...READ MORE

answered Jul 16 in Kubernetes by Sirajul
• 38,420 points
35 views
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17 in Others by anonymous
3,061 views
+3 votes
1 answer