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

Problem with auth scopes in metrics-server #16

Closed
crassirostris opened this issue Sep 15, 2017 · 4 comments · Fixed by kubernetes/kubernetes#53330 or #20
Closed

Problem with auth scopes in metrics-server #16

crassirostris opened this issue Sep 15, 2017 · 4 comments · Fixed by kubernetes/kubernetes#53330 or #20
Assignees

Comments

@crassirostris
Copy link

crassirostris commented Sep 15, 2017

There's something wrong with the permissions (RBAC maybe?). Example errors:

github.com/kubernetes-incubator/metrics-server/metrics/processors/namespace_based_enricher.go:85: Failed to list *v1.Namespace: namespaces is forbidden: User "system:serviceaccount:kube-system:metrics-server" cannot list namespaces at the cluster scope
github.com/kubernetes-incubator/metrics-server/metrics/processors/namespace_based_enricher.go:85: Failed to list *v1.Namespace: namespaces is forbidden: User "system:serviceaccount:kube-system:metrics-server" cannot list namespaces at the cluster scope

Kubernetes 1.8 from HEAD on GCE

/cc @piosz

@piosz piosz self-assigned this Sep 15, 2017
@piosz
Copy link
Contributor

piosz commented Sep 15, 2017

I can't reproduce in my cluster ;/

@crassirostris
Copy link
Author

@piosz I start the cluster using kubetest -up from the kubernetes directory

$ kubectl logs --namespace kube-system --tail 10 metrics-server-5dcccdfb48-xccx6                                                                                          
E0915 20:12:39.313997       1 reflector.go:199] github.com/kubernetes-incubator/metrics-server/metrics/heapster.go:254: Failed to list *v1.Pod: pods is forbidden: User "system:serviceaccount:kube-system:metrics-server" cannot list pods at the cluster scope
E0915 20:12:39.315342       1 reflector.go:199] github.com/kubernetes-incubator/metrics-server/metrics/util/util.go:52: Failed to list *v1.Node: nodes is forbidden: User "system:serviceaccount:kube-system:metrics-server" cannot list nodes at the cluster scope
E0915 20:12:39.315898       1 reflector.go:199] github.com/kubernetes-incubator/metrics-server/metrics/util/util.go:52: Failed to list *v1.Node: nodes is forbidden: User "system:serviceaccount:kube-system:metrics-server" cannot list nodes at the cluster scope
E0915 20:12:39.317000       1 reflector.go:199] github.com/kubernetes-incubator/metrics-server/metrics/util/util.go:52: Failed to list *v1.Node: nodes is forbidden: User "system:serviceaccount:kube-system:metrics-server" cannot list nodes at the cluster scope
E0915 20:12:39.318000       1 reflector.go:199] github.com/kubernetes-incubator/metrics-server/metrics/processors/namespace_based_enricher.go:85: Failed to list *v1.Namespace: namespaces is forbidden: User "system:serviceaccount:kube-system:metrics-server" cannot list namespaces at the cluster scope
E0915 20:12:40.316749       1 reflector.go:199] github.com/kubernetes-incubator/metrics-server/metrics/heapster.go:254: Failed to list *v1.Pod: pods is forbidden: User "system:serviceaccount:kube-system:metrics-server" cannot list pods at the cluster scope
E0915 20:12:40.317359       1 reflector.go:199] github.com/kubernetes-incubator/metrics-server/metrics/util/util.go:52: Failed to list *v1.Node: nodes is forbidden: User "system:serviceaccount:kube-system:metrics-server" cannot list nodes at the cluster scope
E0915 20:12:40.317623       1 reflector.go:199] github.com/kubernetes-incubator/metrics-server/metrics/util/util.go:52: Failed to list *v1.Node: nodes is forbidden: User "system:serviceaccount:kube-system:metrics-server" cannot list nodes at the cluster scope
E0915 20:12:40.318744       1 reflector.go:199] github.com/kubernetes-incubator/metrics-server/metrics/util/util.go:52: Failed to list *v1.Node: nodes is forbidden: User "system:serviceaccount:kube-system:metrics-server" cannot list nodes at the cluster scope
E0915 20:12:40.320135       1 reflector.go:199] github.com/kubernetes-incubator/metrics-server/metrics/processors/namespace_based_enricher.go:85: Failed to list *v1.Namespace: namespaces is forbidden: User "system:serviceaccount:kube-system:metrics-server" cannot list namespaces at the cluster scope

@piosz
Copy link
Contributor

piosz commented Sep 18, 2017

Oh. You did it in test env.

Looks like a problem with misconfigured RBAC in test env. I'll take a look once writing e2e test.

@charlesakalugwu
Copy link

i'm seeing the same on a fresh 1.8.0 install in my vagrant environment.

@piosz piosz changed the title Log spam in Kubernetes 1.8 Problem with auth scopes in metrics-server Oct 2, 2017
@piosz piosz closed this as completed in #20 Oct 3, 2017
@piosz piosz mentioned this issue Oct 3, 2017
k8s-github-robot pushed a commit to kubernetes/kubernetes that referenced this issue Oct 3, 2017
Automatic merge from submit-queue (batch tested with PRs 53280, 53330). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add permisions for Metrics Server to read resources on cluster level

**What this PR does / why we need it**:
Add permisions for Metrics Server to read resources on cluster level.

**Which issue this PR fixes**:
fixes kubernetes-sigs/metrics-server#16

**Release note**:
```release-note
Fix permissions for Metrics Server.
```
slashpai pushed a commit to slashpai/metrics-server that referenced this issue Aug 16, 2023
MON-3301: Sync metrics-server with upstream v0.6.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants