Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't find kubeadm token after initializing master

When i run kubeadm init it shows a token that I should use from the other hosts to connect to this host. Where is that token stored? I'm trying to figure out more ways to automate this by adding kubeadm inside of Terraform.

Thanks for any help!

like image 239
vallard Avatar asked Oct 12 '16 23:10

vallard


People also ask

How do you get the Kubeadm join token from master?

Creating a New Token Create a new token using kubeadm. By using the –print-join-command argument kubeadm will output the token and SHA hash required to securely communicate with the master. Use kubeadm to list all tokens in order to verify our new one.

How do I get Kubeadm INIT token?

kubeadm token generate You can do so yourself as long as it is in the format "[a-z0-9]{6}. [a-z0-9]{16}". This command is provided for convenience to generate tokens in the given format. You can also use "kubeadm init" without specifying a token and it will generate and print one for you.

What does Kubeadm Reset do?

Reset workflow kubeadm reset is responsible for cleaning up a node local file system from files that were created using the kubeadm init or kubeadm join commands. For control-plane nodes reset also removes the local stacked etcd member of this node from the etcd cluster.


2 Answers

The instruction for Kubernetes 1.9.x (and above) can be found here.

The commands I used are:

kubeadm token generate kubeadm token create <generated-token> --print-join-command --ttl=0 
like image 69
Chris Fregly Avatar answered Sep 17 '22 18:09

Chris Fregly


Run this command in the master node to get the token

kubeadm token list 
like image 40
sfgroups Avatar answered Sep 17 '22 18:09

sfgroups