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

no premisstion #81

Open
13567436138 opened this issue Jan 12, 2025 · 0 comments
Open

no premisstion #81

13567436138 opened this issue Jan 12, 2025 · 0 comments

Comments

@13567436138
Copy link

time="2025-01-12T05:05:16Z" level=error msg="received error while fetching metrics: nodes is forbidden: User "system:serviceaccount:loadwatcher:default" cannot list resource "nodes" in API group "" at the cluster scope" func="github.com/paypal/load-watcher/pkg/watcher.(*Watcher).StartWatching.func1" file="/go/src/github.com/paypal/load-watcher/pkg/watcher/watcher.go:136"
time="2025-01-12T05:05:16Z" level=error msg="received error while fetching metrics: nodes is forbidden: User "system:serviceaccount:loadwatcher:default" cannot list resource "nodes" in API group "" at the cluster scope" func="github.com/paypal/load-watcher/pkg/watcher.(*Watcher).StartWatching.func1" file="/go/src/github.com/paypal/load-watcher/pkg/watcher/watcher.go:136"
time="2025-01-12T05:05:16Z" level=error msg="received error while fetching metrics: nodes is forbidden: User "system:serviceaccount:loadwatcher:default" cannot list resource "nodes" in API group "" at the cluster scope" func="github.com/paypal/load-watcher/pkg/watcher.(*Watcher).StartWatching.func1" file="/go/src/github.com/paypal/load-watcher/pkg/watcher/watcher.go:136"

I have added

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: metrics-reader
rules:
- apiGroups: ["metrics.k8s.io"]  
  resources: ["nodes"]         
  verbs: ["get", "list", "watch"]  
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: metrics-reader-binding
subjects:
- kind: ServiceAccount
  name: default
  namespace: loadwatcher
roleRef:
  kind: ClusterRole
  name: metrics-reader 
  apiGroup: rbac.authorization.k8s.io
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

1 participant