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

今天遇到这个问题,查资料各种,有说是host文件的,检查,无误,curl -i http://localhost:10248/healthz,返回200,ok看着什么都正常
最后发现问题,端口!!!!!!!!!

kubeadm init --control-plane-endpoint="192.168.40.200:6444" --image-repository="k8s.gcr.io" --pod-network-cidr="10.244.0.0/16" --ignore-preflight-errors=Swap --kubernetes-version="v1.18.0" --upload-certs --v=6

–control-plane-endpoint参数,要么不加端口,要么加6443端口,否则都会报这个错
用yam文件的话,选项是controlPlaneEndpoint: "192.168.40.200:6443"或者ontrolPlaneEndpoint: “192.168.40.200”

kubeadm init --control-plane-endpoint="192.168.40.200:6443" --image-repository="k8s.gcr.io" --pod-network-cidr="10.244.0.0/16" --ignore-preflight-errors=Swap --kubernetes-version="v1.18.0" --upload-certs --v=6
kubeadm init --control-plane-endpoint="192.168.40.200" --image-repository="k8s.gcr.io" --pod-network-cidr="10.244.0.0/16" --ignore-preflight-errors=Swap --kubernetes-version="v1.18.0" --upload-certs --v=6

–control-plane-endpoint选项实际上影响到的是 /etc/kubernetes/admin.conf 文件中对外发布出来的server,如果你在–control-plane-endpoint参数中加修改了端口,没有使用–apiserver-bind-port选项指定成你修改端口,你必须使用nginx或者haproxy来代理你指定的端口到6443,或者是修改配置文件中的端口,否则将报错,检查不通过

我在部署k8s集群使用kubeadm初始化报报错,成功解决: Get "http://localhost:10248/healthz": dial tcp [::1]:10248: connect: connection refused. # Note: This dropin only works with kubeadm and kubelet v1.11+ [Service] Environment="KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.con 因为标题放不下完整的k8s初始化的错误信息,所以在文章内容中写一下完整的错误信息,可以给读者一个很好的错误信息对照参考 [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.. 初始化K8S master时报错 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. 问题分析: 之前我的Docker是用yum安装的,docker的cgroup驱动程序默认设置为systemd。默认情况 解决:k8s[kubelet-check] The HTTP call equal to ‘curl -sSL http://localhost:10248/healthzfailed with error: Get “http://localhost:10248/healthz”: dial tcp [::1]:10248: connect: connection refused 搭建k8s出现的问题记录 [kubelet-check] The HTTP call equal to ‘curl -sS 报错:[kubelet-check] The HTTP call equal to ‘curl -sSL http://localhost:10248/healthzfailed with error: Get “http://localhost:10248/healthz”: dial tcp [::1]:10248: connect: connection refused.原因:执行初始化安装命令 kubeadm init … 报错故障: [etcd] Creating static Pod man 报错信息:  初始化Kubernetes时出现下面报错 [root@k8s-master ~]# kubeadm init --kubernetes-version=v1.22.1 --apiserver-advertise-address=192.168.1.18 --image-repositor Failed to run kubelet" err="failed to run Kubelet: misconfiguration: kubelet cgroup driver: \"systemd\" is different from docker cgroup driver: \"cgroupfs\ The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: