Vinit Patel
Vinit Patel

Reputation: 2464

After Reboot kubenetes master node is not in Ready state

I wondered when i restart my ubuntu machine on which i have setup kubernetes master with flannel. before reboot it's working fine. but after reboot master node is not in ready state.

I try to get node details using describe.

KubeletNotReady runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized

This error is printed in logs. i search about this and find some solutions like reinitialize flannel.yml but didn't work.

https://github.com/kubernetes/kubeadm/issues/1031 As per provided solution here, reinstall docker in machine. that's works. every thing works fine after reinstall docker on machine. Can any one explain me why this happend? as if i restart machine then every time i need to reinstall docker? or is there any other setting or configuration which i missing? Thank you

Upvotes: 0

Views: 562

Answers (1)

acid_fuji
acid_fuji

Reputation: 6853

Based on the provided information there are couple of steps and points to be taken into consideration when you encounter this kind of issue:

First check is to verify if file 10-flannel.conflist is not missing from /etc/cni/net.d/. You should have a file with this kind of information there:

{
 "name": "cbr0",
 "cniVersion": "0.3.1",
 "plugins": [
   {
     "type": "flannel",
     "delegate": {
       "hairpinMode": true,
       "isDefaultGateway": true
     }
   },
   {
     "type": "portmap",
     "capabilities": {
       "portMappings": true
     }

If your file is placed there please check if you specifically have cniVersion field there. In some flannel deployments there was missing the cniVersion field.

Second troubleshoot check is too check kubelet logs. Kubelet could report some problems with not finding cni config. You may find logs at: /var/log/kubelet.log

Also very useful is to check output of journalctl -fu kubelet and see if nothing wrong is happening there. In some cases restart kubelet might be helpful, you can do that using systemctl restart kubelet

If you suspect that the docker is causing a problem you can check docker logs in similar way you checked the kukubelet logs using journalctl -ul docker. If the docker is causing some issuse try to restart the docker service before reinstalling it using sudo systemctl restart docker.service

Finally it is really worth following exactly official documentation with creating kubeadm clusters, espcially the pod network section. Please note that it is important to hold all the binaries to prevent them from unwanted updates. Kubernetes has also a very good troubleshoot document regarding kubeadm.

Hope this helps.

Upvotes: 2

Related Questions