Repository navigation
Description
Split from #5640.
Problem: k8s/gpu-feature-discovery/daemonset.yaml runs the gpu-feature-discovery container with privileged: true. Trivy config reports KSV-0017 at HIGH for this file. The privileged mode gives the container access to NVIDIA GPU devices and sysfs. Why deferred: GFD v0.16.2 needs this access. A change to remove privileged: true now would break GPU feature discovery. The fix waits on an upstream GFD release that supports a non-privileged manifest, or on a device-mount design that keeps GPU access. Acceptance criteria: - The container runs with privileged: false. - The container sets allowPrivilegeEscalation: false and drops all capabilities. - The container keeps GPU device and sysfs access through a supported mechanism. - Trivy config reports no KSV-0017 finding for k8s/gpu-feature-discovery/daemonset.yaml. - The kustomization builds and the GPU feature discovery workload passes a smoke test on a GPU node.
Proposed design
Problem statement
k8s/gpu-feature-discovery/daemonset.yaml runs the gpu-feature-discovery container with privileged: true, and Trivy config reports KSV-0017 at HIGH for the file. The .trivyignore.yaml entry that hides the finding expires on 2026-11-21, so the finding returns. The manifest pins nvcr.io/nvidia/k8s-device-plugin:v0.20.2, while its version labels and the ignore statement still say v0.16.2. The change removes privileged mode and gives the container its GPU devices through the node's NVIDIA container runtime.
Acceptance criteria
Requirement: Non-privileged GFD container
The gpu-feature-discovery container SHALL set privileged: false, set allowPrivilegeEscalation: false and drop all capabilities, and the manifest SHALL keep only the kube-linter suppressions that still hold.
Scenario: kube-linter accepts the container security context
- WHEN
uv run devops ci --check --only k8sruns on the change - THEN The command reports no
privileged-container,privilege-escalation-containerordrop-all-capabilitiesfinding fork8s/gpu-feature-discovery/daemonset.yaml
Requirement: GPU access without privileged mode
The container MUST keep NVIDIA GPU access with no privileged mode, through NVIDIA_VISIBLE_DEVICES=all, NVIDIA_DRIVER_CAPABILITIES=utility and the device injection of the node's NVIDIA container runtime.
Scenario: gpu-feature-discovery runs on a GPU node
- WHEN The DaemonSet rolls out on the GPU nodes and
kubectl rollout status daemonset/gpu-feature-discovery -n default --timeout=300sruns - THEN The command exits 0 and prints
daemon set "gpu-feature-discovery" successfully rolled out, andkubectl logs -n default -l app.kubernetes.io/name=gpu-feature-discovery --tail=-1shows nopermission deniedand no NVML error
Requirement: Kustomization renders
The change MUST keep the k8s/gpu-feature-discovery kustomization buildable.
Scenario: kustomize renders the DaemonSet
- WHEN
kubectl kustomize k8s/gpu-feature-discoveryruns on the change - THEN The command exits 0 and prints one DaemonSet named
gpu-feature-discovery
Requirement: Version labels match the image
The DaemonSet MUST set app.kubernetes.io/version to 0.20.2, the version of its image tag.
Scenario: kustomize renders the version label
- WHEN
kubectl kustomize k8s/gpu-feature-discoveryruns on the change - THEN The command prints
app.kubernetes.io/version: 0.20.2in the DaemonSet metadata and in its pod template labels, and prints no0.16.2
Requirement: KSV-0017 finding and entry are gone
The change MUST remove the KSV-0017 entry of .trivyignore.yaml, and the manifest MUST not trigger KSV-0017.
Scenario: IaC scan finds no KSV-0017
- WHEN
trivy config .runs on the change after theKSV-0017entry is removed - THEN The command prints no
KSV-0017finding fork8s/gpu-feature-discovery/daemonset.yaml
Existing Tool Considered
No alternatives check has run. The open, maintained NVIDIA k8s-device-plugin project ships gpu-feature-discovery, the program this manifest runs, at the pinned v0.20.2. It covers GPU feature discovery and lacks only the device grant: its static manifest runs privileged. The change follows the NVIDIA GPU Operator, which runs gpu-feature-discovery with NVIDIA_VISIBLE_DEVICES=all and NVIDIA_DRIVER_CAPABILITIES=utility and lets the node's NVIDIA container runtime inject the devices. The change adds no code of its own, so it has no build cost.
Key questions
- Which mechanism keeps NVIDIA GPU and sysfs access when the container drops privileged mode?: Set
NVIDIA_VISIBLE_DEVICES=allandNVIDIA_DRIVER_CAPABILITIES=utilityon the container, as the NVIDIA GPU Operator does forgpu-feature-discovery. The node's NVIDIA container runtime injects the/dev/nvidia*nodes and their device cgroup rules. NVML then works with no privileged mode and nonvidia.com/gpuallocation. Keep the/syshostPath mount for the PCI labels. (best practice) [sources: k8s/gpu-feature-discovery/daemonset.yaml, k8s/README.md]- Chosen: Device injection of the NVIDIA container runtime (
NVIDIA_VISIBLE_DEVICES=all,NVIDIA_DRIVER_CAPABILITIES=utility). The GPU Operator runsgpu-feature-discoverythis way. The repository already runs the non-privileged GPU ollama tiers on the same nodes. It holds no GPU allocation and adds no code. If a node does not default to the NVIDIA runtime, the pod setsruntimeClassName: nvidia. - Rejected: Request
nvidia.com/gpu: 1in the DaemonSet. The request holds one GPU on each node, and it takes a GPU from the ollama tiers. - Rejected: Mount the
/dev/nvidia*nodes with hostPath and no privileged mode. The runtime sets the device cgroup allow-list from the device injection or the device plugin, so the open of the nodes fails withpermission denied. - Rejected: Wait for an upstream release with a non-privileged manifest. No such release is shown, and the
KSV-0017entry expires on 2026-11-21, so the finding returns before any release lands. - Rejected: Write a local device-injection design. It adds code that the project must keep and fix, and the runtime already gives the devices.
- Chosen: Device injection of the NVIDIA container runtime (
- Which
gpu-feature-discoveryversion does the manifest run?: The image isnvcr.io/nvidia/k8s-device-plugin:v0.20.2. Theapp.kubernetes.io/versionlabels and the.trivyignore.yamlstatements say 0.16.2, so they are stale. The change sets both version labels to 0.20.2 and removes the stale statement with its entry. [sources: k8s/gpu-feature-discovery/daemonset.yaml, .trivyignore.yaml] - Which kube-linter annotations does the change make untrue?: The
privileged-containerandprivilege-escalation-containerannotations become untrue, so the change removes them with the privileged setting. Therun-as-non-rootandsensitive-host-mountsannotations stay true, because the container still runs as root and still mounts host/sys. Their text names fix(security): remove privileged mode from gpu-feature-discovery #5646, so the change states their reason without the closed item. (best practice) [sources: k8s/gpu-feature-discovery/daemonset.yaml]- Chosen: Remove the two untrue annotations. An annotation that no finding needs hides the next regression of the same check. kube-linter reports the finding again if the setting returns.
- Rejected: Keep all four annotations. The two privileged annotations would state a reason that the manifest no longer holds.
- Does the change remove the
KSV-0017entry of.trivyignore.yaml?: Yes. The entry expires on 2026-11-21, so it hides nothing after that date. An entry that no finding needs hides the next regression of the same rule. ADR 0005 keeps each suppression to one reason and one expiry. (best practice) [sources: .trivyignore.yaml, docs/adr/0005-review-findings-come-from-tools-not-models.md]- Chosen: Remove the entry in this change. The manifest no longer triggers the rule, so the entry has no finding to hide.
- Rejected: Let the entry expire. The expired entry stays in the file and the finding reopens with no owner.
- Rejected: Keep the entry with a new expiry date. A suppression that hides nothing covers the next regression of the same rule.
- Does the change also clear the
KSV-0121andKSV-0118entries of this file?: No. The container still mounts host/sysfor the PCI labels, and it still runs as root to write the NFD features file. Both entries stay with their annotations. This item removes privileged mode only. (best practice) [sources: k8s/gpu-feature-discovery/daemonset.yaml, .trivyignore.yaml]- Chosen: Keep both entries out of scope. The item fixes KSV-0017. Its acceptance criteria name no sysfs or root user change.
- Rejected: Clear them in this change. Clearing
KSV-0121needs the/syshostPath mount gone, andgpu-feature-discoveryreads the PCI devices from it.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 14, 2026
Both target KSV-0017 in the same daemonset file; #5640 is the umbrella judgment task and the candidate is the specific fix path split from it.docs(openspec): plan #5640 Judge KSV-0017 with a dated ignore entry (#…
fix(security): Judge KSV-0017 with a dated ignore entry (#5704)
fix(security): Judge KSV-0121 with a dated ignore entry (#5800)
fix(security): Judge KSV-0118 with a dated ignore entry (#5792)
fix(security): Judge KSV-0118 with a dated ignore entry (#5802)
dan-petty commentedon Nov 17, 2026
The
KSV-0017entry fork8s/gpu-feature-discovery/daemonset.yamlin.trivyignore.yamlhasexpired_at: 2026-11-17, so Trivy no longer applies it from 2026-11-17 00:00 UTC. TheKSV-0121entry of the same file expires on 2026-11-18. CI run 43983603905 shows no failed security check for these entries, so the effect is a reopened Trivy-config alert in code scanning, not a red check. Found while working on #6079.dan-petty commentedon Nov 17, 2026
Pull request #6112 (for #6068) runs kube-linter in CI. DaemonSet
default/gpu-feature-discoveryholds the annotationsignore-check.kube-linter.io/privileged-container,privilege-escalation-container,run-as-non-rootandsensitive-host-mounts, each with the reason "until #5646". Remove each annotation that this item makes untrue. The missing NetworkPolicy of the pod is #6109.fix(security): Judge KSV-0017 with a dated ignore entry (#6243)
devops-cli-service commentedon Nov 18, 2026
Owner question: An upstream
gpu-feature-discoveryrelease that runs the container without privileged mode; theKSV-0017suppression expires on 2026-11-17 and the code-scanning alert reopens from that date.Options
Recommendation: Decide the question: only a person can answer it.
Evidence
The next refine round also looks at the item again when a commit on the default branch changes one of these files:
k8s/gpu-feature-discovery/daemonset.yaml,.trivyignore.yaml.devops-cli-service commentedon Nov 18, 2026
Owner question: An upstream NVIDIA
gpu-feature-discoveryrelease that runs the container without privileged mode; theKSV-0017ignore entry expires on 2026-11-21 and the code-scanning alert reopens from that date.Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 21, 2026
Owner question: See Suspected block and Watched files in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 23, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
fix(security): Judge KSV-0017 with a dated ignore entry (#6905)
dan-petty commentedon Nov 25, 2026
gpu-feature-discoveryis removed from the cluster and fromdeploy-stack(#7252). No workload runs this manifest any more.The Trivy findings stay open only because the copy
k8s/gpu-feature-discovery/daemonset.yamlis still in this repository: the freeze check refuses a deletion until step 17 of #5134. The 3 ignore entries that name this item expire on 2026-11-26. After that the findings show again as alerts, and the daily alert job can file them again. Do not change the workload. Close this item and the findings on that path when step 17 deletes the file.dan-petty commentedon Nov 26, 2026
Closed: no privileged gpu-feature-discovery pod is left to change.
#7252 is complete, and dan-petty/homelab removed the DaemonSet (dan-petty/homelab#234). The copy in
k8s/gpu-feature-discovery/deploys nothing, and step 17 (#7290) deletes it. #5371 tracks the open privileged-mode alert 217 until it showsfixed.