1

I’m working on to install the Kubernetes cluster on Azure Ubuntu Virtual Machine 20.04 LTS. For that I have followed below articles.

https://www.edureka.co/blog/install-kubernetes-on-ubuntu#InstallingKubeadmKubeletKubectl https://adamtheautomator.com/install-kubernetes-ubuntu/#Initializing_a_Kubernetes_Cluster

Whenever I execute this kubeadm init --apiserver-advertise-address=<ip-address-of-kmaster-vm> --pod-network-cidr=192.168.0.0/16 cmd for initializing a Kubernetes Cluster on Master node, then I’m getting the following error:

[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 127.0.0.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 127.0.0.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 127.0.0.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 127.0.0.1:10248: connect: connection refused.

So, can anyone help me out for installing the Kubernetes Cluster on Azure Ubuntu Virtual Machine.

Pradeep
  • 5,101
  • 14
  • 68
  • 140
  • Please check this and see https://dev.to/adudko/setting-up-a-single-master-kubernetes-cluster-on-azure-using-kubeadm-1cjn. Here is the reference thread to fix the kublet errors https://stackoverflow.com/questions/52119985/kubeadm-init-shows-kubelet-isnt-running-or-healthy – JayakrishnaGunnam-MT Sep 08 '21 at 03:27

2 Answers2

4

I have also faced this problem and solved this by changing the cgroup driver of docker to systemd

sudo vi /lib/systemd/system/docker.service

Then Modifiy the line as below

ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --exec-opt native.cgroupdriver=systemd

sudo systemctl daemon-reload
sudo systemctl restart docker
sudo systemctl restart kubelet
sudo systemctl status kubelet

If the kubelet status is active and running then you can apply the kubeadm join command and install kubernetes

shawon
  • 984
  • 7
  • 15
0

I have seen this error many times and to be honest, it can be caused by many different things.

What helped me was to dig a little deeper into the logs of some of the Kubernetes components.

To view the status of the kubelet: systemctl status kubelet
To view the logs of the kubelet: journalctl -exu kubelet

Sometimes the problem can be with the pods that the kubelet is trying to start.

These can be debugged with the crictl tool which talks directly to the container runtime.

CrowDev
  • 71
  • 5