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!
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.
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.
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.
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
Run this command in the master node to get the token
kubeadm token list
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With