I installed microk8s on a barely fresh machine and started a new cluster (microk8s.start). After that I installed dashboard addon (microk8s.enable dashboard). I can connect to the container responsible for provide the dashboard service on port 443, but I can authenticate because I don't know where is the password. I find admin user doesn't have a password, so empty login field should work, but does not. I also try to change password but says the file system is ready-only (because the configuration file is inside /snap/microk8s/340/). I'm using the microk8s 1.13.
Hi @mhalano ,
Just to be clear, we are talking about the service/kubernetes-dashboard in namespace kube-system, right? If you do a microk8s.kubectl get all --all-namespaces you should be able to find the ClusterIP of that service and you will then need to point your browser to https://"ClusterIP":443/
To authenticate on the dashboard you could use the admin token in known_token.csv under /snap/microk8s/current. Honestly, I always click the skip button.
Thank you for opening this issue and for using MicroK8s.
I think we can close this.
Hello, maybe it would have been useful to add the dashboard's URL in the list returned from kubectl cluster-info for easier access.
Kubernetes master is running at http://127.0.0.1:8080
Heapster is running at http://127.0.0.1:8080/api/v1/namespaces/kube-system/services/heapster/proxy
KubeDNS is running at http://127.0.0.1:8080/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
Grafana is running at http://127.0.0.1:8080/api/v1/namespaces/kube-system/services/monitoring-grafana/proxy
InfluxDB is running at http://127.0.0.1:8080/api/v1/namespaces/kube-system/services/monitoring-influxdb:http/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
Thanks for all the info guys! I can't believe this actually works!
Btw, because my web browser is here on my dev machine instead of the bare-metal ubutnu kuberneteres server I'm playing around with, I needed to forward that port that showed for the server that shows up in microk8s.kubectl get all --all-namespaces |grep kubernetes-dashboard | grep ClusterIP (thanks again for that great tip @ktsakalozos).
I used a python based networking tool to tunnel my dev laptop onto the remote kubernetes server. Here's my command for that in case anyone finds it handy: sshuttle -v -r my_kubernetes_machine -N 0/0. As long as ssh my_kubernetes_machine works, then that command will make all your dev laptops connections seem to be emanating from the remote machine with the only downside that the remote machine needs python installed and the local machine needs sshuttle installed.
@deanmaniatis to have the dashboard (or any other service) appear in the cluster-info list you need to add the "kubernetes.io/cluster-service=true" label to its service. Upstream dashboard is not applying this label nor do we.
Hi,
I was using microk8s and I was able to access the kubernetes dashboard by choosing "skip" in the login page. Today I removed it and installed it again (sudo snap install microk8s --classic) and also I enabled dashboard and dns (microk8s.enable dns dashboard).
The problem is now the "skip" button from the kubernetes dashboard login disappeared. I tried to use the password from the microk8s.config but I received:
Authentication failed. Please try again.
I checked the /var/snap/microk8s/current/credentials/basic_auth.csv but the password there was identical to the one that I got from the microk8s.config.
My microk8s version:
microk8s v1.15.0 671 stable canonical✓ classic
How can I access the dashboard?
I found how to get the correct token to log in:
https://github.com/ubuntu/microk8s/issues/292#issuecomment-476489147
It would be good to add this to the documentations.
i am trying to access the microk8s dashboard at:
https://myserverip:port
i first ssh to my machine using its pub ip then i run the microk8s in it.
i've enabled the dashboard,dns, and rbac.
when i search browser tyipng this:
https://myserverip:port
i get:
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {
},
"status": "Failure",
"message": "forbidden: User \"system:anonymous\" cannot get path \"/\"",
"reason": "Forbidden",
"details": {
},
"code": 403
}
anyone with the possible solution?
@ktsakalozos is right .
just label service/kubernetes-dashboard
microk8s.kubectl label service/kubernetes-dashboard kubernetes.io/cluster-service=true --namespace kube-system
then use
microk8s.kubectl cluster-info
below is the result
dev@instance-3:~$ microk8s.kubectl cluster-info
Kubernetes master is running at https://127.0.0.1:16443
Elasticsearch is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/elasticsearch-logging/proxy
Heapster is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/heapster/proxy
Kibana is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/kibana-logging/proxy
CoreDNS is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
kubernetes-dashboard is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy
Grafana is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/monitoring-grafana/proxy
InfluxDB is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/monitoring-influxdb:http/proxy
open https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy
Most helpful comment
Hello, maybe it would have been useful to add the dashboard's URL in the list returned from
kubectl cluster-infofor easier access.