error execution phase check-etcd: etcd cluster is not healthy:
添加master节点 爆出一下错误:
error execution phase check-etcd: etcd cluster is not healthy:
进入etcd 的pod
# export ETCDCTL=3
# etcdctl --cacert="/etc/kubernetes/pki/etcd/ca.crt" --cert="/etc/kubernetes/pki/etcd/server.crt" --key="/etc/kubernetes/pki/etcd/server.key" member list
647ff3d3896c1321, started, master2, https://192.168.69.53:2380, https://192.168.69.53:2379, false
fca8e805d560aa1c, started, master, https://192.168.69.52:2380, https://192.168.69.52:2379, false
etcdctl --cacert="/etc/kubernetes/pki/etcd/ca.crt" --cert="/etc/kubernetes/pki/etcd/server.crt" --key="/etc/kubernetes/pki/etcd/server.key" member remove 647ff3d3896c1321
查看etcd状态:
etcdctl --cacert="/etc/kubernetes/pki/etcd/ca.crt" --cert="/etc/kubernetes/pki/etcd/server.crt" --key="/etc/kubernetes/pki/etcd/server.key" --endpoints="https://192.168.69.52:2379,https://192.168.69.53:2379,https://192.168.69.98:2379" endpoint status --write-out=table
查看etcd 集群健康状态
etcdctl --cacert="/etc/kubernetes/pki/etcd/ca.crt" --cert="/etc/kubernetes/pki/etcd/server.crt" --key="/etc/kubernetes/pki/etcd/server.key" --endpoints="https://192.168.69.52:2379,https://192.168.69.53:2379,https://192.168.69.98:2379" endpoint health --write-out=table
删除索要添加的节点
参考命令
scp /etc/kubernetes/pki/etcd/ca.key master3:/etc/kubernete/pki/etcd/
scp /etc/kubernetes/pki/ca.crt master3:/etc/kubernetes/pki/
scp /etc/kubernetes/pki/ca.key master3:/etc/kubernetes/pki/
scp /etc/kubernetes/pki/sa.key master3:/etc/kubernetes/pki/
scp /etc/kubernetes/pki/sa.pub master3:/etc/kubernetes/pki/
scp /etc/kubernetes/pki/front-proxy-ca.crt master3:/etc/kubernetes/pki/
scp /etc/kubernetes/pki/front-proxy-ca.key master3:/etc/kubernetes/pki/
scp /etc/kubernetes/pki/etcd/ca.crt master3:/etc/kubernetes/pki/etcd/
scp /etc/kubernetes/pki/etcd/ca.key master3:/etc/kubernetes/pki/etcd/
scp /etc/kubernetes/admin.conf root@master3:/etc/kubernetes/
kubeadm join 192.168.69.199:6443 --token ko5it5.tiamrju29579nx5d --discovery-token-ca-cert-hash sha256:e57bd08f92729352e8c7a29f47ddf6710f0ecc1b846b02e2e4bfa1703b3d4127 --control-plane
kubeadm join 192.168.69.199:6443 --token x2b4pu.r5x9rp3s41k91ifv --discovery-token-ca-cert-hash sha256:e57bd08f92729352e8c7a29f47ddf6710f0ecc1b846b02e2e4bfa1703b3d4127 --control-plane
kubeadm join 192.168.69.199:6443 --token 67fscr.65tqzhcuedtqawyc --discovery-token-ca-cert-hash sha256:e57bd08f92729352e8c7a29f47ddf6710f0ecc1b846b02e2e4bfa1703b3d4127 --control-plane
meb
etcdctl --cacert="/etc/kubernetes/pki/etcd/ca.crt" --cert="/etc/kubernetes/pki/etcd/server.crt" --key="/etc/kubernetes/pki/etcd/server.key" member list
etcdctl --cacert="/etc/kubernetes/pki/etcd/ca.crt" --cert="/etc/kubernetes/pki/etcd/server.crt" --key="/etc/kubernetes/pki/etcd/server.key" member remove