Kubernetes Dashboard - Token login issue

+4 votes

Hello guys i am having some trouble with loging into dashboard with token. I was googling for 3 days and there are explained the same issues on the internet as mine but with the given answers I couldn't solve my problem. 

The problem is: I have installed kubernetes dashboard on my virtual machine. From local browser (from virtual machine) I can easy access to the dashboard with a TOKEN. I can sign in complitely fine, BUT when i want to access to the same dashboard via my computer (not the virtual machine) and i paste TOKEN to where it is required and click Sign IN nothing happens. Can someone please help me how to remotely access to my dashboaard and to solve this issue?

NOTE: Accessing to dashboard (from Virtual Machine (local) and remote from my computer) is working complitely fine but when I want to log in with a token just nothing happens. I don't know why.

I also tried some port forwarding like: ssh -L 8001:localhost:8001 root@<IP> , but did not fix my error.

Accessing localy to dashboard: http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/login

Accesing remotely to dashboard (as above, but with the IP of virtual machine): <IP>:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/login

 Thanks a lot.

Nov 21, 2018 in Kubernetes by Denis
• 270 points

edited Nov 26, 2018 by Denis 10,489 views
Hey @Denis, What does it say when you insert the token and try to sign in?
Hi @Kalgi. Actually nothing. When i click Sign In button just nothing happens. No error is displayed, there is just nothing that shows that something would be wrong.

This is how it looks like: http://prntscr.com/llgght
Alright @Denis, i'll try the same and get back to you in sometime.
Ok. Thanks a lot.
Hi , I am also facing the same issue. Anyone got the solution for this issue?

Hi Sal!

Not really. I guess that access to dashboard just isn't possible this way. 

As someone mentioned below:  It cannot be accessed from anywhere other than the master. 

3 answers to this question.

+4 votes
Best answer
answered Nov 23, 2018 by Ali
• 11,360 points

selected Nov 28, 2018 by Denis
Yeah i was already looking forward doing this.
But when you did this (the answer you posted), do you login with a TOKEN or do you click SKIP button to access into the dashboard?
You can always skip but skipping might not give you some of the accesses, so its always better to login. So its better you assign clusterRole to your dashboard and then use the token to log-in.
Ok. So if understand correctly you are remotely accessing to dashboard with a token (you dont click skip)?
Yess, I access it with my token. You've got me right @Denis.
Ok I'll try to create this new file mentioned in this answer in a few days and hope this will help me solve my problem. I'll get back to you when I'm done.
I appreciate your help. Thanks.
Cool @Denis, hope this works. Let me know :)
Hey @Kalgi. Can u please just tell what command are you using to start listening on specific port so that you can remotely access to dashboard?

I am using: kubectl proxy --address='0.0.0.0' --port=8001 --accept-hosts='^*$'

try this @Denis,

kubectl proxy --address=master-node-ip --port 8001 --accept-hosts '.*'
Still doesn't working @Kalgi. (http://prntscr.com/lngdja). Still stuck here: http://prntscr.com/lnge33

 :(  

Any other suggestions maybe?

How are you getting the token?

Try using this token:

 kubectl -n kube-system get secret |grep  kubernetes-dashboard-token |cut -f1 -d ' ' |  xargs kubectl -n kube-system describe  secret
Kalgi. I would like to thank you for your help. Now I am done with this issue. I created 1 master and 2 nodes on the same vCenter, so I am now accessing to dashboard from my master and it's working :) Thank you again.
You're welcome @Denis, always glad to help:)
Hi @Denis, when you say you're accessing your dashboard successfully from the master, do you mean from your virtual machine where the master is running or remotely?
Hello @Sarah. Yes I mean directly from my virtual machine where the master is running as you said.
I didn't find a solution for remote access.
Having same issue as me?
Yes, I have the same issue. Even I'm able to access it from the master from my virtual machine but not from my windows browser.
As far as i know, the dashboard is rigged to only work like that. It cannot be accessed from anywhere other than the master. (not even from other nodes in the cluster)

If you'll have a supporting document which says it can be accessed from else where, plz do share the link.

Sarah & Vardhan I also came to the conclusion that accessing to dashboard from anywhere other than the master won't work.

So my solution is: create 1 master (maximal linux install) and 2 nodes (minimal linux install) on the same vCenter and then accessing to my dashboard from my master, where I have installed maximal version with GUI. This is the only way to fix the problem I guess.

Greetings from edureka! Community.

We have reviewed your post and have concluded there is no reason for your post to be flagged. Hence, we have cleared the flag.

Continue to Ask, Learn & Collaborate!

+2 votes

Dashboard should not be exposed publicly using kubectl proxy command as it only allows HTTP connection. For domains other than localhost and 127.0.0.1 it will not be possible to sign in. Nothing will happen after clicking Sign in button on login page.

answered Nov 23, 2018 by Kalgi
• 52,350 points
Thank you for answer and taking your time!
0 votes
Hey @Denis, I did a little more research and found out that your firewall might be disabled which might not let you log-into your dashboard. Could you check if your firewall is enabled?
answered Dec 20, 2018 by Kalgi
• 52,350 points
Hi. What do you mean? Firewall on my local machine or virtual machines?

On my local machine it is enabled but on my virtual machines I had disable it (on master and node).
That's what Kalgi is saying. It should be disabled in VM. But for you, its not working inspite of that right?

Related Questions In Kubernetes

0 votes
1 answer

Whenever I open Kubernetes dashboard , it ask for token. How to fix it ?

This article will help you. https://www.google.co.in/amp/s/www.edureka.co/blog/install-kubernetes-on-ubuntu/amp/ You have to ...READ MORE

answered Sep 21, 2020 in Kubernetes by Jai

edited Oct 6, 2021 by Sarfaraz 840 views
0 votes
3 answers

Kubernetes dashboard status-CrashLoopBackOff

I had the same issue, struggled for days. ...READ MORE

answered Apr 24, 2019 in Kubernetes by Bebo
9,138 views
0 votes
1 answer

Kubernetes Dashboard v1.8.3 deployment

You’ve created your ServiceAccount on a different ...READ MORE

answered Aug 27, 2018 in Kubernetes by Kalgi
• 52,350 points
1,022 views
0 votes
1 answer

Error while creating kubernetes dashboard

The installation fails because there is no ...READ MORE

answered Aug 27, 2018 in Kubernetes by Kalgi
• 52,350 points
1,942 views
+1 vote
1 answer

Unable to access kubernetes dashboard

You’re trying to access a private IP. ...READ MORE

answered Aug 27, 2018 in Kubernetes by Kalgi
• 52,350 points
3,023 views
+1 vote
2 answers

Accessing Kubernetes Web UI (Dashboard)

To access Kubernetes dashboard, you need to ...READ MORE

answered Apr 16, 2019 in Kubernetes by Ray
2,403 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
15,617 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,079 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP