// Module included in the following assemblies:
//
// * edge_computing/day_2_core_cnf_clusters/upgrading/upgrade-completing-the-upgrade.adoc

:_mod-docs-content-type: PROCEDURE
[id="update-updating-the-worker-nodes_{context}"]
= Updating the worker nodes

[role="_abstract"]
You upgrade the worker nodes after you have updated the control plane by unpausing the relevant `mcp` groups you created.
Unpausing the `mcp` group starts the upgrade process for the worker nodes in that group.
Each of the worker nodes in the cluster reboot to upgrade to the new EUS, y-stream or z-stream version as required.

In the case of control plane only upgrades, note that when a worker node is updated it will only require one reboot and will jump <y+2>-release versions. This is a feature that was added to decrease the amount of time that it takes to upgrade large bare-metal clusters.

[IMPORTANT]
====
This is a potential holding point.
You can have a cluster version that is fully supported to run in production with the control plane that is updated to a new EUS release while the worker nodes are at a <y-2>-release. This allows large clusters to upgrade in steps across several maintenance windows.
====

.Procedure

. You can check how many nodes are managed in an `mcp` group.
Run the following command to get the list of `mcp` groups:
+
[source,terminal]
----
$ oc get mcp
----
+
.Example output
[source,terminal]
----
NAME     CONFIG                                             UPDATED   UPDATING   DEGRADED   MACHINECOUNT   READYMACHINECOUNT   UPDATEDMACHINECOUNT   DEGRADEDMACHINECOUNT   AGE
master   rendered-master-c9a52144456dbff9c9af9c5a37d1b614   True      False      False      3              3                   3                     0                      36d
mcp-1    rendered-mcp-1-07fe50b9ad51fae43ed212e84e1dcc8e    False     False      False      1              0                   0                     0                      47h
mcp-2    rendered-mcp-2-07fe50b9ad51fae43ed212e84e1dcc8e    False     False      False      1              0                   0                     0                      47h
worker   rendered-worker-f1ab7b9a768e1b0ac9290a18817f60f0   True      False      False      0              0                   0                     0                      36d
----
+
[NOTE]
====
You decide how many `mcp` groups to upgrade at a time.
This depends on how many pods can be taken down at a time and how your pod disruption budget and anti-affinity settings are configured.
====

. Get the list of nodes in the cluster:
+
[source,terminal]
----
$ oc get nodes
----
+
.Example output
[source,terminal]
----
NAME           STATUS   ROLES                  AGE    VERSION
ctrl-plane-0   Ready    control-plane,master   5d8h   v1.29.8+f10c92d
ctrl-plane-1   Ready    control-plane,master   5d8h   v1.29.8+f10c92d
ctrl-plane-2   Ready    control-plane,master   5d8h   v1.29.8+f10c92d
worker-0       Ready    mcp-1,worker           5d8h   v1.27.15+6147456
worker-1       Ready    mcp-2,worker           5d8h   v1.27.15+6147456
----

. Confirm the `MachineConfigPool` groups that are paused:
+
[source,terminal]
----
$ oc get mcp -o json | jq -r '["MCP","Paused"], ["---","------"], (.items[] | [(.metadata.name), (.spec.paused)]) | @tsv' | grep -v worker
----
+
.Example output
[source,terminal]
----
MCP     Paused
---     ------
master  false
mcp-1   true
mcp-2   true
----
+
[NOTE]
====
Each `MachineConfigPool` can be unpaused independently. Therefore, if a maintenance window runs out of time other MCPs do not need to be unpaused immediately. The cluster is supported to run with some worker nodes still at <y-2>-release version.
====

. Unpause the required `mcp` group to begin the upgrade:
+
[source,terminal]
----
$ oc patch mcp/mcp-1 --type merge --patch '{"spec":{"paused":false}}'
----
+
.Example output
[source,terminal]
----
machineconfigpool.machineconfiguration.openshift.io/mcp-1 patched
----

. Confirm that the required `mcp` group is unpaused:
+
[source,terminal]
----
$ oc get mcp -o json | jq -r '["MCP","Paused"], ["---","------"], (.items[] | [(.metadata.name), (.spec.paused)]) | @tsv' | grep -v worker
----
+
.Example output
[source,terminal]
----
MCP     Paused
---     ------
master  false
mcp-1   false
mcp-2   true
----

. As each `mcp` group is upgraded, continue to unpause and upgrade the remaining nodes.
+
[source,terminal]
----
$ oc get nodes
----
+
.Example output
[source,terminal]
----
NAME           STATUS                        ROLES                  AGE    VERSION
ctrl-plane-0   Ready                         control-plane,master   5d8h   v1.29.8+f10c92d
ctrl-plane-1   Ready                         control-plane,master   5d8h   v1.29.8+f10c92d
ctrl-plane-2   Ready                         control-plane,master   5d8h   v1.29.8+f10c92d
worker-0       Ready                         mcp-1,worker           5d8h   v1.29.8+f10c92d
worker-1       NotReady,SchedulingDisabled   mcp-2,worker           5d8h   v1.27.15+6147456
----
