This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.5.4. Expanding persistent volume claims (PVCs) with a file system
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 involves expanding volume objects in the cloud provider, 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.
Prerequisites
-
The controlling
StorageClass
object must haveallowVolumeExpansion
set totrue
.
Procedure
Edit the PVC and request a new size by editing
spec.resources.requests
. For example, the following expands theebs
PVC to 8 Gi.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Updating
spec.resources.requests
to a larger amount will expand the PVC.
After the cloud provider object has finished resizing, the PVC is set to
FileSystemResizePending
. Check the condition by entering the following command:oc describe pvc <pvc_name>
$ oc describe pvc <pvc_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
When the cloud provider object has finished resizing, the
PersistentVolume
object reflects the newly requested size inPersistentVolume.Spec.Capacity
. At this point, you can create or recreate a new pod from the PVC to finish the file system resizing. Once the pod is running, the newly requested size is available and theFileSystemResizePending
condition is removed from the PVC.