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, 2019 in Kubernetes by shubham
• 7,340 points
5,218 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, 2019 by ajs3033
• 7,300 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, 2019 by Sirajul
• 59,230 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 2, 2019 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, 2019 in Kubernetes by Sirajul
• 59,230 points
2,731 views
+1 vote
1 answer

How to use a Volume to communicate between two Containers running in the same Kubernetes-Pod?

Create a Pod that runs two Containers Create a ...READ MORE

answered Jul 23, 2019 in Kubernetes by Sirajul
• 59,230 points
2,549 views
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,300 points
2,426 views
0 votes
1 answer

How to build a high availability cluster in Kubernetes?

Add nodes in a HA cluster in ...READ MORE

answered Jul 12, 2019 in Kubernetes by Sirajul
• 59,230 points
1,135 views
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, 2019 in Kubernetes by Sirajul
• 59,230 points
5,988 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

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

answered Jan 17, 2019 in Others by anonymous
15,326 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 12, 2019 in Kubernetes by Kalgi
• 52,360 points

reshown Apr 12, 2019 by Kalgi 6,942 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP