0
0
KubernetesDebug / FixBeginner · 4 min read

How to Fix Node Not Ready in Kubernetes Quickly

The Node Not Ready status in Kubernetes means the node is not healthy or unreachable. To fix it, check the node's kubelet service, network connectivity, and resource usage, then restart kubelet or fix the root cause. Use kubectl describe node [node-name] to find detailed errors.
🔍

Why This Happens

A Kubernetes node shows Not Ready when the node's health checks fail or it cannot communicate with the control plane. Common causes include the kubelet service crashing, network issues, or resource exhaustion like disk pressure.

bash
kubectl get nodes
NAME           STATUS     ROLES    AGE   VERSION
worker-node1   NotReady   <none>   10d   v1.26.0
Output
NAME STATUS ROLES AGE VERSION worker-node1 NotReady <none> 10d v1.26.0
🔧

The Fix

First, check the node details with kubectl describe node [node-name] to see error messages. Then, SSH into the node and check if the kubelet service is running. Restart it if needed. Also, verify network connectivity and disk space. Fix any resource pressure or network issues found.

bash
kubectl describe node worker-node1

# On the node
sudo systemctl status kubelet
sudo systemctl restart kubelet

# Check disk space
df -h

# Check network
ping -c 3 <control-plane-ip>
Output
● kubelet.service - kubelet: The Kubernetes Node Agent Loaded: loaded (/etc/systemd/system/kubelet.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2024-06-07 10:00:00 UTC; 5min ago NAME STATUS ROLES AGE VERSION worker-node1 Ready <none> 10d v1.26.0
🛡️

Prevention

Keep your nodes healthy by monitoring resource usage and network status regularly. Use automated alerts for disk pressure or kubelet failures. Ensure kubelet and Kubernetes versions are up to date. Use node auto-repair features if your cloud provider supports them.

⚠️

Related Errors

  • Node Not Ready due to Disk Pressure: Free up disk space or increase disk size.
  • Node Not Ready due to Network: Check firewall rules and network plugins.
  • Kubelet CrashLoop: Inspect kubelet logs with journalctl -u kubelet and fix config errors.

Key Takeaways

Check node status with kubectl and describe to find error details.
Restart kubelet service on the node to recover from transient issues.
Monitor disk space and network connectivity to prevent node failures.
Keep Kubernetes and kubelet versions updated for stability.
Use cloud provider node auto-repair features when available.