背景:

    昨天在建立好新的集群后,出现了新的问题,其中的一台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. angular 父组件调用子组件的方法

  2. 面向对象2(Java)

    封装 基本介绍 该露的露,该藏的藏,我们的程序设计要追求"高内聚,低耦合": 高内聚:类的内部数据操作细节自己完成,不允许外部干涉 低耦合:仅暴露少量的方法给外部使用 封装(数据的 ...

  3. 执行kubectl api-resources 报错error: unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the server is currently unable to handle the request

    1.故障现象:error: unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the serve ...

  4. redis 常用指令

    redis指令有些相似,记忆起来不太容易,在此做一下整理 序号 类型 指令 参数 作用 例子 1 string set key value 存储一个 string 类型的值 set a aa 2 st ...

  5. LEETCODE 数组嵌套

    题目:数组嵌套 索引从0开始长度为N的数组A,包含0到N - 1的所有整数.找到最大的集合S并返回其大小,其中 S[i] = {A[i], A[A[i]], A[A[A[i]]], ... }且遵守以 ...

  6. P2212 Watering the Fields S

    题目描述 给定n个点,第i个点的坐标为(xi,yi)(xi​,yi​),如果想连通第i个点与第j个点,需要耗费的代价为两点的距离.第i个点与第j个点之间的距离使用欧几里得距离进行计算,即:(xi-xj ...

  7. P2330 繁忙的都市

    题目描述 城市C是一个非常繁忙的大都市,城市中的道路十分的拥挤,于是市长决定对其中的道路进行改造.城市C的道路是这样分布的:城市中有n个交叉路口,有些交叉路口之间有道路相连,两个交叉路口之间最多有一条 ...

  8. 关于数据传递 json

    关于这几种语言的json 操作 Lua local cjson2 = require "cjson" local lua_object = { ["name"] ...

  9. 记安装MySQL数据库

    记录一次自己动手安装MySQL数据库所踩的坑   MySQL安装包与操作系统匹配 安装包有amd和Intel,32位.64位多种组合需要确认仔细使用者操作系统和CPU型号 例如我使用的是CentOS ...

  10. 树莓派 IIC功能安装及测试

    参考连接: https://blog.csdn.net/panwen1111/article/details/81044428 https://blog.csdn.net/xukai871105/ar ...