Este conteúdo não está disponível no idioma selecionado.
Chapter 5. Enabling Windows container workloads
Before adding Windows workloads to your cluster, you must install the Windows Machine Config Operator (WMCO), which is available in the OpenShift Container Platform OperatorHub. The WMCO orchestrates the process of deploying and managing Windows workloads on a cluster.
Dual NIC is not supported on WMCO-managed Windows instances.
5.1. Prerequisites Copiar o linkLink copiado para a área de transferência!
-
You have access to an OpenShift Container Platform cluster using an account with
cluster-adminpermissions. -
You have installed the OpenShift CLI (
oc). -
You have installed your cluster using installer-provisioned infrastructure, or using user-provisioned infrastructure with the
platform: nonefield set in yourinstall-config.yamlfile. - You have configured hybrid networking with OVN-Kubernetes for your cluster. For more information, see Configuring hybrid networking.
- You are running an OpenShift Container Platform cluster version 4.6.8 or later.
Windows instances deployed by the WMCO are configured with the containerd container runtime. Because WMCO installs and manages the runtime, it is recommended that you do not manually install containerd on nodes.
For the comprehensive prerequisites for the Windows Machine Config Operator, see "Windows Machine Config Operator prerequisites".
5.2. Installing the Windows Machine Config Operator Copiar o linkLink copiado para a área de transferência!
You can install the Windows Machine Config Operator using either the web console or OpenShift CLI (oc).
Due to a limitation within the Windows operating system, clusterNetwork CIDR addresses of class E, such as 240.0.0.0, are not compatible with Windows nodes.
5.2.1. Installing the Windows Machine Config Operator using the web console Copiar o linkLink copiado para a área de transferência!
You can use the OpenShift Container Platform web console to install the Windows Machine Config Operator (WMCO).
Dual NIC is not supported on WMCO-managed Windows instances.
Procedure
-
From the Administrator perspective in the OpenShift Container Platform web console, navigate to the Operators
OperatorHub page. -
Use the Filter by keyword box to search for
Windows Machine Config Operatorin the catalog. Click the Windows Machine Config Operator tile. - Review the information about the Operator and click Install.
On the Install Operator page:
- Select the stable channel as the Update Channel. The stable channel enables the latest stable release of the WMCO to be installed.
- The Installation Mode is preconfigured because the WMCO must be available in a single namespace only.
-
Choose the Installed Namespace for the WMCO. The default Operator recommended namespace is
openshift-windows-machine-config-operator. - Click the Enable Operator recommended cluster monitoring on the Namespace checkbox to enable cluster monitoring for the WMCO.
Select an Approval Strategy.
- The Automatic strategy allows Operator Lifecycle Manager (OLM) to automatically update the Operator when a new version is available.
- The Manual strategy requires a user with appropriate credentials to approve the Operator update.
Click Install. The WMCO is now listed on the Installed Operators page.
NoteThe WMCO is installed automatically into the namespace you defined, like
openshift-windows-machine-config-operator.- Verify that the Status shows Succeeded to confirm successful installation of the WMCO.
5.2.2. Installing the Windows Machine Config Operator using the CLI Copiar o linkLink copiado para a área de transferência!
You can use the OpenShift CLI (oc) to install the Windows Machine Config Operator (WMCO).
Dual NIC is not supported on WMCO-managed Windows instances.
Procedure
Create a namespace for the WMCO.
Create a
Namespaceobject YAML file for the WMCO. For example,wmco-namespace.yaml:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the namespace:
oc create -f <file-name>.yaml
$ oc create -f <file-name>.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
oc create -f wmco-namespace.yaml
$ oc create -f wmco-namespace.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Create the Operator group for the WMCO.
Create an
OperatorGroupobject YAML file. For example,wmco-og.yaml:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the Operator group:
oc create -f <file-name>.yaml
$ oc create -f <file-name>.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
oc create -f wmco-og.yaml
$ oc create -f wmco-og.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Subscribe the namespace to the WMCO.
Create a
Subscriptionobject YAML file. For example,wmco-sub.yaml:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify
stableas the channel. - 2
- Set an approval strategy. You can set
AutomaticorManual. - 3
- Specify the
redhat-operatorscatalog source, which contains thewindows-machine-config-operatorpackage manifests. If your OpenShift Container Platform is installed on a restricted network, also known as a disconnected cluster, specify the name of theCatalogSourceobject you created when you configured the Operator LifeCycle Manager (OLM). - 4
- Namespace of the catalog source. Use
openshift-marketplacefor the default OperatorHub catalog sources.
Create the subscription:
oc create -f <file-name>.yaml
$ oc create -f <file-name>.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
oc create -f wmco-sub.yaml
$ oc create -f wmco-sub.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow The WMCO is now installed to the
openshift-windows-machine-config-operator.
Verify the WMCO installation:
oc get csv -n openshift-windows-machine-config-operator
$ oc get csv -n openshift-windows-machine-config-operatorCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME DISPLAY VERSION REPLACES PHASE windows-machine-config-operator.2.0.0 Windows Machine Config Operator 2.0.0 Succeeded
NAME DISPLAY VERSION REPLACES PHASE windows-machine-config-operator.2.0.0 Windows Machine Config Operator 2.0.0 SucceededCopy to Clipboard Copied! Toggle word wrap Toggle overflow
5.3. Configuring a secret for the Windows Machine Config Operator Copiar o linkLink copiado para a área de transferência!
To run the Windows Machine Config Operator (WMCO), you must create a secret in the WMCO namespace containing a private key. This is required to allow the WMCO to communicate with the Windows virtual machine (VM).
Prerequisites
- You installed the Windows Machine Config Operator (WMCO) using Operator Lifecycle Manager (OLM).
You created a PEM-encoded file containing a private key by using a strong algorithm, such as ECDSA.
If you created the key pair on a Red Hat Enterprise Linux (RHEL) system, before you can use the public key on a Windows system, make sure the public key is saved using ASCII encoding. For example, the following PowerShell command copies a public key, encoding it for the ASCII character set:
echo "ssh-rsa <ssh_pub_key>" | Out-File <ssh_key_path> -Encoding ascii
C:\> echo "ssh-rsa <ssh_pub_key>" | Out-File <ssh_key_path> -Encoding asciiCopy to Clipboard Copied! Toggle word wrap Toggle overflow where:
<ssh_pub_key>- Specifies the SSH public key used to access the cluster.
<ssh_key_path>- Specifies the path to the SSH public key.
Procedure
Define the secret required to access the Windows VMs:
oc create secret generic cloud-private-key --from-file=private-key.pem=${HOME}/.ssh/<key> \ -n openshift-windows-machine-config-operator$ oc create secret generic cloud-private-key --from-file=private-key.pem=${HOME}/.ssh/<key> \ -n openshift-windows-machine-config-operator1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- 1
- You must create the private key in the WMCO namespace, like
openshift-windows-machine-config-operator.
It is recommended to use a different private key than the one used when installing the cluster.
5.4. Configuring debug-level logging for the Windows Machine Config Operator Copiar o linkLink copiado para a área de transferência!
By default, the Windows Machine Config Operator (WMCO) is configured to use the info log level. You can change the log level to debug by editing the WMCO Subscription object.
Procedure
Edit the
windows-machine-config-operatorsubscription in thewindows-machine-config-operatornamespace by using the following command:oc edit subscription windows-machine-config-operator -n openshift-windows-machine-config-operator
$ oc edit subscription windows-machine-config-operator -n openshift-windows-machine-config-operatorCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the follwing parameters to the
.spec.config.envstanza:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
You can revert to the default info log level by removing the name and value parameters that you added.
5.5. Using Windows containers in a proxy-enabled cluster Copiar o linkLink copiado para a área de transferência!
The Windows Machine Config Operator (WMCO) can consume and use a cluster-wide egress proxy configuration when making external requests outside the cluster’s internal network.
This allows you to add Windows nodes and run workloads in a proxy-enabled cluster, allowing your Windows nodes to pull images from registries that are secured behind your proxy server or to make requests to off-cluster services and services that use a custom public key infrastructure.
The cluster-wide proxy affects system components only, not user workloads.
In proxy-enabled clusters, the WMCO is aware of the NO_PROXY, HTTP_PROXY, and HTTPS_PROXY values that are set for the cluster. The WMCO periodically checks whether the proxy environment variables have changed. If there is a discrepancy, the WMCO reconciles and updates the proxy environment variables on the Windows instances.
Windows workloads created on Windows nodes in proxy-enabled clusters do not inherit proxy settings from the node by default, the same as with Linux nodes. Also, by default PowerShell sessions do not inherit proxy settings on Windows nodes in proxy-enabled clusters.
5.6. Using Windows containers with a mirror registry Copiar o linkLink copiado para a área de transferência!
The Windows Machine Config Operator (WMCO) can pull images from a registry mirror rather than from a public registry by using an ImageDigestMirrorSet (IDMS) or ImageTagMirrorSet (ITMS) object to configure your cluster to pull images from the mirror registry.
A mirror registry has the following benefits:
- Avoids public registry outages
- Speeds up node and pod creation
- Pulls images from behind your organization’s firewall
A mirror registry can also be used with a OpenShift Container Platform cluster in a disconnected, or air-gapped, network. A disconnected network is a restricted network without direct internet connectivity. Because the cluster does not have access to the internet, any external container images cannot be referenced.
Using a mirror registry requires the following general steps:
- Create the mirror registry, using a tool such as Red Hat Quay.
- Create a container image registry credentials file.
- Copy the images from your online image repository to your mirror registry.
For information about these steps, see "About disconnected installation mirroring."
After creating the mirror registry and mirroring the images, you can use an ImageDigestMirrorSet (IDMS) or ImageTagMirrorSet (ITMS) object to configure your cluster to pull images from the mirror registry without needing to update each of your pod specs. The IDMS and ITMS objects redirect requests to pull images from a repository on a source image registry and have it resolved by the mirror repository instead.
If changes are made to the IDMS or ITMS object, the WMCO automatically updates the appropriate hosts.toml file on your Windows nodes with the new information. Note that the WMCO sequentially updates each Windows node when mirror settings are changed. As such, the time required for these updates increases with the number of Windows nodes in the cluster.
Because Windows nodes configured by the WMCO rely on the containerd container runtime, the WMCO ensures that the containerd configuration files are up-to-date with the registry settings. For new nodes, these files are copied to the instances upon creation. For existing nodes, after activating the mirror registry, the registry controller uses SSH to access each node and copy the generated configuration files, replacing any existing files.
You can use a mirror registry with machine set or Bring-Your-Own-Host (BYOH) Windows nodes.
When using an IDMS or ITMS object to mirror container images on Windows nodes, take note of the following behaviors that differ from Linux nodes:
Mirroring on Windows nodes works on the registry level, rather than on the image level used by Linux nodes. As such, Windows images mirrored by using IDMS or ITMS objects have specific naming requirements.
The final portion of the namespace and the image name of the mirror image must match the image being mirrored. For example, when mirroring the
mcr.microsoft.com/oss/kubernetes/pause:3.9image, the mirror must be in the$mirrorRegistry/<organization>/oss/kubernetes/pause:3.9format, where$orgcan be any organization name or namespace or excluded entirely. Some valid values are$mirrorRegistry/oss/kubernetes/pause:3.9,$mirrorRegistry/custom/oss/kubernetes/pause:3.9, and$mirrorRegistry/x/y/z/oss/kubernetes/pause:3.9.A Windows node takes the ITMS object and uses it to configure registry-wide mirrors. In the following example, configuring
quay.io/remote-org/imageto mirror toquay.io/my-org/imageresults in the Windows node using that mirror for all images fromquay.io/remote-org. As such,quay.io/remote-org/image:taguses thequay.io/my-org/image:tagimage, as expected, but another container usingquay.io/remote-org/different-image:tagwould also try to use thequay.io/remote-org/different-image:tagmirror. This can cause unintended behavior if it is not accounted for.For this reason, specify container images using a digest by an IDMS object instead of an ITMS object. Using a digest can prevent the wrong container image from being used, by ensuring that the image the container specifies and the image being pulled have the same digest.
5.6.1. Understanding image registry repository mirroring Copiar o linkLink copiado para a área de transferência!
Setting up container registry repository mirroring enables you to perform the following tasks:
- Configure your OpenShift Container Platform cluster to redirect requests to pull images from a repository on a source image registry and have it resolved by a repository on a mirrored image registry.
- Identify multiple mirrored repositories for each target repository, to make sure that if one mirror is down, another can be used.
Repository mirroring in OpenShift Container Platform includes the following attributes:
- Image pulls are resilient to registry downtimes.
- Clusters in disconnected environments can pull images from critical locations, such as quay.io, and have registries behind a company firewall provide the requested images.
- A particular order of registries is tried when an image pull request is made, with the permanent registry typically being the last one tried.
-
The mirror information you enter is added to the appropriate
hosts.tomlcontainerd configuration file(s) on every Windows node in the OpenShift Container Platform cluster. - When a node makes a request for an image from the source repository, it tries each mirrored repository in turn until it finds the requested content. If all mirrors fail, the cluster tries the source repository. If successful, the image is pulled to the node.
Setting up repository mirroring can be done in the following ways:
At OpenShift Container Platform installation:
By pulling container images needed by OpenShift Container Platform and then bringing those images behind your company’s firewall, you can install OpenShift Container Platform into a data center that is in a disconnected environment.
After OpenShift Container Platform installation:
If you did not configure mirroring during OpenShift Container Platform installation, you can do so postinstallation by using any of the following custom resource (CR) objects:
-
ImageDigestMirrorSet(IDMS). This object allows you to pull images from a mirrored registry by using digest specifications. The IDMS CR enables you to set a fall back policy that allows or stops continued attempts to pull from the source registry if the image pull fails. -
ImageTagMirrorSet(ITMS). This object allows you to pull images from a mirrored registry by using image tags. The ITMS CR enables you to set a fall back policy that allows or stops continued attempts to pull from the source registry if the image pull fails.
-
Each of these custom resource objects identify the following information:
- The source of the container image repository you want to mirror.
- A separate entry for each mirror repository you want to offer the content requested from the source repository.
Note the following actions and how they affect node drain behavior:
- If you create an IDMS or ICSP CR object, the MCO does not drain or reboot the node.
- If you create an ITMS CR object, the MCO drains and reboots the node.
- If you delete an ITMS, IDMS, or ICSP CR object, the MCO drains and reboots the node.
If you modify an ITMS, IDMS, or ICSP CR object, the MCO drains and reboots the node.
ImportantWhen the MCO detects any of the following changes, it applies the update without draining or rebooting the node:
-
Changes to the SSH key in the
spec.config.passwd.users.sshAuthorizedKeysparameter of a machine config. -
Changes to the global pull secret or pull secret in the
openshift-confignamespace. -
Automatic rotation of the
/etc/kubernetes/kubelet-ca.crtcertificate authority (CA) by the Kubernetes API Server Operator.
-
Changes to the SSH key in the
When the MCO detects changes to the
/etc/containers/registries.conffile, such as editing anImageDigestMirrorSet,ImageTagMirrorSet, orImageContentSourcePolicyobject, it drains the corresponding nodes, applies the changes, and uncordons the nodes. The node drain does not happen for the following changes:-
The addition of a registry with the
pull-from-mirror = "digest-only"parameter set for each mirror. -
The addition of a mirror with the
pull-from-mirror = "digest-only"parameter set in a registry. -
The addition of items to the
unqualified-search-registrieslist.
-
The addition of a registry with the
The Windows Machine Config Operator (WMCO) watches for changes to the IDMS and ITMS resources and generates a set of hosts.toml containerd configuration files, one file for each source registry, with those changes. The WMCO then updates any existing Windows nodes to use the new registry configuration.
The IDMS and ITMS objects must be created before you can add Windows nodes using a mirrored registry.
5.6.2. Configuring image registry repository mirroring Copiar o linkLink copiado para a área de transferência!
You can create postinstallation mirror configuration custom resources (CR) to redirect image pull requests from a source image registry to a mirrored image registry.
Windows images mirrored through ImageDigestMirrorSet and ImageTagMirrorSet objects have specific naming requirements as described in "Using Windows containers with a mirror registry".
Prerequisites
-
Access to the cluster as a user with the
cluster-adminrole.
Procedure
Configure mirrored repositories, by either:
- Setting up a mirrored repository with Red Hat Quay, as described in Red Hat Quay Repository Mirroring. Using Red Hat Quay allows you to copy images from one repository to another and also automatically sync those repositories repeatedly over time.
Using a tool such as
skopeoto copy images manually from the source repository to the mirrored repository.For example, after installing the skopeo RPM package on a Red Hat Enterprise Linux (RHEL) 7 or RHEL 8 system, use the
skopeocommand as shown in this example:skopeo copy --all \ docker://registry.access.redhat.com/ubi9/ubi-minimal:latest@sha256:5cf... \ docker://example.io/example/ubi-minimal
$ skopeo copy --all \ docker://registry.access.redhat.com/ubi9/ubi-minimal:latest@sha256:5cf... \ docker://example.io/example/ubi-minimalCopy to Clipboard Copied! Toggle word wrap Toggle overflow In this example, you have a container image registry that is named
example.iowith an image repository namedexampleto which you want to copy theubi9/ubi-minimalimage fromregistry.access.redhat.com. After you create the mirrored registry, you can configure your OpenShift Container Platform cluster to redirect requests made of the source repository to the mirrored repository.
ImportantYou must mirror the
mcr.microsoft.com/oss/kubernetes/pause:3.9image. For example, you could use the followingskopeocommand to mirror the image:skopeo copy \ docker://mcr.microsoft.com/oss/kubernetes/pause:3.9\ docker://example.io/oss/kubernetes/pause:3.9
$ skopeo copy \ docker://mcr.microsoft.com/oss/kubernetes/pause:3.9\ docker://example.io/oss/kubernetes/pause:3.9Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Log in to your OpenShift Container Platform cluster.
Create an
ImageDigestMirrorSetorImageTagMirrorSetCR, as needed, replacing the source and mirrors with your own registry and repository pairs and images:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Indicates the API to use with this CR. This must be
config.openshift.io/v1. - 2
- Indicates the kind of object according to the pull type:
-
ImageDigestMirrorSet: Pulls a digest reference image. -
ImageTagMirrorSet: Pulls a tag reference image.
-
- 3
- Indicates the type of image pull method, either:
-
imageDigestMirrors: Use for anImageDigestMirrorSetCR. -
imageTagMirrors: Use for anImageTagMirrorSetCR.
-
- 4
- Indicates the name of the mirrored image registry and repository.
- 5
- Optional: Indicates a secondary mirror repository for each target repository. If one mirror is down, the target repository can use another mirror.
- 6
- Indicates the registry and repository source, which is the repository that is referred to in image pull specifications.
- 7
- Optional: Indicates the fallback policy if the image pull fails:
-
AllowContactingSource: Allows continued attempts to pull the image from the source repository. This is the default. -
NeverContactSource: Prevents continued attempts to pull the image from the source repository.
-
Create the new object:
oc create -f registryrepomirror.yaml
$ oc create -f registryrepomirror.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow To check that the mirrored configuration settings are applied, do the following on one of the nodes.
List your nodes:
oc get node
$ oc get nodeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the debugging process to access the node:
oc debug node/ip-10-0-147-35.ec2.internal
$ oc debug node/ip-10-0-147-35.ec2.internalCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Starting pod/ip-10-0-147-35ec2internal-debug ... To use host binaries, run `chroot /host`
Starting pod/ip-10-0-147-35ec2internal-debug ... To use host binaries, run `chroot /host`Copy to Clipboard Copied! Toggle word wrap Toggle overflow Change your root directory to
/host:chroot /host
sh-4.2# chroot /hostCopy to Clipboard Copied! Toggle word wrap Toggle overflow Check that the WMCO generated a
hosts.tomlfile for each registry on each Windows instance. For the previous example IDMS object, there should be three files in the following file structure:tree $config_path
$ tree $config_pathCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The following output represents a
hosts.tomlcontainerd configuration file where the previous example IDMS object was applied.Example host.toml files
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Pull an image to the node from the source and check if it is resolved by the mirror.
podman pull --log-level=debug registry.access.redhat.com/ubi9/ubi-minimal@sha256:5cf...
sh-4.2# podman pull --log-level=debug registry.access.redhat.com/ubi9/ubi-minimal@sha256:5cf...Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Troubleshooting repository mirroring
If the repository mirroring procedure does not work as described, use the following information about how repository mirroring works to help troubleshoot the problem.
- The first working mirror is used to supply the pulled image.
- The main registry is only used if no other mirror works.
-
From the system context, the
Insecureflags are used as fallback.
5.7. Rebooting a node gracefully Copiar o linkLink copiado para a área de transferência!
The Windows Machine Config Operator (WMCO) minimizes node reboots whenever possible. However, certain operations and updates require a reboot to ensure that changes are applied correctly and securely. To safely reboot your Windows nodes, use the graceful reboot process. For information on gracefully rebooting a standard OpenShift Container Platform node, see "Rebooting a node gracefully" in the Nodes documentation.
Before rebooting a node, it is recommended to backup etcd data to avoid any data loss on the node.
For single-node OpenShift clusters that require users to perform the oc login command rather than having the certificates in kubeconfig file to manage the cluster, the oc adm commands might not be available after cordoning and draining the node. This is because the openshift-oauth-apiserver pod is not running due to the cordon. You can use SSH to access the nodes as indicated in the following procedure.
In a single-node OpenShift cluster, pods cannot be rescheduled when cordoning and draining. However, doing so gives the pods, especially your workload pods, time to properly stop and release associated resources.
Procedure
To perform a graceful restart of a node:
Mark the node as unschedulable:
oc adm cordon <node1>
$ oc adm cordon <node1>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Drain the node to remove all the running pods:
oc adm drain <node1> --ignore-daemonsets --delete-emptydir-data --force
$ oc adm drain <node1> --ignore-daemonsets --delete-emptydir-data --forceCopy to Clipboard Copied! Toggle word wrap Toggle overflow You might receive errors that pods associated with custom pod disruption budgets (PDB) cannot be evicted.
Example error
error when evicting pods/"rails-postgresql-example-1-72v2w" -n "rails" (will retry after 5s): Cannot evict pod as it would violate the pod's disruption budget.
error when evicting pods/"rails-postgresql-example-1-72v2w" -n "rails" (will retry after 5s): Cannot evict pod as it would violate the pod's disruption budget.Copy to Clipboard Copied! Toggle word wrap Toggle overflow In this case, run the drain command again, adding the
disable-evictionflag, which bypasses the PDB checks:oc adm drain <node1> --ignore-daemonsets --delete-emptydir-data --force --disable-eviction
$ oc adm drain <node1> --ignore-daemonsets --delete-emptydir-data --force --disable-evictionCopy to Clipboard Copied! Toggle word wrap Toggle overflow SSH into the Windows node and enter PowerShell by running the following command:
powershell
C:\> powershellCopy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the node by running the following command:
Restart-Computer -Force
C:\> Restart-Computer -ForceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Windows nodes on Amazon Web Services (AWS) do not return to
READYstate after a graceful reboot due to an inconsistency with the EC2 instance metadata routes and the Host Network Service (HNS) networks.After the reboot, SSH into any Windows node on AWS and add the route by running the following command in a shell prompt:
route add 169.254.169.254 mask 255.255.255.0 <gateway_ip>
C:\> route add 169.254.169.254 mask 255.255.255.0 <gateway_ip>Copy to Clipboard Copied! Toggle word wrap Toggle overflow where:
169.254.169.254- Specifies the address of the EC2 instance metadata endpoint.
255.255.255.255- Specifies the network mask of the EC2 instance metadata endpoint.
<gateway_ip>Specifies the corresponding IP address of the gateway in the Windows instance, which you can find by running the following command:
ipconfig | findstr /C:"Default Gateway"
C:\> ipconfig | findstr /C:"Default Gateway"Copy to Clipboard Copied! Toggle word wrap Toggle overflow
After the reboot is complete, mark the node as schedulable by running the following command:
oc adm uncordon <node1>
$ oc adm uncordon <node1>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the node is ready:
oc get node <node1>
$ oc get node <node1>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME STATUS ROLES AGE VERSION <node1> Ready worker 6d22h v1.18.3+b0068a8
NAME STATUS ROLES AGE VERSION <node1> Ready worker 6d22h v1.18.3+b0068a8Copy to Clipboard Copied! Toggle word wrap Toggle overflow