1# ============================================================================= 2# node-exporter (TASK-0135, phase-15) — DaemonSet, ns `monitoring`. 3# 4# EXPECTED-PRESENT infrastructure: the DiskUsageHigh alert (the spec's six) 5# reads node_filesystem_usage, and the Infra dashboard's CPU/mem/disk panels 6# need it. Without a node exporter those panels/alerts are silently empty. 7# Decision (recorded in the TASK-0135 report): ship the daemonset so the 8# spec's alert is actionable in staging, rather than leaving the alert 9# permanently dead. 10# 11# hostPath mounts are read-only + hostNetwork for /proc, /sys, / mount — the 12# standard node-exporter security profile (the container still runs 13# non-root; /proc and /sys are world-readable). 14# Image pinned: prom/node-exporter:v1.7.0 (the 1.7 line — 15# node_filesystem_usage is a 1.x-era metric name; the v1.8+ image renamed 16# nothing we use, but 1.7 is the line the alert's expr targets). 17# ============================================================================= 18apiVersion: apps/v1 19kind: DaemonSet 20metadata: 21 name: node-exporter 22 namespace: monitoring 23 labels: 24 app.kubernetes.io/name: node-exporter 25 app.kubernetes.io/part-of: ai-software-factory 26spec: 27 selector: 28 matchLabels: 29 app.kubernetes.io/name: node-exporter 30 template: 31 metadata: 32 labels: 33 app.kubernetes.io/name: node-exporter 34 spec: 35 hostNetwork: true 36 hostPID: true 37 containers: 38 - name: node-exporter 39 image: prom/node-exporter:v1.7.0 40 imagePullPolicy: IfNotPresent 41 args: 42 - --path.procfs=/host/proc 43 - --path.sysfs=/host/sys 44 - --path.rootfs=/host/root 45 - --web.listen-address=0.0.0.0:9100 46 - --collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/) 47 ports: 48 - containerPort: 9100 49 name: metrics 50 volumeMounts: 51 - name: proc 52 mountPath: /host/proc 53 readOnly: true 54 - name: sys 55 mountPath: /host/sys 56 readOnly: true 57 - name: root 58 mountPath: /host/root 59 readOnly: true 60 mountPropagation: HostToContainer 61 resources: 62 requests: 63 cpu: 100m 64 memory: 64Mi 65 limits: 66 cpu: 300m 67 memory: 256Mi 68 securityContext: 69 allowPrivilegeEscalation: false 70 # node-exporter runs as root by default; runAsNonRoot is not 71 # possible for the /proc, /sys collectors without capabilities. 72 # Recorded trade-off: the container is read-only + no privilege 73 # escalation; only hostPath mounts it needs. 74 seccompProfile: 75 type: RuntimeDefault 76 tolerations: 77 # run on every node (incl. the control plane, so a single-node 78 # staging cluster still gets node metrics) 79 - operator: Exists 80 volumes: 81 - name: proc 82 hostPath: 83 path: /proc 84 - name: sys 85 hostPath: 86 path: /sys 87 - name: root 88 hostPath: 89 path: / 90