Skip to content

Commit

Permalink
Add watch permission for pods in UI (#2110)
Browse files Browse the repository at this point in the history
The collector metrics package in the UI backend uses a watch for the
collector pods.
Initially, it had `watch` permission for pods but somewhere it got
reverted which resulted in the error:
```
Collector metrics: Error running delete watcher: unknown (get pods)
```
  • Loading branch information
RonFed authored Jan 1, 2025
1 parent 484a90f commit 7ad98e8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cli/cmd/resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ In this doc, we'll keep track of the permissions requested across different reso
| Collector | "" | endpoints | get, list, watch | Needed for load balancer. |
| Collector | policy | podsecuritypolicies | use | Supports clients enabling pod security policies (optional). |
| UI | "" | namespaces | get, list, patch | Required to retrieve and modify namespace configurations during instrumentation. |
| UI | "" | services, pods | get, list | Required for discovering potential destinations and describing application workloads. |
| UI | "" | services | get, list | Required for discovering potential destinations and describing application workloads. |
| UI | "" | pods | get, list, watch | Required for discovering potential destinations and describing application workloads, and for updating collector metrics. |
| UI | apps | deployments, statefulsets, daemonsets | get, list, patch, update | Needed for application instrumentation. |
| UI | apps | replicasets | get, list | Used for describing source and application configurations. |
| UI | odigos.io | instrumentedapplications, instrumentationinstances, instrumentationconfigs | get, list, watch | Used to retrieve and monitor instrumented applications and configurations. |
Expand Down
9 changes: 7 additions & 2 deletions cli/cmd/resources/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,16 @@ func NewUIClusterRole() *rbacv1.ClusterRole {
Verbs: []string{"get", "list"},
},
{ // Need "services" for "Potential Destinations"
// Need "pods" for "Describe Source"
APIGroups: []string{""},
Resources: []string{"services", "pods"},
Resources: []string{"services"},
Verbs: []string{"get", "list"},
},
{ // Need "pods" for "Describe Source"
// for collector metrics - watch and list collectors pods
APIGroups: []string{""},
Resources: []string{"pods"},
Verbs: []string{"get", "list", "watch"},
},
{ // Needed to read Odigos entities
APIGroups: []string{"odigos.io"},
Resources: []string{"instrumentedapplications", "instrumentationinstances", "instrumentationconfigs"},
Expand Down
7 changes: 7 additions & 0 deletions helm/odigos/templates/ui/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,17 @@ rules:
- ''
resources:
- services
verbs:
- get
- list
- apiGroups:
- ''
resources:
- pods
verbs:
- get
- list
- watch
- apiGroups:
- odigos.io
resources:
Expand Down

0 comments on commit 7ad98e8

Please sign in to comment.