kubernetes: User "system:anonymous" cannot proxy services in the namespace "default".
What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.): User “system:anonymous” cannot proxy services in the namespace “default”.
Kubernetes version (use kubectl version):
~kubectl version --short
Client Version: v1.6.0-alpha.0.2996+add3a08a6d3648
Server Version: v1.6.0-alpha.0.2996+add3a08a6d3648
Environment:
- Cloud provider or hardware configuration: GCE
What happened: Unable to access services via the proxy endpoint.
What you expected to happen: The service to be accessible via /api/v1/proxy/…
How to reproduce it (as minimally and precisely as possible):
- Check out sources from HEAD
- make quick-release
- cluster/kube-up.sh
Cannot access any service via the proxy (see kubectl cluster-info for some examples), for example:
~ curl -k https://<server>/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard
User "system:anonymous" cannot proxy services in the namespace "kube-system".
Anything else do we need to know: This is a regression from 1.5.1.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 11
- Comments: 39 (20 by maintainers)
I’ve made similar arguments. I completely, totally, 100% believe that moving from “single use mode” to “multi-user” clusters is the right thing to do, and we should do it ASAP (last year, if possible). It is going to hurt a LOT of people, and we need to respect that and allow users to opt-out for quite a while. We also need REALLY good docs, and error messages that can be googled along with SEO’ed solutions to those error messages.
Writing code is easy, rolling it out is hard.
@mml
On Wed, Jan 11, 2017 at 10:26 AM, CJ Cullen notifications@github.com wrote:
The user experience is still weird here IMO. I booted a cluster via
./kube-up.shand it presents me with those grafana, heapster urls and there is little or no documentation about how I can access them.Just clicking those urls presents me with - “User “system:anonymous” cannot proxy services in the namespace “default”.” error.
If kubernetes knows that the grafana, heapster urls that it is printing on terminal at the end of
kube-up.shcommand are inaccessible, it should at very minimum point me to instructions about how to open them.I think, we should keep this bug open.
From a UX perspective, I think instead of printing those URLs, we should be recommending that
kubectl proxybe run and then those endpoints be accessed through the local proxy.@liggitt @thockin I have the latest 1.6.4 Kubernetes installed on my GCP cluster but cannot figure out how to expose it on an IP Address. How do I make it so that I don’t need shell access and instead can access kubernetes in the browser.
User “system:anonymous” cannot get at the cluster scope.: “Unknown user "system:anonymous"”
I think we need to dig deeper into our 1.5->1.6 permissions story.
I agree that the vast permissions granted by ABAC are terrible and we should do whatever we can to push 1.6 users to set up sane permissions w/ RBAC.
But… We shouldn’t break existing functionality on an upgrade to 1.6 (even if that functionality is something awful like “I need some random service account to be able to exec into system pods”). This could either be a bootstrap one-shot on upgrade to mimic ABAC permissions w/ RBAC bindings (hard, not always possible) or a flag that allows ABAC to stay on (easy, but kinda disappointing).
We also should (maybe) provide an option to create new clusters with the pre-1.6 permission model. Many people have workflows of “Create a cluster at whatever version is released, do a bunch of stuff, tear the cluster down.” It’d be nice to give them a nice path forward. That might be “figure out the permissions you actually need and add the bindings in your CI script”, or it could just be “set this hacky environment variable to keep ABAC until you figure out the right way.”
It looks like https://github.com/kubernetes/kubernetes/pull/39537/files may be a step towards providing a smoother transition, so I’m guessing @deads2k and @liggitt and others have probably put some thought into this already and I’m just catching up.
Dashboard documentation now directs users to use
kubectl proxyand access the dashboard at http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/https://github.com/kubernetes/dashboard/#documentation also links to the various ways to expose the dashboard at https://github.com/kubernetes/dashboard/wiki/Accessing-dashboard
/close
@drgomesp the top of the dashboard setup instructions links to https://github.com/kubernetes/dashboard/wiki/Access-control which explains how to set up access control for the dashboard and also explains a bit more why things don’t have access out of the box since 1.7. You can follow the instructions at the bottom to create a ClusterRoleBinding for the dashboard’s service account (heed the warnings too though).
@liggitt yes absolutely, everything works fine except from the dashboard. 😕
That isn’t actually the same result… that message is coming from the dashboard (which you successfully accessed) attempting to make an API call. As of https://github.com/kubernetes/kubernetes/pull/46750, GKE deployments do not give RBAC permissions to the default service account.
If you got a 404, then the issue wasn’t authentication (which returns a 401) or authorization (which returns a 403)… the item being accessed just didn’t exist.
You are correct, that is what is happening.
@liggitt i’m facing the same problems but i think you can’t change the api-server parameters (anonymous-auth=false) if you run your cluster on GCE (because google is managing the master node for you).
as i wrote in another issue: https://github.com/kubernetes/dashboard/issues/1728#issuecomment-292953096
So starting the apiserver with the --anonymous-auth=false flag doesn’t solve this problem