How to get bearer tokens in microk8s?

3/14/2019

I want to log in to the microk8s dashboard, but I need a bearer token. How can I find the bearer token for user admin in microk8s Kubernetes?

-- John McGehee
kubernetes
microk8s

1 Answer

3/14/2019

In microk8s, bearer tokens are listed in file /snap/microk8s/current/known_token.csv. Each line is of the format:

bearer_token,user,uid,"group1,group2,group3"

In the following example file the bearer token for user admin is rICHredacted4YWK:

RPY4redactedS65i,system:kube-proxy,kube-proxy
rICHredacted4YWK,admin,admin,"system:masters"
tzgVredactedW4YW,system:node:ip-172-31-14-2,kubelet-0,"system:nodes"
-- John McGehee
Source: StackOverflow