feat(pod-device-mapper): run the pod device mapper apart from the NVIDIA discovery #2543
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2543"
general
weight: 0.35
lalitadithya
Summary
Part of #2419. Implements ADR-072.
Background
metadata-collector runs two unrelated jobs in one pod:
nvidia-smiand writesgpu_metadata.json, which the GPU, syslog and NIC health monitors read.dgxc.nvidia.com/devicesannotation on pods every 30 seconds. A partial drain reads it to evict only the pods that use a failed device.Sharing a pod causes three problems:
1. The mapper runs only on NVIDIA nodes, because the pod's node selector requires the NVIDIA labels. #2541 lets operators configure other devices for partial drains, but nodes with only those devices get no annotations.
2. The mapper runs in discovery's privileged pod, with the host network, the host PID namespace,
/sysand the CUDA image. Discovery gets the mapper's ClusterRole, which it never uses.3. The mapper starts only after the NVML collection succeeds. NVML is most likely to fail on a node with a faulty GPU, and then new pods on that node get no annotation, so partial drains there wait.
What changes
A new module, binary and image
The mapper moves to
pod-device-mapper/withgit mv, so its history follows. It does not import metadata-collector or NVML, and golangci-lint (depguard) now fails if it ever importsmetadata-collector. The image is built with ko (ghcr.io/nvidia/nvsentinel/pod-device-mapper), and the module is added to the Makefile, ko config, image lists and CI workflows.The binary keeps the flag names that the mapper had in metadata-collector (
--kubeconfig,--kubelet-kubeconfig,--config,--pod-mapper-max-consecutive-failures,--metrics-port), so a host-native setup only changes the binary.metadata-collector keeps only the discovery
It still accepts the old mapper flags, including a bare
--pod-mapper-enabled, and logs that it ignores them, so an older pod spec or host setup keeps starting.Two DaemonSets from the same chart
The metadata-collector chart renders both, so every value that operators set today keeps working:
nvidia-metadata-collectorruns the discovery, with its pod settings unchanged. It runs without a ServiceAccount token.pod-device-mapperruns the mapper on the pod network, as root (the kubelet's PodResources socket belongs to root) with all capabilities dropped and a read-only filesystem. It keeps themetadata-collectorServiceAccount and ClusterRole. It runs onnvidia.com/gpu.presentnodes and does not wait for the driver. It serves metrics onglobal.metricsPort, which the namespace NetworkPolicy allows and the PodMonitor scrapes. The metric names do not change.New keys:
podMapper.image,podMapper.resources(defaults toresources) andpodMapper.nodeSelector. Anaffinitythat the operator sets applies to both DaemonSets. The default affinity that follows GPU driver upgrades applies only to the discovery, because the mapper does not use the driver.Upgrade
The upgrade deletes the
metadata-collectorDaemonSet, so the old mappers stop on all nodes together instead of in a slow rolling update. A node has no mapper until its new pod is ready, and a partial drain there waits for the annotations, as for a pod that the mapper has not seen yet.Behaviour to note
podMapper.enabledis now compared as a string, so a quoted"false"turns the mapper off. Before, it turned the mapper on.kubeletHost: {value: "10.0.0.1"}used to render an env var with bothvalueand the defaultvalueFrom, which Kubernetes rejects. The mapper now gets only the value. Because the mapper is off the host network,kubeletHost: {}and a loopback value now give the node IP instead oflocalhost.metadata-collectorpod name no longer matches, and the mapper metrics move frommetrics.porton the node toglobal.metricsPorton the pod.nvidia-metadata-collectorDaemonSet.Testing
Kind cluster
I installed the metadata-collector chart and image from
mainon a Kind cluster (Kubernetes 1.35), with the example DRA driver and the Kubernetes sample device plugin. Then I upgraded to this branch's chart and images. The discovery ran on a test image with the NVML injection library of the fake DCGM image, and the mapper on the ko base image.metadata-collectorDaemonSet, its pod stopped at once, and thenvidia-metadata-collectorandpod-device-mapperpods ran within 10 seconds.gpu_metadata.json.--pod-mapper-enabled, and logged the flags that it ignores.<details><summary>Annotations before and after the upgrade</summary>
</details>
<details><summary>Pods during the upgrade</summary>
</details>
<details><summary>Old flags on the new metadata-collector binary</summary>
</details>
GPU cluster
A GKE cluster with 18 GPU nodes (arm64, 4 NVIDIA GB200 each, GPU Operator device plugin) ran NVSentinel from
main. I upgraded its metadata-collector to this branch atb21e6fa5. I rendered this branch's metadata-collector chart with the values of the installed release and applied it in Helm's order: the new objects first, then the deletion of themetadata-collectorDaemonSet. The images were built from this branch for arm64:pod-device-mapperwith ko, and metadata-collector on the base image of its Dockerfile. I ran the upgrade twice, and reverted the cluster after each run.mainbefore the upgrade, were identical after it.gpu_metadata.json. The mapper ran on a pod IP and reached the kubelet at the node IP.nvsentinelPodMonitor selects all 36 pods.<details><summary>Annotations before and after the upgrade (UUIDs shortened)</summary>
</details>
<details><summary>Metrics of the new pods, two scrapes about 70 seconds apart</summary>
</details>
Type of Change
Component(s) Affected
Checklist
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Added the Pod Device Mapper as a separate Kubernetes DaemonSet that records pod-device annotations for partial drains. Configure its node selection, resources, metrics, and kubelet connectivity.
When the mapper is disabled, partial drains wait rather than fail.
The NVIDIA Metadata Collector runs separately from the mapper.
Documentation
Added setup and configuration guides covering deployment, authentication, and troubleshooting.
* Clarified the components’ responsibilities and documented their metrics endpoints.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->