How to debug when Kubernetes nodes are in 'Not Ready' state

后端 未结 5 1977
青春惊慌失措
青春惊慌失措 2021-02-02 05:18

I initialized the master node and add 2 worker nodes, but only master and one of the worker node show up when I run the following command:

kubectl get nodes
         


        
5条回答
  •  时光取名叫无心
    2021-02-02 05:53

    Steps to debug:-

    In case you face any issue in kubernetes, first step is to check if kubernetes self applications are running fine or not.

    Command to check:- kubectl get pods -n kube-system

    If you see any pod is crashing, check it's logs

    if getting NotReady state error, verify network pod logs.

    if not able to resolve with above, follow below steps:-

    1. kubectl get nodes # Check which node is not in ready state

    2. kubectl describe node nodename #nodename which is not in readystate

    3. ssh to that node

    4. execute systemctl status kubelet # Make sure kubelet is running

    5. systemctl status docker # Make sure docker service is running

    6. journalctl -u kubelet # To Check logs in depth

    Most probably you will get to know about error here, After fixing it reset kubelet with below commands:-

    1. systemctl daemon-reload
    2. systemctl restart kubelet

    In case you still didn't get the root cause, check below things:-

    1. Make sure your node has enough space and memory. Check for /var directory space especially. command to check: -df -kh, free -m

    2. Verify cpu utilization with top command. and make sure any process is not taking an unexpected memory.

提交回复
热议问题