SOP Add new capacity to the OCP4 ODF Storage Cluster

  • Red Hat OpenShift Container Platform 4.x cluster has been installed

  • Additional worker nodes are being added to increase the capacity for the cluster

  • These additional worker nodes have storage resources which we wish to add to the Openshift Datafoundation Storage Cluster

  • We are adding enough storage to meet the minimum of 3 replicas. eg: 3 nodes, or enough storage devices that the the number is divisble by 3.

Steps

  1. Once a new node has been added to the Openshift cluster, we can manage the extra local storage devices on this node from within Openshift itself, providing that they do not contain file paritions/filesystems. In the case of a node being repurposed, please first ensure that all storage devices except /dev/sda are partition and filesystem free before starting.

  2. From within the Openshift webconsole, or via cli search for all "LocalVolumeDiscovery" objects.

    [root@os-control01 ~][PROD-IAD2]# oc get localvolumediscovery --all-namespaces
    NAMESPACE                 NAME                    AGE
    openshift-local-storage   auto-discover-devices   167d

    There should really be only a single LocalVolumeDiscovery object called auto-discover-devices in the openshift-local-storage namespace/project.

    Edit this object:

    oc edit localvolumediscovery auto-discover-devices -n openshift-local-storage

    Add the hostname for the new node to the list that is already there like:

    ...
    spec:
      nodeSelector:
        nodeSelectorTerms:
        - matchExpressions:
          - key: kubernetes.io/hostname
            operator: In
            values:
            - worker01.ocp.iad2.fedoraproject.org
            - worker02.ocp.iad2.fedoraproject.org
            - worker03.ocp.iad2.fedoraproject.org
            - worker04.ocp.iad2.fedoraproject.org
            - worker05.ocp.iad2.fedoraproject.org
    ...

    Write and save the change.

  3. From within the Openshift webconsole, or via cli search for all "LocalVolumeSet" objects.

    There should really be only a single LocalVolumeSet object called local-block in the openshift-local-storage namespace/project.

    Edit this object:

    oc edit localvolumeset local-block -n openshift-local-storage

    Add the hostname for the new node to the list that is already there like:

    ...
    spec:
    ...
      nodeSelector:
        nodeSelectorTerms:
        - matchExpressions:
          - key: kubernetes.io/hostname
            operator: In
            values:
            - worker01.ocp.iad2.fedoraproject.org
            - worker02.ocp.iad2.fedoraproject.org
            - worker03.ocp.iad2.fedoraproject.org
            - worker04.ocp.iad2.fedoraproject.org
            - worker05.ocp.iad2.fedoraproject.org
    ...

    Write and save the change.

  4. From the Openshift Web console visit Storage, OpenShift Data Foundation, then in the Storage Systems sub menu, click the 3 dot menu on the right beside the ocs-storagecluster-storage object. Choose Add Capacity option. From the popup menu that appears, ensure that the storage class local-block is selected in the list. Finally confirm with add.

Note:

For best results, only perform this step once, and after all nodes have been added to the cluster.