Repository navigation
Description
Problem
No NetworkPolicy selects the pods of the DaemonSet default/gpu-feature-discovery (k8s/gpu-feature-discovery/daemonset.yaml). Namespace default has no NetworkPolicy, so the privileged pod can open any connection. The kube-linter row of devops ci (#6068) reports non-isolated-pod for it, and the DaemonSet holds the exception annotation ignore-check.kube-linter.io/non-isolated-pod until this item.
The pod mounts no ServiceAccount token. It reads the GPUs and /sys of its node and writes the GPU features to a file of the node. It should need no network connection, but no one has checked this on a GPU node.
Expected behavior
- Confirm on a GPU node which connections the pod opens, if any.
- Add a NetworkPolicy that selects the pod and allows only those connections (none, if it needs none), and add it to the kustomization.
- Remove the annotation
ignore-check.kube-linter.io/non-isolated-podfrom the DaemonSet.uv run devops k8s lintpasses, and the GPU labels of each GPU node stay after a restart of the pod.
Related
- ci(k8s): Run kube-linter on the rendered manifests in CI #6068, fix(security): remove privileged mode from gpu-feature-discovery #5646 (privileged mode of the same DaemonSet), SC3 of
docs/SERVICE_PATTERNS.md.
Alternatives check of 2026-11-24: partly.
Tool: inspektor-gadget/inspektor-gadget (https://github.com/inspektor-gadget/inspektor-gadget), Apache-2.0, last activity 2026-11-24, maintained.
Reason: Searches found no tool that writes the NetworkPolicy; Inspektor Gadget, an eBPF tracing tool, can show the connections the gpu-feature-discovery pod opens on a node, but it writes no policy and touches neither the kustomization nor the kube-linter annotation.
Covers:
- Shows which endpoints a running pod connects to
- Traces traffic per pod on each node
- No change to the workload manifest required
Lacks:
- No NetworkPolicy manifest generation
- No kustomization entry or annotation removal
- No lint or rendered-kustomization check
Proposed design
Problem statement
Namespace default has no NetworkPolicy that selects the gpu-feature-discovery pods. Kube-linter reports non-isolated-pod, and the DaemonSet hides it with an exception annotation. This change adds a default-deny NetworkPolicy, includes it in the kustomization, and removes the annotation. A check of the pod's connections and GPU labels on a GPU node is deferred because it needs that hardware.
Acceptance criteria
Requirement: GPU feature discovery network policy
The default/gpu-feature-discovery pods SHALL be selected by a NetworkPolicy that allows no ingress or egress traffic.
Scenario: Kube-linter accepts the isolated pod
- WHEN
uv run devops k8s lintruns on the changed kustomization - THEN the command passes and reports no
non-isolated-podfinding fordefault/gpu-feature-discovery.
Requirement: Kustomization includes the network policy
The kustomization that renders k8s/gpu-feature-discovery/daemonset.yaml MUST include the new NetworkPolicy manifest.
Scenario: The k8s check renders the policy
- WHEN
uv run devops ci --check --only k8sruns - THEN the command passes and the render contains the
default/gpu-feature-discoveryNetworkPolicy.
Requirement: Kube-linter exception is removed
The DaemonSet MUST NOT hold the ignore-check.kube-linter.io/non-isolated-pod annotation.
Scenario: The lint row passes without the exception
- WHEN
uv run devops k8s lintruns after the annotation is removed - THEN the command passes and reports no
non-isolated-podfinding.
Existing Tool Considered
Inspektor Gadget (partly) - the alternatives check in the issue body records what it covers and lacks. The proposal writes the NetworkPolicy manifest, adds the kustomization entry, removes the kube-linter annotation, and verifies with uv run devops k8s lint; Inspektor Gadget supplies none of these.
Key questions
- Which traffic must the NetworkPolicy allow for the gpu-feature-discovery pod?: Allow no ingress and no egress. The pod mounts no ServiceAccount token, reads
/sys, and writes the node feature file; the command has no network client. (best practice) [sources: k8s/gpu-feature-discovery/daemonset.yaml, docs/SERVICE_PATTERNS.md]- Chosen: Default-deny all ingress and egress. The pod spec shows no token and only host file mounts; the issue states the pod should need no network.
- Rejected: Allow DNS egress. The pod spec names no service and no API call.
- Rejected: Allow ingress from kubelet. The pod serves no endpoint and has no probe.
- Which pod labels must the NetworkPolicy select?: Select
app.kubernetes.io/name: gpu-feature-discoveryandapp.kubernetes.io/part-of: nvidia-gpu, the labels of the pod template. [sources: k8s/gpu-feature-discovery/daemonset.yaml] - Must the change remove the
ignore-check.kube-linter.io/non-isolated-podannotation?: Yes. Remove it in the same change. The annotation text says it lasts until fix(k8s): Put a NetworkPolicy on gpu-feature-discovery #6109, and a kept annotation hides a missing policy. (best practice) [sources: k8s/gpu-feature-discovery/daemonset.yaml, docs/SERVICE_PATTERNS.md]- Chosen: Remove the annotation in this change. The annotation names this issue as its end, and the new policy replaces the exception.
- Rejected: Keep the annotation until the GPU-node check. The exception would hide a missing or wrong policy from the lint row.
- Which command validates the manifest change?: Use
uv run devops k8s lintfor the kube-linter row anduv run devops ci --check --only k8sfor the rendered kustomization. [sources: docs/SERVICE_PATTERNS.md]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 17, 2026
Both target the same DaemonSet file, but this item adds a NetworkPolicy while #5646 removes privileged mode.devops-cli-service commentedon Nov 18, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (10)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 18, 2026
Status set to Ready at 4ddf77e (see proposed design in issue body).
Moved to new items: #6321.
dan-petty commentedon Nov 25, 2026
Superseded by #7252:
gpu-feature-discoverylabelled nothing, and it is removed from the cluster (dan-petty/homelab#234) and fromdeploy-stack(#7253). Its copy of the manifest in this repository goes with step 17 of #5134.