How to find the token to add new nodes to cluster when using kubeadm ?

2,638 views
Skip to first unread message

Chen Li

unread,
Mar 3, 2017, 2:17:32 AM3/3/17
to kubernetes-sig-cluster-lifecycle
Hi all,

I'm following the guide:https://kubernetes.io/docs/getting-started-guides/kubeadm/ to install k8s with 3 nodes. 

Most things works well, and now, I want to add another new node. But I forget to save the token that need to set when run the "kubeadm join " command, how can I get the token back ??

I see there is a command "kubeadm token generate", can I use this command ? Would it cause issues for the 3 nodes already in the cluster ?

Looking forward to your reply.

Thanks,
-chen

Pavel Moukhataev

unread,
Mar 3, 2017, 6:22:47 AM3/3/17
to kubernetes-sig-cluster-lifecycle
New token won't give you possibility to join old cluster.

Please check installation guide - there is section about fetching token from running installation:

There is no built-in way of fetching the token easily once the cluster is up and running, but here is a kubectl command you can copy and paste that will print out the token for you:

 # kubectl -n kube-system get secret clusterinfo -o yaml | grep token-map | awk '{print $2}' | base64 --decode | sed "s|{||g;s|}||g;s|:|.|g;s/\"//g;" | xargs echo

пятница, 3 марта 2017 г., 10:17:32 UTC+3 пользователь Chen Li написал:
Reply all
Reply to author
Forward
0 new messages