1、生产一个永久的token(使用参数--ttl 0 )

[root@k8s-master ~]# kubeadm token create --ttl 0

2、查看当前有效的token

[root@k8s-master ~]# kubeadm token list
TOKEN                     TTL         EXPIRES                     USAGES                   DESCRIPTION                                                EXTRA GROUPS
0ugsv4.dv2kk6ru5iqkqbc9   19h         2021-08-07T19:17:31+08:00   authentication,signing   The default bootstrap token generated by 'kubeadm init'.   system:bootstrappers:kubeadm:default-node-token
tq85py.o52g1o223c78z230   <forever>   <never>   authentication,signing   <none>                                                     system:bootstrappers:kubeadm:default-node-token

3、获取ca证书sha256编码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/^.* //'
205ec1189ad156bc02c3e977def000ffafef7f6bc7814bf1acc6b79aa6b593d0

即可使用 kubeadm join来将节点加入到集群中

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐