Step 1: Verify Node Status from the Control Plane
Start by checking the status of all the nodes in the cluster. Run the following command on the control plane:node01 is in a NotReady state.
A quick look at the node status can help you identify which node is experiencing issues before diving into detailed troubleshooting.
Step 2: Examine Detailed Node Information
Investigate further by describing the details and events related to the problematic node:- Kubelet Version: v1.20.0
- PodCIDR: 10.244.1.0/24
Step 3: Check the Kubelet Service on node01
Next, SSH into the worker node to examine the status of the kubelet service:Step 4: Simulate the Next Failure and Investigate Further
After the initial fix, the cluster shows issues again withnode01 reverting to a NotReady state. Verify the node status:
Step 5: Correct the Kubelet Configuration
Examine the kubelet configuration file by executing:/etc/kubernetes/pki/ca.cert) and update the configuration accordingly.
After making the change, restart the kubelet service:
Always back up configuration files before making any changes.
Step 6: Fix the Incorrect Control Plane Port in kubelet.conf
Even after the configuration fix, ifnode01 goes NotReady again, inspect the logs on node01. You might see an error like:
Conclusion
When troubleshooting worker node failures in a Kubernetes cluster, follow these steps:- Check the node status using
kubectl get nodes. - SSH into the affected worker node and verify that the kubelet service is running.
- If the kubelet service fails, review the logs using
journalctl -u kubeletto identify any misconfigurations. - In this example, the issues included:
- An incorrect client CA file in
/var/lib/kubelet/config.yaml - An incorrect control plane port in
/etc/kubernetes/kubelet.conf
- An incorrect client CA file in
- Correct the misconfigurations and restart the kubelet service, then verify that the node status returns to Ready.