Skip to content

Commit 8278415

Browse files
committed
Gives custom a specific SA, like k8s gets by default
1 parent f04cb61 commit 8278415

File tree

5 files changed

+45
-35
lines changed

5 files changed

+45
-35
lines changed

custom-prometheus/prometheus-cluster-role-binding.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

custom-prometheus/prometheus-cluster-role.yaml

Lines changed: 0 additions & 18 deletions
This file was deleted.

custom-prometheus/prometheus-service-account.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

custom-prometheus/prometheus.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
prometheus: custom
77
spec:
88
replicas: 1
9-
serviceAccountName: prometheus
9+
serviceAccountName: prometheus-custom
1010
serviceMonitorSelector:
1111
alerting:
1212
alertmanagers:

custom-prometheus/rbac.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: prometheus-custom
6+
namespace: monitoring
7+
annotations:
8+
manifest-origin: github.com/Yolean/kubernetes-monitoring
9+
---
10+
apiVersion: rbac.authorization.k8s.io/v1beta1
11+
kind: ClusterRole
12+
metadata:
13+
name: monitoring-by-prometheus-annotations
14+
annotations:
15+
manifest-origin: github.com/Yolean/kubernetes-monitoring
16+
rules:
17+
- apiGroups: [""]
18+
resources:
19+
- nodes
20+
- services
21+
- endpoints
22+
- pods
23+
verbs: ["get", "list", "watch"]
24+
- apiGroups: [""]
25+
resources:
26+
- configmaps
27+
verbs: ["get"]
28+
- nonResourceURLs: ["/metrics"]
29+
verbs: ["get"]
30+
---
31+
apiVersion: rbac.authorization.k8s.io/v1beta1
32+
kind: ClusterRoleBinding
33+
metadata:
34+
name: monitoring-by-prometheus-annotations
35+
annotations:
36+
manifest-origin: github.com/Yolean/kubernetes-monitoring
37+
roleRef:
38+
apiGroup: rbac.authorization.k8s.io
39+
kind: ClusterRole
40+
name: monitoring-by-prometheus-annotations
41+
subjects:
42+
- kind: ServiceAccount
43+
name: prometheus-custom
44+
namespace: monitoring

0 commit comments

Comments
 (0)