Expanding PVCs based on volume types that need file system resizing (such as GCE
PD, EBS, and Cinder) is a two-step process. This process usually involves
expanding volume objects in the CloudProvider, and then expanding the file
system on the actual node.
Expanding the file system on the node only happens when a new pod is started
with the volume.
The following process assumes that the PVC was previously created from a
StorageClass with allowVolumeExpansion
set to true
:
-
Edit the PVC and request a new size by editing spec.resources.requests
. Once
the CloudProvider object has finished resizing, the PVC is set to
FileSystemResizePending
.
-
Type the following command to check the condition:
oc describe pvc <pvc_name>
When the CloudProvider object has finished resizing, the persistent volume (PV)
object reflects the newly requested size in PersistentVolume.Spec.Capacity
. At
this point, you can create or re-create a new pod from the PVC to finish the
file system resizing. Once the pod is running, the newly requested size is
available and FileSystemResizePending
condition is removed from the PVC.