Skip to content

no premisstion #81

Description

@13567436138

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions