-
Notifications
You must be signed in to change notification settings - Fork 4.7k
/
Copy pathnode-exporter.yaml
83 lines (83 loc) · 2.22 KB
/
node-exporter.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
73
74
75
76
77
78
79
80
81
82
83
# node-exporter is an optional component that collects host level metrics from the nodes
# in the cluster. This group of resources will require the 'hostaccess' level of privilege, which
# should only be granted to namespaces that administrators can access.
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: ServiceAccount
metadata:
name: prometheus-node-exporter
# You must grant hostaccess via: oc adm policy add-scc-to-user -z prometheus-node-exporter hostaccess
# in order for the node-exporter to access the host network and mount /proc and /sys from the host
- apiVersion: v1
kind: Service
metadata:
annotations:
prometheus.io/scrape: "true"
labels:
app: prometheus-node-exporter
name: prometheus-node-exporter
spec:
clusterIP: None
ports:
- name: scrape
port: 9100
protocol: TCP
targetPort: 9100
selector:
app: prometheus-node-exporter
- apiVersion: apps/v1
kind: DaemonSet
metadata:
name: prometheus-node-exporter
labels:
app: prometheus-node-exporter
role: monitoring
spec:
selector:
matchLabels:
app: prometheus-node-exporter
role: monitoring
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
app: prometheus-node-exporter
role: monitoring
name: prometheus-exporter
spec:
serviceAccountName: prometheus-node-exporter
hostNetwork: true
hostPID: true
containers:
- image: openshift/prometheus-node-exporter:v0.16.0
args:
- "--path.procfs=/host/proc"
- "--path.sysfs=/host/sys"
name: node-exporter
ports:
- containerPort: 9100
name: scrape
resources:
requests:
memory: 30Mi
cpu: 100m
limits:
memory: 50Mi
cpu: 200m
volumeMounts:
- name: proc
readOnly: true
mountPath: /host/proc
- name: sys
readOnly: true
mountPath: /host/sys
volumes:
- name: proc
hostPath:
path: /proc
- name: sys
hostPath:
path: /sys