Files
home-cluster-ops/infrastructures/prometheus-exporters/env/k3s-cluster/node-exporter.yaml
2024-09-25 21:27:00 +10:00

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: 2
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: /