Upgrade nodes to Windows Server 2022¶
You can upgrade your cluster to use Windows Server 2002 nodes in one of two ways. The approach that Mirantis recommends is to join nodes that have a fresh installation of Windows Server 2022, whereas the alternative is to perform an in-place upgrade of existing Windows Server 2019 nodes.
Approach #1 (Recommended): Join new Windows Server 2022 nodes¶
The preferred method for upgrading to Windows Server 2022 is to first add new nodes that are set to run the new operating system, and then remove the Windows Server 2019 nodes that the new nodes are meant to replace. You can do this by adding all of the new nodes prior to removing their original counterparts, or you can perform the operation one node at a time, as shown in the following procedure:
Join a new Windows Server 2022 node¶
Verify that the workloads you plan to run on the Windows Server 2022 nodes run on Windows Server 2022 images.
Apply a constraint or nodeSelector in order to run the required workloads on the Windows Server 2022 node:
Swarm:
Add the following constraint to your workloads:
"node.labels.OsVersion == 10.0.20348"
For more information, refer to Add or remove a service constraint using the MKE web UI.
Kubernetes:
Update your workload nodeSelector field to:
nodeSelector: kubernetes.io/os: windows node.kubernetes.io/windows-build: 10.0.20348
Verify that your workloads are running on the Windows Server 2022 node.
Remove an existing Windows Server 2019 node¶
Log in to the MKE web UI.
In the left-side navigation panel, navigate to Shared Resources > Nodes and select the required Window Server 2019 node.
In the upper right, select the Edit Node icon.
In the Availability section, click Drain.
Click Save to evict the workloads from the node.
In the upper right, select the vertical ellipsis and click Remove.
Click Confirm.
Note
If you are planning to run only Windows Server 2022 nodes, you can remove any added constraints or nodeSelectors. If, though, you plan to run a combination of Windows Server 2022 and Windows Server 2019 nodes, keep your constraints or nodeSelectors in place and add them to any future workloads. Refer to Operate a hybrid Windows cluster for more information.
Approach #2: Upgrade existing Windows Server nodes¶
While it is not recommended, you can upgrade to Windows Server 2022 by performing an in-place upgrade of the existing Windows Server 2019 nodes.
Upgrade existing Windows Server nodes¶
Log in to the MKE web UI.
In the left-side navigation panel, navigate to Shared Resources > Nodes and select the required Window Server 2019 node.
In the upper right, select the Edit Node icon.
In the Availability section, click Drain.
Click Save to evict the workloads from the node.
Upgrade the node from Windows Server 2019 to Windows Server 2022.
Windows full version nodes:
Connect to the node and use the Windows UI to perform the upgrade. For instructions, refer to Perform an in-place upgrade of Windows Server in the Microsoft documentation.
Windows core version nodes:
Mount the ISO for Windows Server 2022.
If you are using a physical server, insert a drive that has the Windows Server 2022 installation media installed. Otherwise, upload the ISO to the server and mount the image.
Note
Windows core version users can mount the ISO in PowerShell using
Mount-DiskImage -ImagePath "path"
.Navigate to the drive where the ISO is mounted and run
setup.exe
to launch the setup wizard.Follow the steps offered in the Microsoft documentation, Perform an in-place upgrade of Windows Server.
Once the upgrade completes, remove all the MKE images on the node and re-pull them. Docker will automatically pull the image versions that are built for Windows Server 2022.
Note
To obtain the list of required images, refer to Configure the Docker daemon for Windows nodes.
If
ucp-work-agent-win
is not running on the node, go to the following section, To troubleshoot the upgrade process.Return to the MKE web UI.
In the left-side navigation panel, navigate to Shared Resources > Nodes and select the required node.
In the upper right, select the Edit Node icon.
In the Availability section, click Active.
Click Save.
Troubleshoot the upgrade process¶
If
ucp-work-agent-win
is not running on the node, use Docker Swarm to rerun the service on the node:docker service update ucp-worker-agent-win-x
If
ucp-work-agent-win
is still not running on the node, it could be due operating system mismatches, which can occur after failing to update registry keys during the Windows upgrade process.Review the output of the following command, looking for references to Windows Server 2019 or build number
17763
:Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
Update any out-of-date registry keys:
Set-Itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\' -Name CurrentBuildNumber -value 20348
Return to the MKE web UI.
In the left-side navigation panel, navigate to Shared Resources > Nodes and select the required node.
In the upper right, select the Edit Node icon.
In the Availability section, click Active.
Click Save.