增加node节点错误

增加一个NODE节点报错:

[root@k8s-node03 ~]# kubeadm join 10.0.110.141:6443 --token abcdef.0123456789abcdef \
>     --discovery-token-ca-cert-hash sha256:45b93989c9460fea586ef940a71b8ab5b99e0e22b24d9d801e5c23d5b2b565e8
[preflight] Running pre-flight checks
    [WARNING SystemVerification]: this Docker version is not on the list of validated versions: 20.10.7. Latest validated version: 18.09
error execution phase preflight: couldn't validate the identity of the API Server: abort connecting to API servers after timeout of 5m0s

原因:master节点的token过期了

解决:重新生成新token

在master重新生成token

[root@k8s-master01 install-k8s]# kubeadm token create
oo475d.3n3o21msqoaqekzm

[root@k8s-master01 install-k8s]# openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //'
45b93989c9460fea586ef940a71b8ab5b99e0e22b24d9d801e5c23d5b2b565e8

 

Node节点重新join就可以了

[root@k8s-node03 ~]# kubeadm join 10.0.110.141:6443 --token oo475d.3n3o21msqoaqekzm     --discovery-token-ca-cert-hash sha256:45b93989c9460fea586ef940a71b8ab5b99e0e22b24d9d801e5c23d5b2b565e8
[preflight] Running pre-flight checks
    [WARNING SystemVerification]: this Docker version is not on the list of validated versions: 20.10.7. Latest validated version: 18.09
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
[kubelet-start] Downloading configuration for the kubelet from the "kubelet-config-1.15" ConfigMap in the kube-system namespace
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Activating the kubelet service
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...

This node has joined the cluster:
* Certificate signing request was sent to apiserver and a response was received.
* The Kubelet was informed of the new secure connection details.

Run 'kubectl get nodes' on the control-plane to see this node join the cluster.

 

posted @ 2021-06-25 17:08  丶蜡笔小兴  阅读(206)  评论(0编辑  收藏  举报