How to debug when Kubernetes nodes are in 'Not Ready' state
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
When managing a Kubernetes cluster, encountering nodes in a 'Not Ready' state can be quite a common challenge. Dealing effectively with this requires not only understanding the underlying causes but also knowing the appropriate steps for rectification. Below, we'll explore various reasons why your nodes might be in a 'Not Ready' state and the actions you can take to resolve such issues.
Understanding the 'Not Ready' State
Nodes in Kubernetes go into a 'Not Ready' state when they fail to meet certain conditions that affect their ability to run pods reliably. The Kubernetes node status comprises several conditions like Ready, DiskPressure, MemoryPressure, PIDPressure, and NetworkUnavailable. A node is marked as 'Not Ready' when it fails to satisfy the Ready condition.
Possible Causes
1. Network Issues
Symptom:
Nodes might not have network connectivity with the API server or face issues in the network overlay.
Solutions:
- Check the network connectivity using tools such as
pingorcurlto communicate with the API server. - Verify the status of network plugins like Weave, Calico, or Flannel by checking logs and service status.
2. Node Resource Pressure
Nodes may experience pressure on CPU, memory, or disk due to various workloads.
Solutions:
- Disk Pressure:
Use the commanddf -hto ensure sufficient disk space is available. Clean up unnecessary files/logs or increase disk space. - Memory Pressure:
Usetoporfree -mto check memory usage. Consider increasing node memory or optimizing workloads. - PID Pressure:
Check the number of processes usingps aux | wc -land increase allowable processes or optimize those running.
3. API Server Connection Issues
If the node cannot connect to the API server, it might be due to improper configuration or unreachable endpoints.
Solutions:
- Ensure the kubelet on the node has the correct endpoint and port.
- Validate using
kubectl logsfor errors related to kubelet communication.
4. Kubelet Issues
Sometimes, kubelet failures or crashes can affect node readiness.
Solutions:
- Restart kubelet using
systemctl restart kubeletorservice kubelet restart. - Check logs via
journalctl -u kubeletfor errors. - Ensure the kubelet configuration is correct.
5. Certificate Issues
Expired or improper certificates can cause authentication failures.
Solutions:
- Use
kubectl get nodesandkubectl describe node <node-name>to ensure certificates are up-to-date. - Renew certificates if required and restart services.
6. Docker/Container Runtime
The container runtime (e.g., Docker, containerd) might be malfunctioning or misconfigured.
Solutions:
- Restart the service using
systemctl restart dockerorservice docker restart. - Check logs for errors and rectify configurations or dependencies.
Key Commands for Diagnosis
Summary Table
| Issue | Symptoms | Solutions |
| Network Issues | Loss of connection to API | Check connectivity Validate network plugin |
| Resource Pressure | High CPU/Memory/Disk usage | Clean unnecessary files Optimize workloads |
| API Server Issues | Failure to communicate | Validate kubelet endpoint Check logs for errors |
| Kubelet Errors | Kubelet crashing/stopped | Restart kubelet Check logs for insight |
| Certificate Problems | Authentication failure | Verify certificates Renew if expired |
| Container Runtime Issues | Docker not running smoothly | Restart Docker Check Docker logs |
Advanced Debugging Tips
- Set node taints: Isolate nodes by setting taints to prevent new pod assignments, allowing you to remediate issues without impacting workloads.
- Use tools like
kubectl top: Gain insights into node and pod metrics, helping you identify resource-heavy components. - Enable and analyze audit logs: Deep dive into Kubernetes audit logs to identify suspicious or erroneous activities affecting node status.
- Consider node replacements: If persistent issues exist or the node hardware is faulty, replacing the node might be the best recourse.
- Cluster autoscaler considerations: Ensure configurations for the cluster autoscaler are also aligned to handle nodes moving to unsustainable states.
Understanding the reasons that contribute to a node being 'Not Ready' and taking systematic actions is vital for maintaining a robust and healthy Kubernetes cluster. By following the steps and solutions outlined above, you can quickly address and rectify node-related issues, thereby ensuring your cluster remains reliable and efficient.
Related reading
- How to define a service label for a kubernetes service running on GKE
- How to define external ip for kubernetes ingress
- How to delete a deployment / image in kubernetes
- How to delete a kubernetes cluster using kops without deleting EBS persistent volume that I used for my database?
- How to define custom exception class in Java, the easiest way?
- How to delete a file after checking whether it exists
- How to delete a label for a kubernetes pod
- How to delete a node label by command and api?

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.