k8s初始化[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed wit

网友投稿 871 2022-09-12

k8s初始化[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed wit

报错:[kubelet-check] The HTTP call equal to 'curl -sSL failed with error: Get "dial tcp [::1]:10248: connect: connection refused.

原因:执行初始化安装命令 kubeadm init .........报错故障:[etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests"[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 failed with error: Get "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 failed with error: Get "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 failed with error: Get "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 failed with error: Get "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 failed with error: Get "dial tcp [::1]:10248: connect: connection refused.

解决方法:使用 journalctl -xeu kubelet 或者 journalctl -xeu kubelet -l 查看详细错误信息、

The start-up result is done.

Feb 11 10:59:17 k8s-master kubelet[65547]: Flag --network-plugin has been deprecated, will be removed along with dockershim.Feb 11 10:59:17 k8s-master kubelet[65547]: Flag --network-plugin has been deprecated, will be removed along with dockershim.Feb 11 10:59:17 k8s-master kubelet[65547]: I0211 10:59:17.518423 65547 server.go:440] "Kubelet version" kubeletVersion="v1.22.2"Feb 11 10:59:17 k8s-master kubelet[65547]: I0211 10:59:17.518855 65547 server.go:868] "Client rotation is on, will bootstrap in background"Feb 11 10:59:17 k8s-master kubelet[65547]: I0211 10:59:17.521199 65547 certificate_store.go:130] Loading cert/key pair from "/var/lib/kubelet/Feb 11 10:59:17 k8s-master kubelet[65547]: I0211 10:59:17.522816 65547 dynamic_cafile_content.go:155] "Starting controller" name="client-ca-buFeb 11 10:59:17 k8s-master kubelet[65547]: I0211 10:59:17.611796 65547 server.go:687] "--cgroups-per-qos enabled, but --cgroup-root was not spFeb 11 10:59:17 k8s-master kubelet[65547]: I0211 10:59:17.611991 65547 container_manager_linux.go:280] "Container manager verified user specifFeb 11 10:59:17 k8s-master kubelet[65547]: I0211 10:59:17.612052 65547 container_manager_linux.go:285] "Creating Container Manager object baseFeb 11 10:59:17 k8s-master kubelet[65547]: I0211 10:59:17.612075 65547 topology_manager.go:133] "Creating topology manager with policy per scoFeb 11 10:59:17 k8s-master kubelet[65547]: I0211 10:59:17.612086 65547 container_manager_linux.go:320] "Creating device plugin manager" deviceFeb 11 10:59:17 k8s-master kubelet[65547]: I0211 10:59:17.612108 65547 state_mem.go:36] "Initialized new in-memory state store"Feb 11 10:59:17 k8s-master kubelet[65547]: I0211 10:59:17.612151 65547 kubelet.go:314] "Using dockershim is deprecated, please consider using Feb 11 10:59:17 k8s-master kubelet[65547]: I0211 10:59:17.612172 65547 client.go:78] "Connecting to docker on the dockerEndpoint" endpoint="unFeb 11 10:59:17 k8s-master kubelet[65547]: I0211 10:59:17.612182 65547 client.go:97] "Start docker client with request timeout" timeout="2m0s"Feb 11 10:59:17 k8s-master kubelet[65547]: I0211 10:59:17.626698 65547 docker_service.go:566] "Hairpin mode is set but kubenet is not enabled,Feb 11 10:59:17 k8s-master kubelet[65547]: I0211 10:59:17.626721 65547 docker_service.go:242] "Hairpin mode is set" hairpinMode=hairpin-vethFeb 11 10:59:17 k8s-master kubelet[65547]: I0211 10:59:17.626799 65547 cni.go:239] "Unable to update cni config" err="no networks found in /etFeb 11 10:59:17 k8s-master kubelet[65547]: I0211 10:59:17.630708 65547 cni.go:239] "Unable to update cni config" err="no networks found in /etFeb 11 10:59:17 k8s-master kubelet[65547]: I0211 10:59:17.630800 65547 docker_service.go:257] "Docker cri networking managed by the network plFeb 11 10:59:17 k8s-master kubelet[65547]: I0211 10:59:17.630832 65547 cni.go:239] "Unable to update cni config" err="no networks found in /etFeb 11 10:59:17 k8s-master kubelet[65547]: I0211 10:59:17.644783 65547 docker_service.go:264] "Docker Info" dockerInfo=&{ID:H7RI:P37O:UH5W:VRQFeb 11 10:59:17 k8s-master kubelet[65547]: E0211 10:59:17.644814 65547 server.go:294] "Failed to run kubelet" err="failed to run Kubelet: misc

​根据上面报错查看到以下信息:

ID:H7RI:P37O:UH5W:VRQ:TDKT:D3MZ:YGJ4:3ZOU:7DDY:YYPQ:DPWM:ERFV Containers:0 ContainersRunning:0 ContainersPaused:0 Contain to run Kubelet: misconfiguration: kubelet cgroup driver: \"systemd\" is different from docker cgroup driver: \"cgroupfs\"

根据报错信息知道,是因为 k8s 和docker 的 cgroup driver 不一致导致的。k8s 的是 systemd ,而 docker 是cgroupfs。

可以通过docker info

[root@k8s-master ~]# docker info

Client:

Context:    default

Debug Mode: false

Plugins:

app: Docker App (Docker Inc., v0.9.1-beta3)

buildx: Docker Buildx (Docker Inc., v0.7.1-docker)

scan: Docker Scan (Docker Inc., v0.12.0)

Server:

Containers: 1

Running: 0

Paused: 0

Stopped: 1

Images: 7

Server Version: 20.10.12

Storage Driver: overlay2

Backing Filesystem: xfs

Supports d_type: true

Native Overlay Diff: true

userxattr: false

Logging Driver: json-file

Cgroup Driver: cgroupfs

解决方案;所有master跟node节点的docker修改为[root@k8s-master ~]# cat /etc/docker/daemon.json { "exec-opts": ["native.cgroupdriver=systemd"]}然后重启dockersystemctl restart docker重新执行kubeadm init命令就可以了

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:第三节多master二进制安装k8s
下一篇:k8s更新证书记录
相关文章

 发表评论

暂时没有评论,来抢沙发吧~