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

背景:
搭建k8s高可用集群,由于自己瞎操作,在初始化master(master-1)时操作失败,于是又换了一个master(master-2)进行初始化,但是又由于其他问题导致失败,于是又换了一台master(master-3)进行初始化,终于成功。于是将前两台的master加入进来,出现以下报错:

[root@kube-master-2 ~]#  kubeadm join 192.168.186.100:6444 --token abcdef.0123456789abcdef     --discovery-token-ca-cert-hash sha256:96d22a2b958829a6c3039cc4c6f18a2fc8a508486dd9c1d9977d0ccca3b4eb95     --control-plane --certificate-key d8e791cb9b567cec3c2a6cb2f8a1ce197cf108fdfee3e6c8945eb20ebdbc8930
--snip--
[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.
^C

大概的原因应该是由于之前操作初始化的时候导致了环境不干净,造成后面加入集群时出现了问题。

解决:
[root@kube-master-2 ~]# kubeadm reset
[root@kube-master-2 ~]# rm -rf /etc/cni/net.d
[root@kube-master-2 ~]# rm -rf $HOME/.kube/config
[root@kube-master-2 ~]# rm -rf /etc/kubernetes/
然后再次执行加入集群命令

[root@kube-master-1 ~]# kubeadm join 192.168.186.100:6444 --token abcdef.0123456789abcdef     --discovery-token-ca-cert-hash sha256:96d22a2b958829a6c3039cc4c6f18a2fc8a508486dd9c1d9977d0ccca3b4eb95     --control-plane --certificate-key d8e791cb9b567cec3c2a6cb2f8a1ce197cf108fdfee3e6c8945eb20ebdbc8930
[preflight] Running pre-flight checks
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
[preflight] Running pre-flight checks before initializing the new control plane instance
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
[download-certs] Downloading the certificates in Secret "kubeadm-certs" in the "kube-system" Namespace
error execution phase control-plane-prepare/download-certs: error downloading certs: error downloading the secret: Secret "kubeadm-certs" was not found in the "kube-system" Namespace. This Secret might have expired. Please, run `kubeadm init phase upload-certs --upload-certs` on a control plane to generate a new one
To see the stack trace of this error execute with --v=5 or higher

如果出现以上错误,就需要去初始化成功的master重新生成验证消息

[root@kube-master-3 k8s]# kubeadm init phase upload-certs --upload-certs
I0304 15:16:59.221639   95329 version.go:252] remote version is much newer: v1.20.4; falling back to: stable-1.18
W0304 15:17:00.282978   95329 configset.go:202] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io]
[upload-certs] Storing the certificates in Secret "kubeadm-certs" in the "kube-system" Namespace
[upload-certs] Using certificate key:
0db707eb72d2282b642cc2f6fe057ae3963cf380a351cc932bfcd424963ce837

然后替换刚刚的验证消息继续执行命令即可。

以上解决问题的过程有点粗糙,估计适用范围不大,可以多多交流。

kubernetes:[kubelet-check] The HTTP call equal to ‘curl -sSL http://localhost:10248/healthz‘ failed相关推荐

  1. 【问题解决】[kubelet-check] The HTTP call equal to ‘curl -sSL http://localhost:10248/healthz‘ failed wite

    故障 报错:[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with ...

  2. The HTTP call equal to ‘curl -sSL http://localhost:10248/healthz‘ failed with error: Get “http://loc

    一.报错 The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get " ...

  3. kubernetes kubelet参数

    全栈工程师开发手册 (作者:栾鹏) 架构系列文章 概要 kubelet 是运行在每个节点上的主要的"节点代理",每个节点都会启动kubelet进程,用来处理Master节点下发到本 ...

  4. kubernetes kubelet挂掉问题分析

    环境描述 kubernetes 组建的运行方式 kubelet : systemd 运行 其他都是docker起的容器 问题描述 1.有pod状态处于Unknow状态 [root@master-64 ...

  5. Kubernetes Kubelet 状态更新机制

    Kubernetes Kubelet 状态更新机制 tags: kubelet 文章目录 Kubernetes Kubelet 状态更新机制 1. 概览 2. 配置 2.1 社区默认的配置 2.2 快 ...

  6. Kubernetes K8s 结合国内外文章解决 The kubelet is not running

    初学K8s,好好教程不跟着来,非要全部安装最新的docker 和 k8s,经过4小时奋战终于解决! 先说明下docker是最新版的安装,又安装K8s cat > /etc/yum.repos.d ...

  7. CentOS7系统上Kubernetes集群搭建

    虚拟机创建 在自己的Mac系统里面利用Parallels Desktop创建3台虚拟机,具体信息如下: CentOS7-Node1: 10.211.55.7 parallels/centos-test ...

  8. Kubernetes(K8s)集群安装部署

    Kubernetes(K8s)集群安装 Kubernetes(K8s)集群安装 1 .基本环境配置 1.1.Kubernetes集群规划 1.2.基础环境配置(所有节点) 1.2.1.Host文件修改 ...

  9. kubeadm 部署 kubernetes:v1.23.4集群

    一.安装前的准备 !!!以下操作需要在所有master和node上执行 1.1.关闭selinux,关闭防火墙 1.2.添加hosts解析 192.168.122.160 master 192.168 ...

最新文章

  1. Python加密—AES加密(2)
  2. traceping是什么意思_trace命令是什么意思?
  3. 是否会成为问题——Linq to Sql的执行可能无法复用查询计划
  4. 二叉树的创建及各种遍历
  5. 关于直播,所有的技术细节都在这里了(二)
  6. vb webbrowser html源码,VB WebBrowser控件常用源码
  7. SCTF-2019 Misc wp
  8. Eviews10.0下载与安装
  9. FFplay源码分析-rtmp入口
  10. C语言sar图像几何校正,SAR图像几何校正方法与流程
  11. mysql 唯一索引为null_mysql 唯一索引与null.md
  12. 玉米社:抖音玩法和运营机制,学会这些技巧,轻松上热门
  13. 试试这些方法,误删文件怎么恢复?
  14. 计算机桌面图标出现蓝色问号,win7系统桌面图标有蓝色问号的解决方法
  15. 紫外线消毒器的催化反应工艺指南
  16. flutter全屏背景图(包括appbar和状态栏)以及沉浸状态栏的设置
  17. 医疗检测机构能力建设指导原则
  18. CST和GMT时间的区别
  19. js对象的getter和setter
  20. 华为鸿蒙os产品,华为鸿蒙OS发布 首先应用于智慧屏产品

热门文章

  1. docker与gosu
  2. 【计算摄影】浅析图像修复背后的核心技术
  3. Kubernetes搭建Flink会话集群
  4. c++面向对象设计(谭浩强)2.5 2.6类的封装性与信息隐蔽
  5. 星露谷物语+蒲公英联机教程
  6. [论文]自主水下航行器的底部跟随预瞄控制器
  7. 2022年度浦东新区企业研发机构认定公示
  8. 建站教程WordPress新手入门十友链管理
  9. sql server 获取上个月,上周
  10. docker国内镜像源配置