Sub topic 11
Node conditions and node events
This chapter assumes you can run kubectl get and kubectl describe, and that you know Pod conditions from the earlier chapters. Nodes report status the same way Pods do. They have conditions, and the cluster records events about them.
What node conditions are
A Node's status.conditions list describes its health. The kubelet (the agent on each node) updates these conditions. The node lifecycle controller in the control plane also changes them when a node stops reporting.
| Condition | Healthy value | Meaning when unhealthy |
|---|---|---|
| Ready | True | The node is not healthy enough to run Pods. `Unknown` means the control plane has lost contact with the kubelet. |
| MemoryPressure | False | The node is low on memory. |
| DiskPressure | False | The node is low on disk space or inodes. |
| PIDPressure | False | The node has too many processes. |
| NetworkUnavailable | False | The node's network is not configured correctly. Some network plugins set this. |
Ready is the only condition where True is good. For the pressure conditions, True is a problem. Read each condition with its own meaning in mind, not as a general "True means fine" rule.
Listing node health
The get nodes command shows a short STATUS column. For a custom view of the Ready condition, use custom-columns:
kubectl get nodes -o custom-columns='NAME:.metadata.name,READY:.status.conditions[?(@.type=="Ready")].status'This prints each node's name and the status of its Ready condition. To see every condition on one node, use describe:
kubectl describe node worker-1The Conditions table in the output lists each type with its status, reason, and message. The Events section is at the bottom.
How a failing node affects Pods
When a node stops reporting, its Ready condition becomes Unknown. The control plane then adds taints to the node, which are markers that repel Pods. Typical taints are node.kubernetes.io/unreachable and node.kubernetes.io/not-ready. Pods that do not tolerate these taints are evicted after a grace period, which is 300 seconds by default.
When a node reports pressure, the kubelet adds taints such as node.kubernetes.io/memory-pressure. The kubelet may also evict Pods to reclaim resources. This is why a node problem often shows up first as Pod problems: evicted Pods, or Pods stuck in Pending with FailedScheduling events.
Node events
Node events use the same fields as Pod events: type, reason, message, and count. Filter them by object kind and name:
kubectl get events -A --field-selector involvedObject.kind=Node
kubectl events --for node/worker-1Common node event reasons include:
NodeNotReady: the Ready condition changed to False or Unknown.NodeReady: the node recovered.NodeHasDiskPressureandNodeHasInsufficientMemory: a pressure condition changed.EvictionThresholdMet: the kubelet crossed a resource threshold.Rebooted: the node restarted.
Node events live in the default namespace, because Nodes are not namespaced. Use -A or -n default to find them.
Checking a node problem step by step
- Run
kubectl get nodesand look for any node that is notReady. - Run
kubectl describe node <name>. Read the Conditions table, then Taints, then Events. - Run
kubectl get pods -A -o wide --field-selector spec.nodeName=<name>to see which Pods are affected. - If the node is
NotReadyand the kubelet does not report, you need access to the node itself. Check the kubelet service and its logs there. Events cannot tell you more than the control plane observed.
Common mistakes
- Reading
MemoryPressure=Trueas healthy. For pressure conditions,Falseis the healthy value. - Looking for node events in the wrong namespace. Use
-Aor-n default. - Expecting old events. Node events expire like other events, so a past outage may leave no record. The
lastTransitionTimeon each condition often still shows when the state last changed.
Exercise
A node shows Ready=Unknown, and Pods on it are being evicted. What does Unknown tell you, and which two places in kubectl describe node do you check next?
Show answer
Unknown means the control plane has stopped receiving status updates from the node's kubelet. It does not confirm that the node is down. Check the Taints list, to see which not-ready or unreachable taints were added, and the Events section, to see NodeNotReady and the time it occurred. The lastTransitionTime in the Conditions table also shows when the state changed.