背景:

    昨天在建立好新的集群后,出现了新的问题,其中的一台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. yield基础知识

    function* y(p1){ let r=p1; r=(yield r-5) //表达式A,在第1轮是普通return,在第2轮next(param)时会被param替换 r=(yield r*2 ...

  2. mysql 循环 例子

    mysql 循环生成数据demo: DROP PROCEDURE IF EXISTS test_insert; DELIMITER;; CREATE PROCEDURE test_insert() B ...

  3. java mysql删除表中多余的重复记录(多个字段),只留有id最小的记录

    mysql 删除表中多余的重复记录(多个字段),只留有id最小的记录 DELETE FROM 表1 f WHERE (f.字段1,f.字段2) IN ( SELECT 字段1,字段2 FROM 表1 ...

  4. Android 自定义View (三)

    一.前言 上节 讲解了旋转圆环基本的实现方法.本文将在此基础上进一步改进,在属性文件中自定义控件属性,避免代码中显式调用setXXX() 方法. 二.流程 首先,在资源文件 values 中新建一个 ...

  5. MySQL数据库sql_mode导致varchar字段超过长度被截断插入

    django数据库设置sql_mode MySQL的sql_mode解析与设置 mysql中sql_mode的修改 sql_mode:它定义了MySQL应该支持的sql语法,对数据的校验等等. 问题 ...

  6. Java压缩音频视频工具类

    /** * TODO * * @author Administrator * @version 1.0 * @date 2021/11/5 16:55 */ public class vedio { ...

  7. 在VS中使用Wind数据终端API的经验(一)

    因工作需要,使用vs2019来调用Wind金融终端API数据接口.具体步骤按照wind的帮助文档一步步做下来.这里提一下和帮助文档不同的地方. Windows Console APP下,编译项目后出现 ...

  8. maven2创建的archetypeArtifactId类型

    原文:https://www.cnblogs.com/xiziyin/archive/2009/11/22/1608239.html 添加翻译:(我总觉得看汉字比看英文要快得多) 看maven-def ...

  9. springBoot的全局异常处理

    GlobalException.java package com.bank.util; import com.bank.exception.ContentEmpyException; import c ...

  10. SpringBoot的几大重要问题

    1: traceID调用链 2:异步调用注解问题 import org.springframework.scheduling.annotation.Async;import org.springfra ...