How to install Kubernetes Cluster on Azure Ubuntu Virtual Machine 20.04 LTS

9/7/2021

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
azure
azure-virtual-machine
kubernetes
ubuntu

2 Answers

9/13/2021

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
Source: StackOverflow

9/10/2021

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
Source: StackOverflow