Lesson 141 · Section 12: Troubleshooting
Lesson 141: Worker node failure: bringing a NotReady node back
What NotReady and Unknown really mean, how the kubelet reports a node's health, and how to find and fix the usual causes on the node itself: a stopped kubelet or container runtime, a broken kubelet config or kubeconfig, expired certificates, and resource pressure. · 22 min read · 3 min video
Official competencies this lesson covers
Narrated by the local narrator voice. Keys: Space plays and pauses, J and L step, C captions, F full screen.
Why nodes fail
A worker node is an ordinary Linux machine running two Kubernetes programs as system services: the container
runtime (containerd) and the kubelet. Neither of them is a Pod, so neither can be fixed with kubectl. When a
node goes wrong, the cluster can only tell you that something is wrong; finding what means logging in to the node
and looking at those services, their configuration files and the machine itself.
In the exam the faults are planted, so they are deliberate and findable: a stopped service, a path with a typo, a kubeconfig that points at the wrong port. The same few places, checked in the same order, find nearly all of them.
How a node reports its health
Parts:
- kubelet (on node01)
- API server (6443)
- Lease node01 (kube-node-lease)
- Node controller (in controller-mgr)
- Node node01 (Ready condition)
Connections:
- kubelet to API server: every 10s
- API server to Lease node01: renews
- Node controller to Lease node01: checks
- Node controller to Node node01: Unknown
The kubelet sends two kinds of heartbeat:
- It renews a Lease object named after the node in the
kube-node-leasenamespace, every 10 seconds. This is cheap and is the real "I am alive" signal. - It updates the Node's status (conditions, capacity, images) when something changes, and at least every five minutes.
The node controller inside kube-controller-manager watches the leases. If a node's lease is not renewed for 50
seconds (the --node-monitor-grace-period; older material says 40 seconds, the earlier default), it sets every condition to Unknown with the message Kubelet stopped
posting node status, and kubectl get nodes shows NotReady.
| Condition | Healthy | Not healthy means |
|---|---|---|
Ready | True | False: the kubelet reports a problem (runtime down, network plugin not ready). Unknown: no heartbeat |
MemoryPressure | False | Memory is below the eviction threshold; Pods are being evicted |
DiskPressure | False | Disk or image filesystem is nearly full; images and Pods are being removed |
PIDPressure | False | Too many processes on the node |
NetworkUnavailable | False | Set by some network plugins when the node's network is not configured |
kubectl get nodes
kubectl describe node node01 | sed -n '/Conditions:/,/Addresses:/p'
kubectl -n kube-node-lease get lease node01 -o jsonpath='{.spec.renewTime}' ; echo
Walk the node from the bottom
Parts:
- OS and disk (space, memory, swap)
- containerd (systemctl status)
- kubelet (systemctl status)
- config.yaml (/var/lib/kubelet)
- kubelet.conf (server, certs)
- CNI plugin (/etc/cni/net.d)
Connections:
- OS and disk to containerd: hosts
- containerd to kubelet: CRI socket
- kubelet to config.yaml: reads
- config.yaml to kubelet.conf: auth
- kubelet to CNI plugin: network ready?
Log in (ssh node01, then sudo -i if needed) and check each layer:
df -h / /var/lib/containerd /var/lib/kubelet # disk
free -m # memory, and swap
systemctl status containerd # runtime
systemctl status kubelet # kubelet
journalctl -u kubelet --no-pager | tail -n 30 # why it fails
crictl ps # can the runtime run containers?
| Layer | File or command | What breaks there |
|---|---|---|
| Container runtime | systemctl status containerd, /etc/containerd/config.toml | Service stopped; a config error; SystemdCgroup not matching the kubelet's cgroupDriver |
| kubelet service | systemctl status kubelet, /usr/lib/systemd/system/kubelet.service.d/10-kubeadm.conf | Stopped or disabled; a bad flag in the drop-in or in /var/lib/kubelet/kubeadm-flags.env |
| kubelet config | /var/lib/kubelet/config.yaml | clientCAFile pointing to a missing file, wrong cgroupDriver, wrong staticPodPath, a YAML error |
| kubelet kubeconfig | /etc/kubernetes/kubelet.conf | Wrong server: address or port, a missing or expired client certificate |
| Network plugin | /etc/cni/net.d/, the CNI DaemonSet Pod on this node | No config file: NetworkPluginNotReady; the CNI Pod crash looping |
| Machine | df, free, swapon --show | Full disk, memory pressure, swap turned on where the kubelet is not configured for it |
Under the hood · Where the kubelet's settings come from on a kubeadm node
The kubelet is started by systemd with flags assembled from several files:
/usr/lib/systemd/system/kubelet.service the unit: ExecStart=/usr/bin/kubelet
/usr/lib/systemd/system/kubelet.service.d/10-kubeadm.conf adds --kubeconfig, --config, $KUBELET_KUBEADM_ARGS
/var/lib/kubelet/kubeadm-flags.env KUBELET_KUBEADM_ARGS (for example the runtime endpoint)
/var/lib/kubelet/config.yaml the KubeletConfiguration: most settings live here
/etc/kubernetes/kubelet.conf kubeconfig: API server address and client certificate
/etc/kubernetes/bootstrap-kubelet.conf used only while joining
The path of the drop-in folder differs by distribution (/etc/systemd/system/kubelet.service.d/ on some).
systemctl cat kubelet prints the unit and every drop-in, with their paths, so you never have to remember. After
editing a unit or drop-in, run systemctl daemon-reload before systemctl restart kubelet; after editing
config.yaml or kubelet.conf, a restart is enough.
Using it
Example · The kubelet is stopped
ssh node01
systemctl status kubelet
Loaded: loaded (/usr/lib/systemd/system/kubelet.service; disabled; preset: enabled)
Active: inactive (dead) since Thu 2026-12-04 09:02:13 UTC; 6min ago
Stopped and disabled: it would not come back after a reboot either. Fix both:
systemctl enable --now kubelet
systemctl is-active kubelet && systemctl is-enabled kubelet
exit
kubectl get nodes -w # node01 becomes Ready within about 30 seconds
Example · The kubelet keeps restarting
Active: activating (auto-restart) (Result: exit-code) means the kubelet starts and dies at once. The journal holds the
reason, near the end:
journalctl -u kubelet --no-pager | grep -iE 'error|failed' | tail -n 3
"command failed" err="failed to construct kubelet dependencies: unable to load client CA file
/etc/kubernetes/pki/ca.crtx: open /etc/kubernetes/pki/ca.crtx: no such file or directory"
Find which file sets that path, and fix it:
grep -rn 'ca.crtx' /var/lib/kubelet/ /etc/kubernetes/kubelet.conf /usr/lib/systemd/system/kubelet.service.d/
sed -i 's#ca.crtx#ca.crt#' /var/lib/kubelet/config.yaml
systemctl restart kubelet
systemctl status kubelet | grep Active # active (running)
Example · The kubelet runs, but the node stays NotReady
The service is active (running), yet the node is NotReady with Unknown conditions. The kubelet is alive but
cannot report. The journal says why:
"Unable to register node with API server" err="Post \"https://192.168.56.10:6444/api/v1/nodes\": dial tcp
192.168.56.10:6444: connect: connection refused"
The API server listens on 6443. The address comes from the kubelet's kubeconfig:
grep server /etc/kubernetes/kubelet.conf
grep server /etc/kubernetes/admin.conf 2>/dev/null || ssh controlplane grep server /etc/kubernetes/admin.conf
sed -i 's#:6444#:6443#' /etc/kubernetes/kubelet.conf
systemctl restart kubelet
Example · An expired certificate
The journal shows x509: certificate has expired or is not yet valid or Unauthorized. Check the certificate the
kubelet uses as a client:
grep client-certificate /etc/kubernetes/kubelet.conf
openssl x509 -noout -enddate -in /var/lib/kubelet/pki/kubelet-client-current.pem
date
The kubelet normally rotates its own client certificate. If it expired anyway (the node was off for a long time, or
the clock is wrong), first check the clock (timedatectl). On a kubeadm control plane node, kubeadm certs check-expiration lists the control plane certificates and kubeadm certs renew renews them. A worker whose kubelet
credentials are beyond repair is usually rejoined: kubeadm reset on the node, then kubeadm token create --print-join-command on the control plane and the printed kubeadm join on the node.
Example · Disk pressure
kubectl describe node node01 | grep -E 'DiskPressure|Taints'
Taints: node.kubernetes.io/disk-pressure:NoSchedule
DiskPressure True KubeletHasDiskPressure kubelet has disk pressure
On the node, find what fills the disk, free it, and let the kubelet clear the condition by itself:
df -h /
du -xh --max-depth=2 /var | sort -h | tail -n 5
crictl rmi --prune # remove unused images
journalctl --vacuum-size=200M # shrink the system journal
The condition and the taint go away once free space is back above the kubelet's eviction threshold (by default
nodefs.available<10%, imagefs.available<15%).
What happens to the Pods of a failed node
Parts:
- kubelet stops (t = 0)
- Node Unknown (t = 50s)
- Taint added (unreachable)
- Pods evicted (t = 5m)
- Recreated (on other nodes)
Connections:
- kubelet stops to Node Unknown: no lease
- Node Unknown to Taint added: NoExecute
- Taint added to Pods evicted: 300s
- Pods evicted to Recreated: controllers
When a node goes Unknown, the node controller adds the taint node.kubernetes.io/unreachable:NoExecute (or
not-ready:NoExecute when the condition is False). Every Pod gets a default toleration of 300 seconds for those
taints, added by an admission plugin. So:
- For five minutes, nothing moves. The Pods are still listed on the node, as
Runningor laterTerminating. - After five minutes they are evicted. Pods owned by a ReplicaSet, StatefulSet or Job are recreated on other nodes. Bare Pods are not recreated. DaemonSet Pods tolerate the taint forever and stay.
- When the node returns, the kubelet cleans up the old containers.
Tricks
Common mistakes
- Starting without enabling.
systemctl start kubeletfixes it until the next reboot. Useenable --now. - Forgetting
daemon-reload. After changing a unit or drop-in file, systemd keeps the old version until you reload it. - Looking for the kubelet with kubectl. The kubelet is not a Pod. There is nothing about it in
kube-system. - Restarting the kubelet before reading the journal. The restart pushes the useful error further up the log, and sometimes hides a fault that appears only at startup. Read first.
- Fixing the control plane for a worker problem. If one node is
NotReadyand the others are fine, the control plane works. Stay on that node. - Expecting Pods to move at once. Evictions start after five minutes. A node fixed quickly keeps its Pods.
Recap
NotReadyis the Ready condition: Unknown means the kubelet is silent, False means it is complaining.- The kubelet renews a Lease every 10 seconds; 50 seconds without one makes the node Unknown.
- On the node: disk and memory,
systemctl status containerd,systemctl status kubelet,journalctl -u kubelet,/var/lib/kubelet/config.yaml,/etc/kubernetes/kubelet.conf, the CNI config. systemctl enable --now kubelet;daemon-reloadafter unit changes.- Pods of a dead node are evicted after five minutes; only controller-owned Pods are recreated.
Official docs
Quiz: check what you learned
5 questions on this lesson · about 3 min · instant feedback. Missed questions come back in your review queue.
Sign in to take the quiz and keep your score.
Practise: try it on a real cluster
2 hands-on labs for this lesson. You get goals, not steps: any solution that reaches them passes.
A cluster with three faults at once, one in a worker node, one in the control plane and one in cluster networking, picked at random for each session. Find them with the troubleshooting method, repair them, and ship a release through the repaired cluster.
Fix · Level 3 · challenge · target 40 min
Both workers of a kubeadm cluster went NotReady overnight, for different reasons. Walk each node from the bottom up with systemctl, journalctl and crictl, fix what you find, and make sure it survives a reboot.
Fix · Level 3 · challenge · target 25 min
Discussion
Learners ask and answer questions here. Sign in to read and join the discussion.