在执行kubeadm join的时候报错如下:
k8s Could not find a JWS signature in the cluster-info ConfigMap for token ID "vezzap" 这个错误的原因是没有token
或者报错如下
kubeadm join — error execution phase preflight: couldn’t validate the identity of the API Server: abort connecting to API servers after timeout of 5m0s 这个错误的原因是token失效
两种方案都需要重新生成token
1)关于token失效, 重新生成
master集群初始化后,token24小时后就会失效,如果到了token失效时间,node再加入集群,需要重新生产token:
## 查看token状态 ### TTL值 就是token生于时间 [root@k8s-master ~]# kubeadm token list TOKEN TTL EXPIRES USAGES DESCRIPTION EXTRA GROUPS 5ti5kd.o32bm9lofv6zej94 21h 2019-05-22T11:16:31+08:00 authentication,signing The default bootstrap token generated by 'kubeadm init'. system:bootstrappers:kubeadm:default-node-token ## 重新生产token [root@k8s-master ~]# kubeadm token create W0511 05:25:48.747429 31569 configset.go:202] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io] lb2hib.5kf3zjrzkp8e632w ## 获取--discovery-token-ca-cert-hash值 [root@k8s-master ~]# openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | \ openssl dgst -sha256 -hex | sed 's/^.* //' 4fcac7c487209d7c354351ba6f93110253df4d0440fc68cb23fc4ac0baed4e0c ## 加入集群命令--在node节点执行 [root@k8s-master ~]# kubeadm join 192.168.1.106:6443 --token hb0mhv.5kf3zjrzkp8e632w \ --discovery-token-ca-cert-hash sha256:cd778ad01bdbc656eaff7d3b1273691f0070ebbadd2f1b8a3189a6dc1e88f39f注意: 需要替换两个位置的值第一个位置替换:lb2hib.5kf3zjrzkp8e632w第二个位置替换:4fcac7c487209d7c354351ba6f93110253df4d0440fc68cb23fc4ac0baed4e0c