Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions modules/storage-expanding-add-volume-expansion.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,23 @@
[id="add-volume-expansion_{context}"]
= Enabling volume expansion support

Before you can expand persistent volumes, the `StorageClass` object must
have the `allowVolumeExpansion` field set to `true`.
[role="_abstract"]
Before you can expand persistent volumes, the `StorageClass` object must have the `allowVolumeExpansion` field set to `true`.
Comment thread
lpettyjo marked this conversation as resolved.

.Procedure

* Edit the `StorageClass` object and add the `allowVolumeExpansion` attribute by running the following command:
+
[source,terminal]
----
$ oc edit storageclass <storage_class_name> <1>
$ oc edit storageclass <storage_class_name>
----
<1> Specifies the name of the storage class.
+
The following example demonstrates adding this line at the bottom
of the storage class configuration.
Enter the name of storage class in `<storage_class_name>`.
+
The following example shows adding this line at the bottom of the storage class configuration.
+
.Example storage class YAML file with `allowVolumeExpansion` field set to `true`
[source,yaml]
----
apiVersion: storage.k8s.io/v1
Expand All @@ -31,7 +32,7 @@ kind: StorageClass
parameters:
type: gp2
reclaimPolicy: Delete
allowVolumeExpansion: true <1>
allowVolumeExpansion: true
----
<1> Setting this attribute to `true` allows PVCs to be
expanded after creation.
+
Comment thread
lpettyjo marked this conversation as resolved.
* `parameters.allowVolumeExpansion`: Setting this field to `true` allows persistent volume claims (PVCs) to be expanded after creation.
15 changes: 10 additions & 5 deletions modules/storage-expanding-csi-volumes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,30 @@
// * storage/expanding-persistent-volumes.adoc
//* microshift_storage/expanding-persistent-volumes-microshift.adoc


:_mod-docs-content-type: PROCEDURE
[id="expanding-csi-volumes_{context}"]
= Expanding CSI volumes

[role="_abstract"]
You can use the Container Storage Interface (CSI) to expand storage volumes after they have already been created.

Shrinking persistent volumes (PVs) is _not_ supported.

.Prerequisites

* The underlying CSI driver supports resize. See "CSI drivers supported by {product-title}" in the "Additional resources" section.
* The underlying CSI driver supports resize.
Comment thread
lpettyjo marked this conversation as resolved.
+
For information about which CSI drivers support resizing, see under the _Additional resources_ section "CSI drivers supported by {product-title}".

* Dynamic provisioning is used.

* The controlling `StorageClass` object has `allowVolumeExpansion` set to `true`. For more information, see "Enabling volume expansion support."
* The controlling `StorageClass` object has `allowVolumeExpansion` set to `true`.
+
For more information, see section _Enabling volume expansion support_.

.Procedure

. For the persistent volume claim (PVC), set `.spec.resources.requests.storage` to the desired new size.
* For the persistent volume claim (PVC), set `.spec.resources.requests.storage` to the desired new size.

. Watch the `status.conditions` field of the PVC to see if the resize has completed. {product-title} adds the `Resizing` condition to the PVC during expansion, which is removed after expansion completes.
.Verification
To confirm that the resize is finished, look at the `status.conditions` field of the PVC . {product-title} adds the `Resizing` condition to the PVC during expansion, which is removed after expansion completes.
Comment thread
lpettyjo marked this conversation as resolved.
29 changes: 20 additions & 9 deletions modules/storage-expanding-filesystem-pvc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,32 @@
[id="expanding-pvc-filesystem_{context}"]
= Expanding persistent volume claims (PVCs) with a file system

[role="_abstract"]
ifndef::microshift,openshift-rosa,openshift-rosa-hcp[]
Expanding PVCs based on volume types that need file system resizing, such as GCE, EBS, and Cinder, is a two-step process. First, expand the volume objects in the cloud provider. Second, expand the file system on the node.
Expanding PVCs based on volume types that need file system resizing, such as Google Cloud Platform (GCP) persistent disk (PD), AWS Elastic Block Storage (EBS), and Cinder, is a two-step process. First, expand the volume objects in the cloud provider. Second, expand the file system on the node.
endif::microshift,openshift-rosa,openshift-rosa-hcp[]

ifdef::microshift[]
Expanding PVCs based on volume types that need file system resizing, such as GCE Persistent Disk volumes (gcePD), AWS Elastic Block Store EBS (EBS), and Cinder, is a two-step process. First, expand the volume objects in the cloud provider. Second, expand the file system on the node.
Expanding PVCs based on volume types that need file system resizing, such as Google Cloud Platform (GCP) persistent disk (PD), AWS Elastic Block Store EBS (EBS), and Cinder, is a two-step process. First, expand the volume objects in the cloud provider. Second, expand the file system on the node.
Comment thread
lpettyjo marked this conversation as resolved.
endif::microshift[]

ifdef::openshift-rosa,openshift-rosa-hcp[]
Expanding PVCs based on volume types that need file system resizing, such as AWS Elastic Block Store EBS (EBS) is a two-step process. First, expand the volume objects in the cloud provider. Second, expand the file system on the node.
Expanding PVCs based on volume types that need file system resizing, such as AWS Elastic Block Store (EBS) is a two-step process. First, expand the volume objects in the cloud provider. Second, expand the file system on the node.
endif::openshift-rosa,openshift-rosa-hcp[]

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`.
* The controlling storage class has the `allowVolumeExpansion` field set to `true`.
+
For more information, see section _Enabling volume expansion support_.

.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:
* Edit the PVC and request a new size by editing `spec.resources.requests`. For example, the following expands the `ebs` PVC to 8 Gi:
+
.Example PVC YAML file
[source,yaml]
----
kind: PersistentVolumeClaim
Expand All @@ -41,16 +45,23 @@ spec:
- ReadWriteOnce
resources:
requests:
storage: 8Gi <1>
storage: 8Gi
----
[.small]
<1> Updating `spec.resources.requests` to a larger amount expands the PVC.
+
* `spec.resources.requests`: Updating this field to a larger amount expands the PVC.

. After the cloud provider object has finished resizing, the PVC is set to `FileSystemResizePending`. Check the condition by entering the following command:
.Verification
After the cloud provider object has finished resizing, the PVC is set to `FileSystemResizePending`.

* Check the condition by running 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.
.Next steps
Comment thread
lpettyjo marked this conversation as resolved.
When the cloud provider object has finished resizing, the `PersistentVolume` object reflects the newly requested size in `PersistentVolume.Spec.Capacity`.

You can now create or recreate a new pod from the PVC to finish the file system resizing. After the pod is running, the newly requested size is available and the `FileSystemResizePending` condition is removed from the PVC.
25 changes: 16 additions & 9 deletions modules/storage-expanding-flexvolume.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,42 @@
// * storage/expanding-persistent-volumes.adoc
//* microshift_storage/expanding-persistent-volumes-microshift.adoc


:_mod-docs-content-type: PROCEDURE
[id="expanding-flexvolume_{context}"]
= Expanding FlexVolume with a supported driver

When using FlexVolume to connect to your back-end storage system, you can expand persistent storage volumes after they have already been created. This is done by manually updating the persistent volume claim (PVC) in {product-title}.

FlexVolume allows expansion if the driver is set with `RequiresFSResize` to `true`. The FlexVolume can be expanded on pod restart.
[role="_abstract"]
When using FlexVolume to connect to your back-end storage system, you can expand persistent storage volumes after they have already been created. You do this by manually updating the persistent volume claim (PVC) in {product-title}.

Similar to other volume types, FlexVolume volumes can also be expanded when in use by a pod.

.Prerequisites

* The underlying volume driver supports resize.
* The driver is set with the `RequiresFSResize` capability to `true`.
* The underlying volume driver supports resize.
+
For information about which CSI drivers support resizing, see under the _Additional resources_ section "CSI drivers supported by {product-title}".

* The driver is set with the `RequiresFSResize` capability to `true`. The FlexVolume can then be expanded after restarting the pod.

* Dynamic provisioning is used.

* The controlling `StorageClass` object has `allowVolumeExpansion` set to `true`.
+
For more information, see section _Enabling volume expansion support_.

.Procedure

* To use resizing in the FlexVolume plugin, you must implement the `ExpandableVolumePlugin` interface using these methods:

`RequiresFSResize`::
** `RequiresFSResize`
+
If `true`, updates the capacity directly. If `false`, calls the `ExpandFS` method to finish the filesystem resize.

`ExpandFS`::
** `ExpandFS`
+
If `true`, calls `ExpandFS` to resize filesystem after physical volume expansion is done. The volume driver can also perform physical volume resize together with filesystem resize.

[IMPORTANT]
====
Because {product-title} does not support installation of FlexVolume plugins on control plane nodes, it does not support control-plane expansion of FlexVolume.
Because {product-title} does not support installation of FlexVolume plugins on control plane nodes, it does not support control plane expansion of FlexVolume.
====
2 changes: 1 addition & 1 deletion modules/storage-expanding-local-volumes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
// * storage/expanding-persistent-volumes.adoc
//* microshift_storage/expanding-persistent-volumes-microshift.adoc


:_mod-docs-content-type: PROCEDURE
[id="expanding-local-volumes_{context}"]
= Expanding local volumes

[role="_abstract"]
You can manually expand persistent volumes (PVs) and persistent volume claims (PVCs) created by using the local storage operator (LSO).
Comment thread
lpettyjo marked this conversation as resolved.

.Procedure
Expand Down
1 change: 1 addition & 0 deletions modules/storage-expanding-recovering-failure.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[id="expanding-recovering-from-failure_{context}"]
= Recovering from failure when expanding volumes

[role="_abstract"]
If a resize request fails or remains in a pending state, you can try again by entering a different resize value in `.spec.resources.requests.storage` for the persistent volume claim (PVC). The new value must be larger than the original volume size.

If you are still having issues, use the following procedure to recover.
Expand Down