Skip to content

Commit

Permalink
fix(metrics): add permissions for usage/utilization metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
basti1302 committed Dec 2, 2024
1 parent 8dd92e2 commit 5fb536e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ rules:
- get
- list
- watch
- apiGroups:
- ""
resources:
- nodes/proxy
verbs:
- get
- apiGroups:
- apps
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ cluster roles should match snapshot:
- get
- list
- watch
- apiGroups:
- ""
resources:
- nodes/proxy
verbs:
- get
- apiGroups:
- apps
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ receivers:
kubeletstats:
auth_type: serviceAccount
collection_interval: 20s
endpoint: ${env:K8S_NODE_NAME}:10250
endpoint: '${env:K8S_NODE_NAME}:10250'
node: '${env:K8S_NODE_NAME}'
k8s_api_config:
auth_type: serviceAccount
metrics:
# deprecated -> container.cpu.usage
container.cpu.utilization:
Expand Down
8 changes: 8 additions & 0 deletions internal/backendconnection/otelcolresources/desired_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,14 @@ func assembleClusterRoleForDaemonSet(config *oTelColConfig) *rbacv1.ClusterRole
},
Verbs: []string{"get", "watch", "list"},
},
{
APIGroups: []string{""},
Resources: []string{
// required for Kubeletstats receiver ({request|limit}_utilization metrics)
"nodes/proxy",
},
Verbs: []string{"get"},
},
{
APIGroups: []string{"apps"},
Resources: []string{"replicasets"},
Expand Down

0 comments on commit 5fb536e

Please sign in to comment.