5.3. 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 OpenShift Container Platform.

FlexVolume allows expansion if the driver is set with RequiresFSResize to true. The FlexVolume can be expanded on pod restart.

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.
  • Dynamic provisioning is used.
  • The controlling StorageClass object has allowVolumeExpansion set to true.

Procedure

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

    RequiresFSResize
    If true, updates the capacity directly. If false, calls the ExpandFS method to finish the filesystem resize.
    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.
重要

Because OpenShift Container Platform does not support installation of FlexVolume plugins on master nodes, it does not support control-plane expansion of FlexVolume.