-
Notifications
You must be signed in to change notification settings - Fork 0
/
mon-collector-rbac.yml
51 lines (51 loc) · 1.34 KB
/
mon-collector-rbac.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
apiVersion: v1
kind: ServiceAccount
metadata:
name: mon-collector
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: mon-collector
rules:
- apiGroups: [""] # indicates the core API group
resources: ["pods", "pods/log","nodes","namespaces","persistentvolumes","persistentvolumeclaims"]
verbs: ["get", "list", "watch"]
- apiGroups: ["apps"]
resources: ["deployments","statefulsets","daemonsets"]
verbs: ["get", "list", "watch"]
- apiGroups: ["batch.v1beta1","batch"]
resources: ["cronjobs"]
verbs: ["get", "list", "watch"]
- apiGroups: ["networking.k8s.io"]
resources: ["ingresses"]
verbs: ["get", "list", "watch"]
- apiGroups: ["metrics.k8s.io"]
resources: ["pods","nodes"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: mon-collector-rb
subjects:
- kind: ServiceAccount
name: mon-collector
roleRef:
kind: ClusterRole
name: mon-collector
apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
# This cluster role binding allows anyone in the "manager" group to read secrets in any namespace.
kind: ClusterRoleBinding
metadata:
name: mon-collector-cb
subjects:
- kind: ServiceAccount
name: mon-collector
namespace: monitoring
roleRef:
kind: ClusterRole
name: mon-collector
apiGroup: rbac.authorization.k8s.io