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

John McGehee
<p>In microk8s, bearer tokens are listed in file <code>/snap/microk8s/current/known_token.csv</code>. <a href="https://kubernetes.io/docs/reference/access-authn-authz/authentication/" rel="nofollow noreferrer">Each line is of the format</a>:</p>

<pre><code>bearer_token,user,uid,"group1,group2,group3"
</code></pre>

<p>In the following example file the bearer token for user <code>admin</code> is <code>rICHredacted4YWK</code>:</p>

<pre><code>RPY4redactedS65i,system:kube-proxy,kube-proxy
rICHredacted4YWK,admin,admin,"system:masters"
tzgVredactedW4YW,system:node:ip-172-31-14-2,kubelet-0,"system:nodes"
</code></pre>
