-->

Friday, August 6, 2021

[Solved] kubelet isn't running or healthy.The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error

Description:-

So the issue came when i was setting up the kubernetes cluster on the AWS centos VM. Although these steps were followed every time, this particular time it resulted in the error below

[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take up to 4m0s
[kubelet-check] Initial timeout of 40s passed.
[kubelet-check] It seems like the kubelet isn't running or healthy.
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp [::1]:10248: connect: connection refused.
[kubelet-check] It seems like the kubelet isn't running or healthy.
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp [::1]:10248: connect: connection refused.

Issue:-

If you google this issue you will find the solution that this occurs because of the swap which was not the case with me and definately aws instance was not having the swap configured.

So in this particular case docker was using the groupfs which i changed to systemd and thats it volla it got resolved.

Create the file as

[root@k8smaster ~]# vim /etc/docker/daemon.json
{
  "exec-opts": ["native.cgroupdriver=systemd"]
}
[root@k8smaster ~]# systemctl restart docker
[root@k8smaster ~]# systemctl status docker

Thats it you problem should be resolved now and you can the kubeadm reset command followed by the kubeadm init command to reinitialise your kubernetes cluster which will work this time.


13 comments: