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

Cannot access dashboard with no error #2540

Closed
jhcpokemon opened this issue Nov 3, 2017 · 10 comments
Closed

Cannot access dashboard with no error #2540

jhcpokemon opened this issue Nov 3, 2017 · 10 comments

Comments

@jhcpokemon
Copy link

Environment
Dashboard version:1.7.1
Kubernetes version:1.8.1
Operating system:CentOS 7.4.1708
Node.js version:
Go version:
Steps to reproduce

1.use kubeadm,install k8s 1.8.1,all green
2.deploy influxdb,grafana,heapster and up
2. kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml deply dashboard
3.goto http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
4.type in token in kubernetes-dashboard-token-xxxxx secret

Observed result

The dashboard login page has no response,.and dashboard log show that
2017/11/03 07:29:41 [2017-11-03T07:29:41Z] Outcoming response to 10.244.0.1:47609 with 200 status code 2017/11/03 07:29:41 [2017-11-03T07:29:41Z] Incoming HTTP/2.0 GET /api/v1/login/status request from 10.244.0.1:47609: {} 2017/11/03 07:29:41 [2017-11-03T07:29:41Z] Outcoming response to 10.244.0.1:47609 with 200 status code

Expected result

I expected to entry dashboard.

Comments
@maciaszczykm
Copy link
Member

4.type in token in kubernetes-dashboard-token-xxxxx secret

What exactly have you done in this step? You should copy one of secrets' token.

@jhcpokemon
Copy link
Author

I typed in the token of kubernetes-dashboard-token-jn7tx
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJrdWJlcm5ldGVzLWRhc2hib2FyZC10b2tlbi1qbjd0eCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjQ4OTU2Zjg4LWMwNmQtMTFlNy1hMmYwLTAwMGMyOWNhM2Y5MSIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDprdWJlLXN5c3RlbTprdWJlcm5ldGVzLWRhc2hib2FyZCJ9.Q2o2pjdi65hwcZGntEuvT5ivbPAFpzbzLxkxDdepkPUtJKEQRMGGJUeyVOXWTXk2FMo6ZotTwX8_Up8qgt_nVcXllOktbQ9-OnP2DOn4J-3-bPSRgCd7BB7WUcZu1qZVyRlANsYyyhLLEOcdupcJTBAcM1aBrtePRLDKVSGT66IruTwBOs6jyU87Y4Jhm122qKMdLmDCDrVs64zBo0gqXUq-MO8cSuppBzzejZUuwvf6SPJZy95MSp8c54M1Ars_ncS8d74CXbZKyX-dPtsmjbt_9nkzb_21FegUo5F35u3-qJY3eOmnEr25Z8G47KYmWXCGP1T3PuVcHINQdbTB4w

@jhcpokemon
Copy link
Author

jhcpokemon commented Nov 3, 2017

I edit kubernetes-dashboard service,change the service type from ClusterIP to NodePort,and access dashboard with the ip and port instead of the proxy,in this case,everything is ok.

@gabrielfsousa
Copy link

gabrielfsousa commented Nov 7, 2017

change the service type from ClusterIP to NodePort wont work for me :( i cant telnet to he port :(

@maciaszczykm
Copy link
Member

@jhcpokemon What happens after filling token and confirming it with Sign In button?

@jhcpokemon
Copy link
Author

jhcpokemon commented Nov 9, 2017

What happens after filling token and confirming it with Sign In button

Nothing happend,and no error in the chrome console.

@floreks
Copy link
Member

floreks commented Nov 9, 2017

Nothing happend,and no error in the chrome console.

This can only happen if you are exposing Dashboard using kubectl proxy and trying to access it from other machine, not using localhost or 127.0.0.1 as domain.

@jhcpokemon
Copy link
Author

Yes,I run the kubernetes cluster in my centos 7 virtual machine,and access the dashboard with the vm's IP,like this 192.168.189.129:9090/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/login

@floreks
Copy link
Member

floreks commented Nov 10, 2017

Then this is the real reason. Your initial description was misleading:

3.goto
http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/

Logging in is only available when accessing Dashboard over HTTPS or when domain is either localhost or 127.0.0.1. It's done this way for security reasons. Closing as this works as intended.

It is mentioned in our documentation:

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.

@prashantrakheja
Copy link

@floreks I exposed the dashboard publicly which is running on my CentOS VM and can't sign in as it is over HTTP. How do I expose the dashboard over HTTPS ?

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

5 participants