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
322 views

2 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
0 votes

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
• 25,700 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
• 25,700 points
294 views
+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer
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
2,161 views
+3 votes
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
324 views
0 votes
1 answer