1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/storage-expanding-filesystem-pvc.adoc
Steven Smith 858ec7700b 4
2022-12-15 20:24:36 +00:00

60 lines
1.8 KiB
Plaintext

// Module included in the following assemblies:
//
// * storage/expanding-persistent-volume.adoc
//* microshift_storage/expanding-persistent-volumes-microshift.adoc
:_content-type: PROCEDURE
[id="expanding-pvc-filesystem_{context}"]
= 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 have `allowVolumeExpansion` set
to `true`.
.Procedure
. Edit the PVC and request a new size by editing `spec.resources.requests`.
For example, the following expands the `ebs` PVC to 8 Gi.
+
[source,yaml]
----
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: ebs
spec:
storageClass: "storageClassWithFlagSet"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi <1>
----
<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:
+
[source,terminal]
----
$ oc describe pvc <pvc_name>
----
. When the cloud provider object has finished resizing, the
`PersistentVolume` object reflects the newly requested size in
`PersistentVolume.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 the
`FileSystemResizePending` condition is removed from the PVC.