Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't sign in into dashboard #2735

Closed
TriggMineAdmin opened this issue Jan 5, 2018 · 13 comments
Closed

Can't sign in into dashboard #2735

TriggMineAdmin opened this issue Jan 5, 2018 · 13 comments

Comments

@TriggMineAdmin
Copy link

Dashboard version: 1.8.1
Kubernetes version:  1.9.0
Operating system: Ubuntu Ubuntu 16.04.3 LTS
Steps to reproduce
  1. Clean installation of kubernetes cluster
  2. kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
  3. Take token by this manual https://github.com/kubernetes/dashboard/wiki/Access-control
    kubectl -n kube-system get secret
    kubectl -n kube-system describe secret kubernetes-dashboard-token-lx6wf
  4. kubectl proxy --address='0.0.0.0' --port=8001 --accept-hosts='^*$' (only for test)
  5. Open http://myip:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/login
  6. Change radio to "Token" and paste token from step 3
Observed result

When i press "Sign in" nothing happens.
Browser console:

image

@floreks
Copy link
Member

floreks commented Jan 5, 2018

Duplicate of #2524 and possibly some others.

https://github.com/kubernetes/dashboard/wiki/Accessing-Dashboard---1.7.X-and-above

NOTE: 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.

@floreks floreks closed this as completed Jan 5, 2018
@idevz
Copy link

idevz commented Jan 16, 2018

cool,thanks :)

@ashish235
Copy link

Cool. I 'm the same issue. So that being said, how do I access the dashboard if not by kubectl proxy? I 'm using AWS instances, so can't have a web interface on localhost.

On the dashboard URL, returned from cluster-info, I 'm not getting any login page, just unauthorized in json.

@rpocklington
Copy link

Seconding ashish235's comment.

@lbbc1117
Copy link

@ashish235 same issue

@fpoms
Copy link

fpoms commented Jul 5, 2018

I had the same issue as @ashish235. How I solved it:

Run kubectl proxy as normal on your AWS instance. Now, on your local machine, port forward the proxy port (usually 8001) so that you can access it from localhost:

ssh -L 8001:localhost:8001 <user@server-ip>

You should now be able to access the dashboard using your browser at http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/login

@sunilram86
Copy link

sunilram86 commented Aug 31, 2018

@apoms - the above solution works like a charm... I used the same approach for accessing the dashboard built for my EKS cluster... I had installed kubectl, config , dashboard on a AWS server so that my team can ssh into it via jump box. After port forwarding it, can open it via local machine on a browser.

@ysjiang4869
Copy link

Let me have a summary:
if you use recommend yaml to deploy dashboard, you should only access your dashboard by https , and you should generete you certs, refer to guide
then , you can run kubectl proxy --address='0.0.0.0' --accept-hosts='^*$' to visit dashboard on "http://localhost:8001/ui" . This page need to login use token, generete refer to this page. Also you can add NodePort to you yaml and access to it use :

if you deploy use http alternative method, you can only access your dashboard by <nodeip>:<port>, remeber to add it to yaml first!!
After deploy, you should also generate you token and add header Authorization: Bearer <token> for every request.

The offical wiki is a little bit confused so I reordered it here.

@YanB25
Copy link

YanB25 commented Mar 19, 2019

Thank you very much. They help.
Also, I think it could be better if an error message show up when I click sign up and fail.

@floreks
Copy link
Member

floreks commented Mar 19, 2019

if you deploy use http alternative method, you can only access your dashboard by :, remeber to add it to yaml first!!
After deploy, you should also generate you token and add header Authorization: Bearer for every request.

That is not correct. Alternative method is there if user wants to use his own reverse proxy and external IdP to configure access to the cluster.

@balajipothula
Copy link

Thank you so much apoms
I spend a lot of time. Love you buddy :)

@develar
Copy link

develar commented Jun 22, 2019

So, it is not possible to use k8s dashboard and multipass without such hacks or extra configuration. So, Kubernetic can be an alternative, you just need to configure local kubectl:

multipass exec build-service -- /snap/bin/microk8s.config > ~/.kube/config

(to install kubectl on macOS: brew install kubectl).

@pingoleon108
Copy link

You need just 2 commands:

$ kubectl port-forward svc/kubernetes-dashboard -n kube-system 6443:443

ssh -i EC2KeyPair.pem ec2-user@IP -L 6443:127.0.0.1:6443

@kubernetes kubernetes deleted a comment from korncola May 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests