Kubeadm init issue

Kubeadm init issue.

Config data versions:

os -rhel7.5
env -onprem server
docker - 19
kube - 18

Console output:

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

What goes wrong and how to resolve it?

Upvotes: 2

Views: 8161

Answers (1)

acid_fuji
acid_fuji

Reputation: 6853

Based on the information you provided there are couple of things that can be done here.

First you can check if docker`s native cgroupdriver and kubelet are consistent. You can view the config of the kubelet by running:

cat /var/lib/kubelet/kubeadm-flags.env 

To check docker config you can simply use:

docker info | grep Cgroup

If you need to change it you can do it like this:

cat << EOF > /etc/docker/daemon.json
{
  "exec-opts": ["native.cgroupdriver=systemd"]
}
EOF

To change kubelet cgroup driver you have to:

`vi /etc/systemd/system/kubelet.service.d/10-kubeadm.conf`

and update KUBELET_CGROUP_ARGS=--cgroup-driver=<systemd or cgroupfs>

Second possible solution could be disabling swap. You can do that with these commands:

sudo swapoff -a
sudo sed -i '/ swap / s/^/#/' /etc/fstab

Reboot a machine after that and then perform kubeadm reset and try to initialize the cluster with kubeadm init.

Upvotes: 5

Related Questions