how to resize pvc on kubernetes when i used storageclass

4/9/2019

I changed the size of pvc.

According to the documents on the Internet, I went through the following steps. I first added the following command line to the storageclass file.

allowVolumeExpansion: true

After changing the size with the following command ,I removed the pod to be made again with pvc. But at the end of the steps, the amount of pvc does not change.

kind: PersistentVolumeClaim apiVersion: v1 metadata: name: pvc-fp spec: accessModes: - ReadWriteOnce volumeMode: Filesystem resources: requests: storage: 2Gi storageClassName: rook-ceph-blockp

The output of these commands should be resized in pvc. While not changing.

-- parisa
kubernetes-pvc
persistent-volumes
storage

1 Answer

4/20/2019
  1. What is the version of your Kubernetes cluster ? PVC resize feature is by default enabled only for k8s version 1.11 and above. For prior versions of k8s, ExpandPersistentVolumes feature and PersistentVolumeClaimResize admission controller needs to be enabled explicitly.
  2. What is backend storage provider ? Does it supports volume resize with PVC ? As of now bellow providers support PVC resize:
AWS-EBS, GCE-PD, Azure Disk, Azure File, Glusterfs, Cinder, Portworx, and Ceph RBD

You can find more information at https://kubernetes.io/blog/2018/07/12/resizing-persistent-volumes-using-kubernetes/

-- vinayakshnd
Source: StackOverflow