Enabling machine health checks on bare metal
You can enable machine health checks on bare metal to repair and replace unhealthy managed cluster nodes automatically. You must have additional agent machines that are ready to install in the managed cluster.
Consider the following limitations before enabling machine health checks:
-
You cannot modify the
MachineHealthCheckobject. -
Machine health checks replace nodes only when at least two nodes stay in the
FalseorUnknownstatus for more than 8 minutes.
After you enable machine health checks for the managed cluster nodes, the MachineHealthCheck object is created in your hosted cluster.
To enable machine health checks in your hosted cluster, modify the NodePool resource.
-
Verify that the
spec.nodeDrainTimeoutvalue in yourNodePoolresource is greater than0s. Replace<hosted_cluster_namespace>with the name of your hosted cluster namespace and<nodepool_name>with the node pool name. Run the following command:$ oc get nodepool -n <hosted_cluster_namespace> <nodepool_name> -o yaml | grep nodeDrainTimeoutExample outputnodeDrainTimeout: 30s -
If the
spec.nodeDrainTimeoutvalue is not greater than0s, modify the value by running the following command:$ oc patch nodepool -n <hosted_cluster_namespace> <nodepool_name> -p '{"spec":{"nodeDrainTimeout": "30m"}}' --type=merge -
Enable machine health checks by setting the
spec.management.autoRepairfield totruein theNodePoolresource. Run the following command:$ oc patch nodepool -n <hosted_cluster_namespace> <nodepool_name> -p '{"spec": {"management": {"autoRepair":true}}}' --type=merge -
Verify that the
NodePoolresource is updated with theautoRepair: truevalue by running the following command:$ oc get nodepool -n <hosted_cluster_namespace> <nodepool_name> -o yaml | grep autoRepair