-
Notifications
You must be signed in to change notification settings - Fork 32
/
netbox-monitoring-rbac.yaml
72 lines (72 loc) · 1.4 KB
/
netbox-monitoring-rbac.yaml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
# OLM: BEGIN ROLE
# Aspects for creation of monitoring resources
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: netbox-monitor
namespace: netbox-community
rules:
- apiGroups:
- monitoring.coreos.com
resources:
- '*'
verbs:
- '*'
# OLM: END ROLE
---
# OLM: BEGIN ROLE BINDING
# Allow creation of monitoring resources
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: netbox-monitor
namespace: netbox-community
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: netbox-monitor
subjects:
- kind: ServiceAccount
name: netbox
namespace: netbox-community
# OLM: END ROLE BINDING
---
# OLM: BEGIN ROLE
# Aspects for metrics collection
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: netbox-metrics
namespace: netbox-community
rules:
- apiGroups:
- ""
resources:
- services
- endpoints
- pods
verbs:
- get
- list
- watch
# OLM: END ROLE
---
# OLM: BEGIN ROLE BINDING
# Allow collection of metrics
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: netbox-metrics
namespace: netbox-community
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: netbox-metrics
subjects:
- kind: ServiceAccount
# change to the serviceaccount and namespace to use for monitoring
name: prometheus-k8s
namespace: monitoring
# OLM: END ROLE BINDING
---