Hi, I have problems doing the CKA lab - CLUSTER INSTALLATION USING KUBEADM et . . .

Miguel Gonzalez:
Hi,

I have problems doing the CKA lab - CLUSTER INSTALLATION USING KUBEADM
eth0 IP:

[email protected]:~# ifconfig eth0 | grep inet
        inet 10.21.172.3  netmask 255.255.255.0  broadcast 10.21.172.255

kubelet version:

[email protected]:~# kubelet --version
Kubernetes v1.22.3

kubeadmin init command:

[email protected]:~# kubeadm init --apiserver-cert-extra-sans=controlplane --apiserver-advertise-address 10.21.172.3 --pod-network-cidr=10.244.0.0/16

This is the error:

[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.

Checked kubelet service:

[email protected]:~# systemctl status kubelet● kubelet.service - kubelet: The Kubernetes Node Agent
   Loaded: loaded (/lib/systemd/system/kubelet.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/kubelet.service.d
           └─10-kubeadm.conf
   Active: active (running) since Fri 2021-10-29 13:03:33 UTC; 5s ago
     Docs: <https://kubernetes.io/docs/home/>
 Main PID: 23619 (kubelet)
    Tasks: 20 (limit: 5529)
   CGroup: /system.slice/kubelet.service
           ├─23619 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --
           └─23638 systemd-run --description=Kubernetes systemd probe --scope true

Oct 29 13:03:33 controlplane kubelet[23619]: Flag --network-plugin has been deprecated, will be removed along with dockershim.
Oct 29 13:03:33 controlplane kubelet[23619]: Flag --network-plugin has been deprecated, will be removed along with dockershim.

but it’s the same issue after restarting the services… any idea?

Nitesh Panchal:
Did you check the journalctl logs for kubelet. Based on my experience it maybe that your cgroup driver on your docker is set to cgroupfs instead of systemd.

Nitesh Panchal:
you can do docker info and look for cgroup driver in there

Nitesh Panchal:
you can update it to systemd by creating a file called /etc/docker/daemon.json and add the following {"exec-opts": ["native.cgroupdriver=systemd"]} , reload daemon and restart docker.

tomk8slearn:
yeah. I just had the same issue.

tomk8slearn:

{
sed -i 's/cgroupfs/systemd/g' /etc/docker/daemon.json
systemctl daemon-reload
systemctl restart docker
systemctl restart kubelet
}

tomk8slearn:
just paste this on each of your nodes :slight_smile:

tomk8slearn:
it should have complained about the cgroup driver issue

  1. error logs from your kubeadm init
  2. kubelet logs journalctl -u kubelet

Miguel Gonzalez:
Thanks lads! I will do again the lab with your ideas

Miguel Gonzalez:
well… one of my problems… I didn’t read/skip this info: Use the exact version of 1.21.0-00 and installed the latest version :sweat_smile:

Miguel Gonzalez:
Installed:

[email protected]:~# sudo apt-get install -y kubelet=1.21.0-00 kubeadm=1.21.0-00  kubectl=1.21.0-00

Miguel Gonzalez:
version:

[email protected]:~# kubelet --version
Kubernetes v1.21.0

Miguel Gonzalez:
FYI - it worked with the version 1.21.0 without any problem

Miguel Gonzalez:
I will do again the lab but with the latest version and I will check your ideas