2022-03-03 11:44:45 +00:00
= SOP Add new capacity to the OCP4 ODF Storage Cluster
2022-03-02 15:54:52 +00:00
This SOP should be used in the following scenario:
- 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.
2022-03-03 11:44:45 +00:00
== Resources
2022-03-02 15:54:52 +00:00
- [1] https://access.redhat.com/solutions/4246261[How to add OpenShift 4 RHCOS worker nodes in UPI within the first 24 hours]
- [2] https://access.redhat.com/solutions/4799921[How to add OpenShift 4 RHCOS worker nodes to UPI after the first 24 hours]
- [3] https://docs.openshift.com/container-platform/4.8/post_installation_configuration/node-tasks.html[Adding RHCOS worker nodes]
- [4] https://access.redhat.com/documentation/en-us/red_hat_openshift_data_foundation/4.9[Openshift Data Foundation Product Notes]
2022-03-03 11:44:45 +00:00
== Steps
2022-04-04 22:22:56 +02:00
2022-03-02 15:54:52 +00:00
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.
2022-04-04 22:22:56 +02:00
+
2022-03-02 15:54:52 +00:00
----
[root@os-control01 ~][PROD-IAD2]# oc get localvolumediscovery --all-namespaces
NAMESPACE NAME AGE
openshift-local-storage auto-discover-devices 167d
----
2022-04-04 22:22:56 +02:00
+
2022-03-02 15:54:52 +00:00
There should really be only a single LocalVolumeDiscovery object called `auto-discover-devices` in the `openshift-local-storage` namespace/project.
2022-04-04 22:22:56 +02:00
+
2022-03-02 15:54:52 +00:00
Edit this object:
2022-04-04 22:22:56 +02:00
+
2022-03-02 15:54:52 +00:00
----
oc edit localvolumediscovery auto-discover-devices -n openshift-local-storage
----
2022-04-04 22:22:56 +02:00
+
2022-03-02 15:54:52 +00:00
Add the hostname for the new node to the list that is already there like:
2022-04-04 22:22:56 +02:00
+
2022-03-02 15:54:52 +00:00
----
...
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
...
----
2022-04-04 22:22:56 +02:00
+
2022-03-02 15:54:52 +00:00
Write and save the change.
3. From within the Openshift webconsole, or via cli search for all "LocalVolumeSet" objects.
2022-04-04 22:22:56 +02:00
+
2022-03-02 15:54:52 +00:00
There should really be only a single LocalVolumeSet object called `local-block` in the `openshift-local-storage` namespace/project.
2022-04-04 22:22:56 +02:00
+
2022-03-02 15:54:52 +00:00
Edit this object:
2022-04-04 22:22:56 +02:00
+
2022-03-02 15:54:52 +00:00
----
oc edit localvolumeset local-block -n openshift-local-storage
----
2022-04-04 22:22:56 +02:00
+
2022-03-02 15:54:52 +00:00
Add the hostname for the new node to the list that is already there like:
2022-04-04 22:22:56 +02:00
+
2022-03-02 15:54:52 +00:00
----
...
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
...
----
2022-04-04 22:22:56 +02:00
+
2022-03-02 15:54:52 +00:00
Write and save the change.
2022-04-07 18:56:41 +00:00
4. Add the `cluster.ocs.openshift.io/openshift-storage` label to the new node:
+
----
oc label no worker05.ocp.iad2.fedoraproject.org cluster.ocs.openshift.io/openshift-storage=''
----
5. 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.
2022-03-02 15:54:52 +00:00
.Note:
For best results, only perform this step once, and after all nodes have been added to the cluster.