60 lines
1.7 KiB
YAML
60 lines
1.7 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: prometheus-node-exporter
|
|
namespace: prometheus
|
|
labels:
|
|
app: prometheus-node-exporter
|
|
spec:
|
|
replicas: 5
|
|
selector:
|
|
matchLabels:
|
|
app: prometheus-node-exporter
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: prometheus-node-exporter
|
|
annotations:
|
|
prometheus.io/scrape: "true"
|
|
prometheus.io/path: '/metrics'
|
|
prometheus.io/port: "9100"
|
|
spec:
|
|
hostNetwork: true
|
|
hostPID: true
|
|
hostIPC: true
|
|
enableServiceLinks: false
|
|
topologySpreadConstraints:
|
|
- maxSkew: 1
|
|
topologyKey: kubernetes.io/hostname
|
|
whenUnsatisfiable: DoNotSchedule
|
|
labelSelector:
|
|
matchLabels:
|
|
app: prometheus-node-exporter
|
|
containers:
|
|
- name: prometheus-node-exporter
|
|
image: prom/node-exporter
|
|
args:
|
|
- "--path.rootfs=/root"
|
|
- "--path.sysfs=/host/sys"
|
|
- --collector.filesystem.ignored-mount-points=^/(dev|proc|sys|var/lib/docker/.+|var/lib/kubelet/pods/.+)($|/)
|
|
- --collector.netclass.ignored-devices=^(veth.*)$
|
|
ports:
|
|
- containerPort: 9100
|
|
protocol: TCP
|
|
volumeMounts:
|
|
- name: sys
|
|
mountPath: /host/sys
|
|
mountPropagation: HostToContainer
|
|
- name: root
|
|
mountPath: /root
|
|
readOnly: true
|
|
mountPropagation: HostToContainer
|
|
securityContext:
|
|
privileged: true
|
|
volumes:
|
|
- name: sys
|
|
hostPath:
|
|
path: /sys
|
|
- name: root
|
|
hostPath:
|
|
path: / |