When exceptions occur on a node in a managed node pool, Container Service for Kubernetes (ACK) automatically repairs the node. This ensures that the nodes in an ACK cluster can run as normal. After you create a managed node pool or convert a regular node pool to a managed node pool, auto repair is automatically enabled for the nodes in the managed node pool. ACK monitors the status of nodes in managed node pools and runs different repair tasks to fix different node exceptions. This topic describes the use scenarios and procedure of auto repair.
Table of contents
- A managed node pool is created or a node pool is converted into a managed node pool. For more information, see Work with managed node pools.
- The Kubernetes event center is enabled. For more information, see Event monitoring.
Conditions to trigger auto repair
ACK determines whether to run auto repair tasks based on the status of nodes. To check the status of a node, run the
kubectl describe node command and check the value of the
condition field in the output. If a node remains in an abnormal state within a period of time that exceeds the threshold, ACK automatically runs repair tasks on the node.
The following table describes the trigger conditions.
|KubeletNotReady(KubeletHung)||The node enters the NotReady state because kubelet stops running.||High||180s|
|KubeletNotReady(PLEG)||The node enters the NotReady state because the Pod Lifecycle Event Generator (PLEG) module fails to pass health checks.||Medium||180s|
|KubeletNotReady(SandboxError)||Kubelet cannot be started because no sandboxed pod is found.||High||180s|
|RuntimeOffline||Docker or containerd stops running and the node is unavailable.||High||90s|
|NTPProblem||The time synchronization service (ntpd or chronyd) is in an abnormal state.||High||10s||Restart ntpd or chronyd.|
|SystemdOffline||Systemd is in an abnormal state and cannot launch or destroy containers.||High||90s||Restart the ECS instance.|
|ReadonlyFilesystem||The node file system becomes read-only.||High||90s||Restart the ECS instance.|
The auto repair feature includes the following phases: diagnose node exceptions, determine whether to trigger auto repair, and run auto repair tasks.
- Normal: The node runs without exceptions.
- Error: Exceptions occur on the node.
- Failed to Recover: The node fails to recover from the exceptions after the auto repair tasks are completed.
- If a node enters an abnormal state and remains in the abnormal state for a period of time that is longer than the threshold, ACK determines that the node is in the Error state.
- After a node is considered in the Error state, ACK runs specific auto repair tasks to fix the exceptions and generates events.
- If the node exceptions are fixed after the repair tasks are completed, the node changes to the Normal state.
- If the node exceptions persist after the repair tasks are completed, the node changes to the Failed to Recover state.
- If node exceptions occur in multiple node pools in a cluster, ACK runs auto repair tasks on the node pools in parallel.
- If exceptions occur on multiple nodes in a node pool, ACK runs auto repair tasks on the nodes in sequence. If ACK fails to repair one of the nodes, ACK stops running auto repair tasks on the remaining nodes.
- If ACK fails to repair a node, ACK disables auto repair for the node until the node recovers from the exception.
Auto repair events
|NodeRepairStart||Normal||The system starts to repair the node.|
|NodeRepairAction||Normal||The repair operation on the node, for example, restart kubelet.|
|NodeRepairSucceed||Normal||The node recovers from exceptions after the repair operation is completed.|
|NodeRepairFailed||Warning||The node fails to recover from exceptions after the repair operation is completed. |
For more information, see FAQ.
|NodeRepairIgnore||Normal||The repair operation is ignored on the node. If an ECS node is not in the Running state, the system does not perform auto repair operations on the node.|
What do I do if ACK fails to repair a node?
The auto repair feature may fail to fix complicated node exceptions in some scenarios. If an auto repair task fails on a node or the node exception persists after an auto repair task is completed, the node enters the Failed to Recover state.
If ACK fails to repair a node in a node pool, it disables auto repair for all nodes in the node pool until the node recovers from exceptions. In this case, you can Submit a ticket to request technical support to manually repair the node.
How do I disable auto repair for a node?