Skip to content

Commit

Permalink
Adds a commented out example of full cluster access for Prometheus
Browse files Browse the repository at this point in the history
  • Loading branch information
solsson committed May 27, 2019
1 parent 1698819 commit 50345f2
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
30 changes: 30 additions & 0 deletions variants/prometheus-operator-example/k8s-cluster-rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Allows the "k8s" prometheus from Prometheus Operator contrib to do service discovery in the kafka namespace
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: prometheus-k8s
rules:
- apiGroups:
- ""
resources:
- services
- endpoints
- pods
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: prometheus-k8s
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: prometheus-k8s
subjects:
- kind: ServiceAccount
name: prometheus-k8s
namespace: monitoring
2 changes: 1 addition & 1 deletion variants/prometheus-operator-example/k8s-kafka-rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Allows the "k8s" prometheus from Prometheus Operator contrib to do service discovery iin the kafka namespace
# Allows the "k8s" prometheus from Prometheus Operator contrib to do service discovery in the kafka namespace
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand Down
2 changes: 2 additions & 0 deletions variants/prometheus-operator-example/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ bases:
#- ../../prometheus
resources:
- k8s-kafka-rbac.yaml
# or, to scrape all namespaces
#- k8s-cluster-rbac.yaml
# with base ../../prometheus
#- k8s-kafka-servicemonitor.yaml
# with base ../../consumers-prometheus
Expand Down

0 comments on commit 50345f2

Please sign in to comment.