背景:

    昨天在建立好新的集群后,出现了新的问题,其中的一台master节点无法正常工作。虽然可以正常使用,但是就出现了单点故障,今天在修复时出现了etcd健康检查自检没通过。

    Yesterday, after a new cluster was established, a new problem a problem occurred, and one of the master nodes did not work properly. Although can be used normally, but there is a single point of failure, today in the repair of the etcd health check self-test failed.

对加入集群中时,出现如下报错:

When you join a cluster, the following error occurs

提示 etcd 监控检查失败,查看一下Kubernetes 集群中的 kubeadm 配置信息。

    Prompt the etcd monitoring check to fail and review the kubeadm configuration information in the Kubernetes cluster.


[root@master-01 ~]# kubectl describe configmaps kubeadm-config -n kube-system
----
apiEndpoints:
master-01:
advertiseAddress: 10.0.0.11
bindPort: 6443
master-02:
advertiseAddress: 10.0.0.12
bindPort: 6443
master-03:
advertiseAddress: 10.0.0.13
bindPort: 6443
apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterStatus Events: <none>

   因为集群搭建的时候,etcd是镜像的方式,在master02上面出现问题后,进行剔除完成后,etcd还是在存储在每个master上面,所以重新添加的时候会得知健康检查失败。

    Because when the cluster is built, etcd is mirrored, after the problem on master02, after the cull is completed, etcd is still stored on top of each master, so when you add again, you will learn that the health check failed.


    这时就需要进入容器内部进行手动删除这个etcd了,首先获取集群中的etcd pod列表看一下,并进入内部给一个sh窗口。

    At this point you need to go inside the container to manually delete this etcd, first get the list of etcd pods in the cluster to see, and go inside to give a sh window

[root@master-01 ~]# kubectl get pods -n kube-system | grep etcd
[root@master-01 ~]# kubectl exec -it etcd-master-03 sh -n kube-system

进入容器后,执行如下操作

 After entering the container, do the following

## 配置环境
$ export ETCDCTL_API=3
$ alias etcdctl='etcdctl --endpoints=https://127.0.0.1:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key' ## 查看 etcd 集群成员列表
$ etcdctl member list ## 删除 etcd 集群成员 master-02
$ etcdctl member remove ## 再次查看 etcd 集群成员列表
$ etcdctl member list ## 退出容器
$ exit

查看列表并删除已不存在的master

View the list and remove the master that no longer exists



再次进行加入master,即可成功。

Join master again and you'll be successful



高新科技园

k8s加入新的master节点出现etcd检查失败的更多相关文章

  1. K8S踩坑篇-master节点作为node节点加入集群

    前面我们二进制部署K8S集群时,三台master节点仅仅作为集群管理节点,所以master节点上中并未部署docker.kubelet.kube-proxy等服务.后来我在部署mertics-serv ...

  2. 【K8S】基于单Master节点安装K8S集群

    写在前面 最近在研究K8S,今天就输出部分研究成果吧,后续也会持续更新. 集群规划 IP 主机名 节点 操作系统版本 192.168.175.101 binghe101 Master CentOS 8 ...

  3. k8s集群———单master节点2node节点

    #部署node节点 ,将kubelet-bootstrap用户绑定到系统集群角色中(颁发证书的最小权限) kubectl create clusterrolebinding kubelet-boots ...

  4. 记录一个奇葩的问题:k8s集群中master节点上部署一个单节点的nacos,导致master节点状态不在线

    情况详细描述; k8s集群,一台master,两台worker 在master节点上部署一个单节点的nacos,导致master节点状态不在线(不论是否修改nacos的默认端口号都会导致master节 ...

  5. k8s集群之master节点部署

    apiserver的部署 api-server的部署脚本 [root@mast-1 k8s]# cat apiserver.sh #!/bin/bash MASTER_ADDRESS=$1 主节点IP ...

  6. Kubernetes1.91(K8s)安装部署过程(四)--Master节点安装

    再次明确下架构:  三台虚拟机 centos 7.4系统,docker为17版本,ip为10.10.90.105到107,其中105位master,接下来的master相关组件安装到此机器上. etc ...

  7. 排查 k8s 集群 master 节点无法正常工作的问题

    搭建的是 k8s 高可用集群,用了 3 台 master 节点,2 台 master 节点宕机后,仅剩的 1 台无法正常工作. 运行 kubectl get nodes 命令出现下面的错误 The c ...

  8. Kubernetes Master节点灾备恢复操作指南---升级版

    本文档简述了Kubernetes主节点灾备恢复的相关步骤,供在发生k8s master崩溃时操作. 就算是在k8s里部署了etcd群集, 主节点控制组件的高可用节点,灾备恢复也是必须要实现的操作,才能 ...

  9. K8S 使用Kubeadm搭建单个Master节点的Kubernetes(K8S)~本文仅用于测试学习

    01.集群规划 系统版本:CentOS Linux release 7.6.1810 (Core) 软件版本:kubeadm.kubernetes-1.15.docker-ce-18.09 硬件要求: ...

  10. 一键安装基于dns的高可用k8s集群(3节点,etcd https)

    在公司,使用dns切换,可能会比keepalived+haproxy,更精简的易维护. 毕竟,高可用只是偶尔切换,不是时时切换. 且dns解析在自己可控时,更不会影响k8s线上使用了. (部分代码,由 ...

随机推荐

  1. 通达OA设计表单的小总结

    16px下: 2010-09-09  80px  一般 100px  占5个字符 2010年09月09日 112px 一般120px 对应计算控件30px 占7个字符 2010-09-09时分秒 14 ...

  2. Shell 更多结构化命令(流程控制)

    更多的结构化命令 上一章里,你看到了如何通过检查命令的输出和变量的值来改变 shell 脚本程序的流程.本章会继续介绍能够控制 shell 脚本流程的结构化命令.你会了解如何重复一些过程和命令,也就是 ...

  3. python更新pip报错pip._vendor.urllib3.exceptions.ProxySchemeUnknown: Not supported proxy scheme None

    更新pip报错: 看到最后一行很明显是proxy的问题,查看cmd下的代理 将代理删掉重启cmd执行命令就不会报错了

  4. vscode 一些扩展的推荐(前端)

    - `Auto Rename Tag`:成对修改 HTML 标签名 - `Bracket Pair Colorizer`:括号匹配高亮 - `Color Highlight`:显示颜色代码的颜色 -  ...

  5. Java发送http请求携带token,使用org.nutz

    发送http请求,需要携带token数据,创建Header传输 Header header = Header.create(); header.set("Authorization" ...

  6. 字符串替换Replace仅替换第一个匹配项

    C#里面的String.Replace(string,string)方法替换的时候是替换所有的匹配项,但是有时候我们会遇到这样的需求,就是只替换第一个匹配项. 我这里自己写另一个方法来实现这个功能,求 ...

  7. weblogic session timed out

    How to Configure Session Timeout in Weblogic Server (WLS) ?

  8. 微信支付服务商api对接

    引入官方sdk <!--微信v3支付sdk {https://github.com/wechatpay-apiv3/wechatpay-apache-httpclient}--> < ...

  9. 前端访问Tornado跨域问题

  10. 用猿大师办公助手已经在Chrome网页中打开了Office Word,再用桌面Office打开其他Word打不开怎么办?

    我们发现用猿大师办公助手在Chrome网页中已经打开了Word文档,但是再用本地的Word打开其他文档,却直接显示在网页中了,本地打不开Word怎么办? 猿大师办公助手默认新打开文件是在内嵌网页off ...