Kubelet config yaml is missing when restart work node docker service

2/19/2020

When I restart the docker service in work node, the logs of kubelet in master node report a no such file error.

# in work node
# systemctl restart docker service

# in master node
# journalctl -u kubelet
# failed to load Kubelet config file /var/lib/kubelet/config.yaml, error failed to read kubelet config file "/var/lib/kubelet/config.yaml", error: open /var/lib/kubelet/config.yaml: no such file or directory
-- ccd
kubelet
kubernetes

2 Answers

2/19/2020

Arghya is right but I would like to add some info you should be aware of:

  1. You can execute kubeadm init phase kubelet-start to only invoke a particular step that will write the kubelet configuration file and environment file and then start the kubelet.

  2. After performing a restart there is a chance that swap would re-enable. Make sure to run swapoff -a in order to turn it off.

  3. If you encounter any token validation problems than simply run kubeadm token create --print-join-command and than do the join process with the provided info. Remember that tokens expire after 24 hours by default.

  4. If you wish to know more about kubeadm init phase you can find it here and here.

Please let me know if that helped.

-- OhHiMark
Source: StackOverflow

2/19/2020

You might have done kubeadm reset which cleans up all files.

Just do kubeadm reset --force to reset the node and then kubeadm init in master node and kubeadm join in woker node thereafter.

-- Arghya Sadhu
Source: StackOverflow