kubeadm join token失效
kubeadm join token 失效
新增node节点,需要拥有到token
kubeadm token --help
Usage:
kubeadm token [flags]
kubeadm token [command]
Available Commands:
create Create bootstrap tokens on the server //new token
delete Delete bootstrap tokens on the server //delete token
generate Generate and print a bootstrap token, but do not create it on the server
list List bootstrap tokens on the server
[root@c-3-104 ~]# kubeadm token list //default 24h joion token expire
TOKEN TTL EXPIRES USAGES DESCRIPTION
EXTRA GROUPS78va9y.lbfgkkpjl9cwe5cs 15h 2020-05-28T13:16:33+08:00 authentication,signing The default bootstrap token generated by
'kubeadm init'. system:bootstrappers:kubeadm:default-node-token[root@c-3-104 ~]#
//kubeadm token 帮助查看
kubeadm token -h
kubeadm token create -h
kubeadm token create --ttl 0 //不过期join token,一般都是按需创建
[root@c-3-104 ~]# kubeadm token create --ttl 0
W0527 21:21:32.002569 57104 configset.go:202] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8
s.io kubeproxy.config.k8s.io]f94qb7.3v2lfal4vpu2edxc
[root@c-3-104 ~]#
[root@c-3-104 ~]#
[root@c-3-104 ~]# kubeadm token list
TOKEN TTL EXPIRES USAGES DESCRIPTION
EXTRA GROUPS78va9y.lbfgkkpjl9cwe5cs 15h 2020-05-28T13:16:33+08:00 authentication,signing The default bootstrap token generated by
'kubeadm init'. system:bootstrappers:kubeadm:default-node-tokenf94qb7.3v2lfal4vpu2edxc <forever> <never> authentication,signing <none>
system:bootstrappers:kubeadm:default-node-token[root@c-3-104 ~]#
[root@c-3-104 ~]# kubeadm token create --print-join-command //新创建一个join token并打印出加入命令
W0527 21:24:10.111159 59181 configset.go:202] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8
s.io kubeproxy.config.k8s.io]kubeadm join 192.168.3.104:6443 --token hurkrx.hi0fx7bp728smzvb --discovery-token-ca-cert-hash sha256:d2de3ae7c47a18ceca31deebcf
1b0e5441cc6a7963e272dd381a8f600ef63820 [root@c-3-104 ~]#
[root@c-3-104 ~]#
[root@c-3-104 ~]# kubeadm token list
TOKEN TTL EXPIRES USAGES DESCRIPTION
EXTRA GROUPS78va9y.lbfgkkpjl9cwe5cs 15h 2020-05-28T13:16:33+08:00 authentication,signing The default bootstrap token generated by
'kubeadm init'. system:bootstrappers:kubeadm:default-node-tokenf94qb7.3v2lfal4vpu2edxc <forever> <never> authentication,signing <none>
system:bootstrappers:kubeadm:default-node-tokenfkpqoi.gbn6tfnrb1928z11 23h 2020-05-28T21:24:05+08:00 authentication,signing <none>
system:bootstrappers:kubeadm:default-node-tokenhurkrx.hi0fx7bp728smzvb 23h 2020-05-28T21:24:10+08:00 authentication,signing <none>
system:bootstrappers:kubeadm:default-node-token[root@c-3-104 ~]#