Skip to content

Commit 50345f2

Browse files
committed
Adds a commented out example of full cluster access for Prometheus
1 parent 1698819 commit 50345f2

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Allows the "k8s" prometheus from Prometheus Operator contrib to do service discovery in the kafka namespace
2+
---
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
kind: ClusterRole
5+
metadata:
6+
name: prometheus-k8s
7+
rules:
8+
- apiGroups:
9+
- ""
10+
resources:
11+
- services
12+
- endpoints
13+
- pods
14+
verbs:
15+
- get
16+
- list
17+
- watch
18+
---
19+
apiVersion: rbac.authorization.k8s.io/v1
20+
kind: ClusterRoleBinding
21+
metadata:
22+
name: prometheus-k8s
23+
roleRef:
24+
apiGroup: rbac.authorization.k8s.io
25+
kind: ClusterRole
26+
name: prometheus-k8s
27+
subjects:
28+
- kind: ServiceAccount
29+
name: prometheus-k8s
30+
namespace: monitoring

variants/prometheus-operator-example/k8s-kafka-rbac.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Allows the "k8s" prometheus from Prometheus Operator contrib to do service discovery iin the kafka namespace
1+
# Allows the "k8s" prometheus from Prometheus Operator contrib to do service discovery in the kafka namespace
22
---
33
apiVersion: rbac.authorization.k8s.io/v1
44
kind: Role

variants/prometheus-operator-example/kustomization.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ bases:
99
#- ../../prometheus
1010
resources:
1111
- k8s-kafka-rbac.yaml
12+
# or, to scrape all namespaces
13+
#- k8s-cluster-rbac.yaml
1214
# with base ../../prometheus
1315
#- k8s-kafka-servicemonitor.yaml
1416
# with base ../../consumers-prometheus

0 commit comments

Comments
 (0)