-->

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

[[email protected] ~]# vim /etc/docker/daemon.json
{
  "exec-opts": ["native.cgroupdriver=systemd"]
}
[[email protected] ~]# systemctl restart docker
[[email protected] ~]# 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.


10 comments:

  1. From where you get this solution...it resolve my issue...thank you...

    ReplyDelete
  2. Thanks Ankit.. Really its helpful for me. Where you get this idea...!

    ReplyDelete
  3. thanks ankit bro...its helpful for me...

    ReplyDelete
  4. This solution resolved my issue. Thanks

    ReplyDelete
  5. This did not solve the problem for me. Both docker and Kubelet are set for systemd but the same error.

    ReplyDelete
  6. Hi,

    It worked, Thanks.

    If it doesnt work the use kubeadm=1.21.0-00 and kubelet=1.21.0-00 while installing.

    ReplyDelete