kubernetes-dashboardmicrok8s

How to log in to the microk8s Kubernetes Dashboard?


I enabled the dashboard in microk8s:

microk8s.enable dns dashboard

I found its IP address:

microk8s.kubectl get all --all-namespaces
    ...
kube-system   service/kubernetes-dashboard ClusterIP 10.152.183.212 <none> 443/TCP 24h
    ...

I tried to display it in my browser using the URL https://10.152.183.212. My browser gives the error "Authentication failed. Please try again.":

Kubernetes dashboard 'Authentication failed. Please try again.'

I have also received the similar error, "Not enough data to create auth info structure."


Solution

  • First, make sure that your browser accepts cookies for your dashboard's URL, https://10.152.183.212 in this case.

    With the loose security of microk8s, you can skip sign in and simply select the SKIP button.

    If you want to sign in for real, get the bearer token for user admin from file /snap/microk8s/current/known_token.csv:

    sed -n 's/,admin,admin.*//p' /snap/microk8s/current/known_token.csv
    rP8Yredactedk5EU
    

    Return to your browser, select Token, and enter the bearer token found above. Select SIGN IN and enter the bearer token:

    Ready to sign in with user admin's bearer token