-
Notifications
You must be signed in to change notification settings - Fork 124
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
v1. Namespace is forbidden: User cannot list resource "namespaces" in API group. #97
Comments
I am also intermittently encountering this when running in minikube.
|
Running into this with K3s in an on-premise setup as well.. |
You have to allow the serviceaccount that you are using to list some resources from kubernetes otherwise it will fail like yours it's failing. It is failing because doesnt have the enough permissions to be able to do some actions (in th is case list all the namespaces). You can define new permissions or create anoñther serviceAccount to avoid editing the default one that comes from Kubernetes. |
What is the permissions that this app need? Do you assume that it should run as admin? |
No that's wrong, you should'nt run as admin. In my case I added the permissions: Remember that the app list all namespaces, and updates or creates secrets to that namespace with the secrets to allow that namespace to dowload the images from the private repository |
@Keralin What do you mean "in your case"? Are there different use cases? |
i only configured the
|
@ac5tin I think you are missing the api_groups = "" permission |
Any idea why would this happen? Seems like the Go app can't list the namespaces. What can I do in this case?
It is configured for AWS ECR the same registry works fine on minikube, but in dev cluster, it doesn't.
Here is the error:
`time="2020-10-21T05:10:45Z" level=info msg="Starting up..."
time="2020-10-21T05:10:45Z" level=info msg="Using AWS Account: 81xxxxxxxx"
time="2020-10-21T05:10:45Z" level=info msg="Using AWS Region: ca-central-1"
time="2020-10-21T05:10:45Z" level=info msg="Using AWS Assume Role: arn:aws:iam::81xxxxxxx:role/xxxxxxxxxx"
time="2020-10-21T05:10:45Z" level=info msg="Refresh Interval (minutes): 60"
time="2020-10-21T05:10:45Z" level=info msg="Retry Timer: simple"
time="2020-10-21T05:10:45Z" level=info msg="Token Generation Retries: 3"
time="2020-10-21T05:10:45Z" level=info msg="Token Generation Retry Delay (se
ERROR: logging before flag.Parse: E1021 05:11:37.436054 1 reflector.go:199] github.com/upmc-enterprises/registry-creds/vendor/k8s.io/client-go/tools/cache/reflector.go:94: Failed to list *v1.Namespace: namespaces is forbidden: User "system:serviceaccount:kube-system:default" cannot list resource "namespaces" in API group "" at the cluster scope`
It is on an infinite loop outputting the error above.
The text was updated successfully, but these errors were encountered: