Increasing the capacity of your existing GlusterFS volume

You can increase the capacity of your existing GlusterFS volume.

Complete these steps:

  1. Set up the kubectl CLI. See Accessing your cluster from the Kubernetes CLI (kubectl).
  2. Ensure that the AllowVolumeExpansion parameter is set to True in the storage class definition.

    kubectl describe storageclass <storage-class-name>
    

    Following is an example command and output:

    # kubectl describe storageclass  glusterfs
    Name:                  glusterfs
    IsDefaultClass:        No
    Annotations:           storageclass.beta.kubernetes.io/is-default-class=false
    Provisioner:           kubernetes.io/glusterfs
    Parameters:            resturl=http://10.0.0.236:8080,restuser=admin,secretName=heketi-secret,secretNamespace=kube-system,volumenameprefix=icp,volumetype=replicate:3
    AllowVolumeExpansion:  True
    MountOptions:          <none>
    ReclaimPolicy:         Delete
    VolumeBindingMode:     Immediate
    Events:                <none>
    
  3. Get information about the persistent volume claims (PVCs).

    kubectl get pvc
    

    Following is a sample output:

    NAME           STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
    test-storage   Bound     pvc-f4a210f4-aa89-11e8-aed5-00000a290936   1Gi        RWO            glusterfs      1m
    
  4. Edit the PVC that is bound to the GlusterFS volume. Update the capacity as required and save the changes.

    kubectl edit pvc test-storage
    
  5. Get information about the updated PVC.

    kubectl get pvc
    

    The output resembles the following text:

    NAME           STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
    test-storage   Bound     pvc-f4a210f4-aa89-11e8-aed5-00000a290936   10Gi       RWO            glusterfs      2m
    

    The capacity of the volume is increased to 10 Gigabytes.