kubelet is not properly working on 1.22 version

0.TL; DR: Change docker cgroup driver from cgroupfs to systemd.

1.error during kubeadm init

If you met in k8s 1.22 version, you may consider to change docker driver.

kubeadm init .....
<snipped>
    m-k8s-1.22: [etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests"
    m-k8s-1.22: [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
    m-k8s-1.22: [kubelet-check] Initial timeout of 40s passed.
    m-k8s-1.22: [kubelet-check] It seems like the kubelet isn't running or healthy.
    m-k8s-1.22: [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.
    m-k8s-1.22: [kubelet-check] It seems like the kubelet isn't running or healthy.
    m-k8s-1.22: [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.
    m-k8s-1.22: [kubelet-check] It seems like the kubelet isn't running or healthy.
    m-k8s-1.22: [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.
    m-k8s-1.22: [kubelet-check] It seems like the kubelet isn't running or healthy.
    m-k8s-1.22: [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.
    m-k8s-1.22: [kubelet-check] It seems like the kubelet isn't running or healthy.
    m-k8s-1.22: [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.
    m-k8s-1.22:
    m-k8s-1.22:         Unfortunately, an error has occurred:
    m-k8s-1.22:                 timed out waiting for the condition
    m-k8s-1.22:
    m-k8s-1.22:         This error is likely caused by:
    m-k8s-1.22:                 - The kubelet is not running
    m-k8s-1.22:                 - The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled)
    m-k8s-1.22:
    m-k8s-1.22:         If you are on a systemd-powered system, you can try to troubleshoot the error with the following commands:
    m-k8s-1.22:                 - 'systemctl status kubelet'
    m-k8s-1.22:                 - 'journalctl -xeu kubelet'
    m-k8s-1.22:
    m-k8s-1.22:         Additionally, a control plane component may have crashed or exited when started by the container runtime.
    m-k8s-1.22:         To troubleshoot, list all containers using your preferred container runtimes CLI.
    m-k8s-1.22:
    m-k8s-1.22:         Here is one example how you may list all Kubernetes containers running in docker:
    m-k8s-1.22:                 - 'docker ps -a | grep kube | grep -v pause'
    m-k8s-1.22:                 Once you have found the failing container, you can inspect its logs with:
    m-k8s-1.22:                 - 'docker logs CONTAINERID'
    m-k8s-1.22: error execution phase wait-control-plane: couldn't initialize a Kubernetes cluster
    m-k8s-1.22: To see the stack trace of this error execute with --v=5 or higher
    m-k8s-1.22: The connection to the server 192.168.1.10:6443 was refused - did you

2.Check current config

3.Change your docker driver

4.Re-run kubeadm init with options

5. Check Current config (systemd is coming!!!)

It is not happened to issue all the times. Only limited environment.

Additional Info(Journal log):

Last updated

Was this helpful?