# ============================================================================= # node-exporter (TASK-0135, phase-15) — DaemonSet, ns `monitoring`. # # EXPECTED-PRESENT infrastructure: the DiskUsageHigh alert (the spec's six) # reads node_filesystem_usage, and the Infra dashboard's CPU/mem/disk panels # need it. Without a node exporter those panels/alerts are silently empty. # Decision (recorded in the TASK-0135 report): ship the daemonset so the # spec's alert is actionable in staging, rather than leaving the alert # permanently dead. # # hostPath mounts are read-only + hostNetwork for /proc, /sys, / mount — the # standard node-exporter security profile (the container still runs # non-root; /proc and /sys are world-readable). # Image pinned: prom/node-exporter:v1.7.0 (the 1.7 line — # node_filesystem_usage is a 1.x-era metric name; the v1.8+ image renamed # nothing we use, but 1.7 is the line the alert's expr targets). # ============================================================================= apiVersion: apps/v1 kind: DaemonSet metadata: name: node-exporter namespace: monitoring labels: app.kubernetes.io/name: node-exporter app.kubernetes.io/part-of: ai-software-factory spec: selector: matchLabels: app.kubernetes.io/name: node-exporter template: metadata: labels: app.kubernetes.io/name: node-exporter spec: hostNetwork: true hostPID: true containers: - name: node-exporter image: prom/node-exporter:v1.7.0 imagePullPolicy: IfNotPresent args: - --path.procfs=/host/proc - --path.sysfs=/host/sys - --path.rootfs=/host/root - --web.listen-address=0.0.0.0:9100 - --collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/) ports: - containerPort: 9100 name: metrics volumeMounts: - name: proc mountPath: /host/proc readOnly: true - name: sys mountPath: /host/sys readOnly: true - name: root mountPath: /host/root readOnly: true mountPropagation: HostToContainer resources: requests: cpu: 100m memory: 64Mi limits: cpu: 300m memory: 256Mi securityContext: allowPrivilegeEscalation: false # node-exporter runs as root by default; runAsNonRoot is not # possible for the /proc, /sys collectors without capabilities. # Recorded trade-off: the container is read-only + no privilege # escalation; only hostPath mounts it needs. seccompProfile: type: RuntimeDefault tolerations: # run on every node (incl. the control plane, so a single-node # staging cluster still gets node metrics) - operator: Exists volumes: - name: proc hostPath: path: /proc - name: sys hostPath: path: /sys - name: root hostPath: path: /