forked from m-kraus/prometheus-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnode-exporter.yaml
72 lines (71 loc) · 2.17 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
# 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 -n [NAMESPCACE] hostaccess
# in order for the node-exporter to access the host network and mount /proc and /sys from the host
- apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: prometheus-node-exporter
labels:
app: prometheus-node-exporter
role: monitoring
namespace: infra-prometheus
#prom-monitoring
spec:
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
name: prometheus-node-exporter
name: prometheus-node-exporter
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "9100"
spec:
serviceAccountName: prometheus-node-exporter
hostNetwork: true
hostPID: true
containers:
# Note: labels are renamed with V0.16.0 -> other dashboards needed!
- image: prom/node-exporter:v0.16.0
args:
- "--path.procfs=/proc"
- "--path.sysfs=/sys"
- "--collector.filesystem.ignored-mount-points"
- "^/(rootfs/)?(sys|proc|dev|host|etc|var|run).*"
name: prometheus-node-exporter
ports:
- containerPort: 9100
name: scrape
resources:
limits:
cpu: 50m
memory: 100Mi
requests:
# minimal setting for cluster are sufficient
cpu: 10m
memory: 30Mi
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