Kubernetes bootstrap token

9/29/2019

In the Kubernetes docs there is a bootstrap token which is used for Nodes TLS bootstrapping. Wherever it is mentioned there is always the same value of 07401b.f395accd246ae52d. I haven't found much details on if that numeric sequence have some special meaning and should be precisely the same for every bootstrapped Node. Or is that just a randomly generated magic number?

-- esboych
kubernetes

1 Answer

9/29/2019

That sequence carries no special meaning. The bootstrap token is entirely random. I suspect the times that specific sequence is mentioned in documentation, it's coming from or directly copied from the same source.

Bootstrap Tokens take the form of abcdef.0123456789abcdef. More formally, they must match the regular expression [a-z0-9]{6}.[a-z0-9]{16}.

The first part of the token is the “Token ID” and is considered public information. It is used when referring to a token without leaking the secret part used for authentication. The second part is the “Token Secret” and should only be shared with trusted parties.

https://kubernetes.io/docs/reference/access-authn-authz/bootstrap-tokens/#token-format

If you want to test this, play around with kubeadm's token create. This will generate random tokens you can use to bootstrap nodes.

kubeadm token create Synopsis This command will create a bootstrap token for you. You can specify the usages for this token, the “time to live” and an optional human friendly description.

The [token] is the actual token to write. This should be a securely generated random token of the form “[a-z0-9]{6}.[a-z0-9]{16}“. If no [token] is given, kubeadm will generate a random token instead.

https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-token/#cmd-token-create

-- erstaples
Source: StackOverflow