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

v2.0.0-rc4 : Cannot login on localhost anymore #4887

Closed
SiliconKid opened this issue Feb 7, 2020 · 4 comments · Fixed by #4888
Closed

v2.0.0-rc4 : Cannot login on localhost anymore #4887

SiliconKid opened this issue Feb 7, 2020 · 4 comments · Fixed by #4888
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@SiliconKid
Copy link

Environment

Windows 10 Pro, Docker for Desktop, clean K8s cluster that has just been reset completely.

Installation method: 

1. Deployed metrics server to cluster as per:  https://github.com/kubernetes-sigs/metrics-server
2. Deployed dashboard to cluster using: 

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-rc4/aio/deploy/recommended.yaml

3. Setup account and role binding as per: https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md

4. Used powershell script to get token as follows:

kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | sls admin-user | ForEach-Object { $_ -Split '\s+' } | Select -First 1)

Kubernetes version: 

Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.5", GitCommit:"20c265fef0741dd71a66480e35bd69f18351daea", GitTreeState:"clean", BuildDate:"2019-10-15T19:16:51Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.5", GitCommit:"20c265fef0741dd71a66480e35bd69f18351daea", GitTreeState:"clean", BuildDate:"2019-10-15T19:07:57Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}

Dashboard version: 2.0.0-rc4
Operating system: Windows 10 Pro
Node.js version ('node --version' output): Not applicable
Go version ('go version' output): Not applicable
Steps to reproduce

Deploy v2.0.0-rc4 as per steps described above, run kubectl proxy to start dashboard listening on localhost:8001 and then open the dashboard and attempt to login using this URL:

http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/.

Observed result

Login page opens as expected and asks for a token as expected.

After running the powershell script to retrieve a valid token, as always done before with previous versions of the dashboard, I paste the token into the Dashboard login page and hit login.

Dashboard does not respond and does nothing.

Expected result

Dashboard should accept the token and login, like it always has in the past.

Comments

This behaviour is odd because this is a completely fresh and clean cluster and the rest of the environment on this machine has not changed much at all since v2.0.0-rc3.

Everything deploys correctly and does what I expect it to do up until I hit the Login button and then I just get no response.

This is all hosted on localhost and all access etc. is localhost.

@SiliconKid SiliconKid added the kind/bug Categorizes issue or PR as related to a bug. label Feb 7, 2020
@SiliconKid
Copy link
Author

I've just tried changing the service type to NodePort for the dashboard and then accessed it directly that way and now it's working and it accepted the token.

It did, however, complain that my connection was not secure, and I just overrode that, and it logged me in and opened the dashboard anyway.

@floreks
Copy link
Member

floreks commented Feb 7, 2020

The only reason why Dashboard would do nothing on login view when providing token is if you are using some ip address to access it instead of localhost or 127.0.0.1. It was already mentioned dozens of time why it will not work.

On the other hand it might have something to do with new chrome policy about cookies. We have to check that.

@kubernetes kubernetes deleted a comment from k8s-ci-robot Feb 7, 2020
@floreks floreks reopened this Feb 7, 2020
@SiliconKid
Copy link
Author

I am NOT accessing the dashboard from an external IP address.

I am accessing it from LOCALHOST, as explicitly stated in the bug report.

It is not working on LOCALHOST. I researched this before I posted the bug report and I saw the previous bug reports related to non LOCALHOST access attempts, which is why I specified that this is a LOCALHOST problem.

@floreks
Copy link
Member

floreks commented Feb 7, 2020

Ok, I believe you, sorry for misinterpretation from my side. There were many issues where people were saying that they are accessing it using localhost and in the end, it was some local ip instead. I had to clarify that part.

It has to be related to chrome requiring SameSite cookies and that this url is a proxy url.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants