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
Arghya is right but I would like to add some info you should be aware of:
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.
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.
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.
If you wish to know more about kubeadm init phase
you can find it here and here.
Please let me know if that helped.
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.