Pausing a MachineHealthCheck resource
During the update process, nodes in the cluster might become temporarily unavailable. For worker nodes, the MachineHealthCheck resources might identify such nodes as unhealthy and reboot them. To avoid rebooting worker nodes, you must pause all the MachineHealthCheck resources before updating the cluster.
|
|
Some |
-
You installed the OpenShift CLI (
oc).
-
List all of the available
MachineHealthCheckresources that you want to pause by running the following command:$ oc get machinehealthcheck -n openshift-machine-api -
For each
MachineHealthCheckresource, pause the machine health check by running the following command:$ oc -n openshift-machine-api annotate mhc <mhc_name> cluster.x-k8s.io/paused=""The annotated
MachineHealthCheckresource resembles the following YAML file:apiVersion: machine.openshift.io/v1beta1 kind: MachineHealthCheck metadata: name: example namespace: openshift-machine-api annotations: cluster.x-k8s.io/paused: "" spec: selector: matchLabels: role: worker unhealthyConditions: - type: "Ready" status: "Unknown" timeout: "300s" - type: "Ready" status: "False" timeout: "300s" maxUnhealthy: "40%" status: currentHealthy: 5 expectedMachines: 5Resume the machine health checks after updating the cluster. To resume the check, remove the pause annotation from the
MachineHealthCheckresource by running the following command:$ oc -n openshift-machine-api annotate mhc <mhc-name> cluster.x-k8s.io/paused-