error execution phase check-etcd: etcd cluster is not healthy: failed to dial endpoint https://xxx:2379...

created at 08-27-2021 views: 4

error info

Kubeadm error when adding a new master node:

error execution phase check-etcd: etcd cluster is not healthy: failed to dial endpoint https://192.168.80.13:2379 with maintenance client: context deadline exceeded

solution

Query etcd related pods

kubectl get pod -n kube-system

Enter

kubectl exec -ti etcd-k8s-master01 -n kube-system sh
export ETCDCTL_API=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

Found the following information

17826e460c060952, started, k8s-master03, https://192.168.80.13:2380, https://192.168.80.13:2379, false
195fbcb8c0d5200f, started, k8s-master01, https://192.168.80.11:2380, https://192.168.80.11:2379, false
87d1f390fdb73c30, started, k8s-master02, https://192.168.80.12:2380, https://192.168.80.12:2379, false

Remove the problematic k8s-master03 node

etcdctl --cacert="/etc/kubernetes/pki/etcd/ca.crt" --cert="/etc/kubernetes/pki/etcd/server.crt" --key="/etc/kubernetes/pki/etcd/server.key" member remove 17826e460c060952

Then re-execute the node join command, it shows that the join is successful

created at:08-27-2021
edited at: 08-27-2021: