通过kubeadm join 为k8s集群增加节点出错 couldn‘t validate the identity of the API Server

问题

在创建了k8s集群一段时间之后,想通过之前创建集群时打印的kubeadm join命令为集群增加节点,却遇到错误:

error execution phase preflight: couldn't validate the identity of the API Server: could not find a JWS signature in the cluster-info ConfigMap for token ID "ej2g03"

解决

这是由于之前的token已经过期了,需要重新生成token。

在原来的master节点执行:

$ kubeadm token generate
ex8q90.863kcm1pqznic4fd
$ kubeadm token create ex8q90.863kcm1pqznic4fd --print-join-command --ttl=0
kubeadm join 170.0.0.195:6443 --token ex8q90.863kcm1pqznic4fd --discovery-token-ca-cert-hash sha256:18443e9900843a3ee3d0fde3fef80b51791a1817344228364a2612123fbc11bf

获得新的kubeadm join命令之后,就能成功加入节点了。

猜你喜欢

转载自blog.csdn.net/marlinlm/article/details/122524416