Skip to content

Commit bc7ac4c

Browse files
committed
Got the PrometheusCR roles and base TA roles mixed up - fixed it now.
1 parent 1c39a4d commit bc7ac4c

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

cmd/otel-allocator/README.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -148,27 +148,6 @@ If you omit the `ServiceAccount` name, the TargetAllocator creates a `ServiceAcc
148148

149149
The role below will provide the minimum access required for the Target Allocator to query all the targets it needs based on any Prometheus configurations:
150150

151-
```yaml
152-
apiVersion: rbac.authorization.k8s.io/v1
153-
kind: ClusterRole
154-
metadata:
155-
name: opentelemetry-targetallocator-cr-role
156-
rules:
157-
- apiGroups:
158-
- monitoring.coreos.com
159-
resources:
160-
- servicemonitors
161-
- podmonitors
162-
verbs:
163-
- '*'
164-
- apiGroups: [""]
165-
resources:
166-
- namespaces
167-
verbs: ["get", "list", "watch"]
168-
```
169-
170-
If you enable the the `prometheusCR` (set `spec.targetAllocator.prometheusCR.enabled` to `true`) in the `OpenTelemetryCollector` CR, you will also need to define the following roles. These give the TargetAllocator access to the `PodMonitor` and `ServiceMonitor` CRs. It also gives namespace access to the `PodMonitor` and `ServiceMonitor`.
171-
172151
```yaml
173152
apiVersion: rbac.authorization.k8s.io/v1
174153
kind: ClusterRole
@@ -201,6 +180,27 @@ rules:
201180
verbs: ["get"]
202181
```
203182

183+
If you enable the the `prometheusCR` (set `spec.targetAllocator.prometheusCR.enabled` to `true`) in the `OpenTelemetryCollector` CR, you will also need to define the following roles. These give the TargetAllocator access to the `PodMonitor` and `ServiceMonitor` CRs. It also gives namespace access to the `PodMonitor` and `ServiceMonitor`.
184+
185+
```yaml
186+
apiVersion: rbac.authorization.k8s.io/v1
187+
kind: ClusterRole
188+
metadata:
189+
name: opentelemetry-targetallocator-cr-role
190+
rules:
191+
- apiGroups:
192+
- monitoring.coreos.com
193+
resources:
194+
- servicemonitors
195+
- podmonitors
196+
verbs:
197+
- '*'
198+
- apiGroups: [""]
199+
resources:
200+
- namespaces
201+
verbs: ["get", "list", "watch"]
202+
```
203+
204204
> ✨ The above roles can be combined into a single role.
205205

206206

0 commit comments

Comments
 (0)