Clarify portable host network namespace detection for NRI plugins
Maintainers usually reply within 6 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- go
- Domain
- api, backend-api-design
Research direction
Start by reading NRI's LinuxNamespace definition in pkg/api/api.proto and the network-device injector at plugins/network-device-injector/network-device-injector.go. Compare the namespace metadata delivered during CreateContainer across the CRI-O and containerd cases described in the issue. Done means documenting the supported runtime-independent detection guarantees, or specifying additive metadata that distinguishes unknown from false.
Written by the indexing model from the issue text.
Description
Problem
An NRI plugin needs to determine whether a pod or container shares the host network namespace, including during CreateContainer.
For equivalent Linux pods using hostNetwork: true, the runtime OCI code paths reviewed expose different namespace representations:
| Object | CRI-O | containerd with a pause sandbox |
|---|---|---|
| Sandbox | Explicit network entry pointing to a pinned host namespace |
network entry omitted |
| Container | network entry omitted |
Explicit entry pointing to /proc/<sandbox-pid>/ns/net, which refers to the host network namespace |
Both representations are valid under OCI namespace semantics. However, checking for the presence or absence of a network entry does not provide portable host-network detection.
NRI’s LinuxNamespace contains only type and path. It does not explicitly identify whether a referenced namespace is the host namespace.
Why this matters
Plugins that configure networking or move network devices need to distinguish host networking from an isolated pod network before taking action.
This assumption also appears in the sample network-device injector: it treats an empty sandbox network namespace path as host networking. An explicit path can also refer to the host namespace, as in CRI-O’s sandbox representation.
How to verify
- Run an NRI logging plugin with CRI-O and containerd.
- Create equivalent pods with
hostNetwork: true, and control pods withhostNetwork: false. - Log
PodSandbox.Linux.NamespacesandContainer.Linux.NamespacesinCreateContainer. - Compare the network namespace entries.
The table above describes the reviewed OCI code paths; captured NRI callback payloads are not included here.
Requested clarification
What is the supported, runtime-independent way to identify host networking from NRI metadata?
In particular:
- Are namespace lists intended to preserve OCI configuration, or describe resolved namespace membership?
- What guarantees apply to sandbox namespace metadata, whose protobuf field is marked “for NRI v1 emulation”?
- Can plugins determine host networking during
CreateContainerwithout runtime-specific annotations or inspecting namespace files?
If the existing API cannot express this directly, could NRI consider additive host-network metadata, with an explicit distinction between unknown and false? The existing namespace lists could retain their OCI representation.
Environment
- CRI-O version:
1.37.4 - containerd version:
2.3.4 - containerd sandbox implementation: pause-based
- Kubernetes version:
v1.37.1
Credits
Co-authored and explored with @bkotlowski.
- Dominant language
- Go
- Stars
- 419
- Forks
- 105
- Avg merge
- 9d 7h
- Merged PRs (30d)
- 14
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from containerd/nri
-
Difficulty 5/5 Over a week Newbie friendliness 12/100
containerd/nri#353 · 15 comments ·
Maintainers usually reply within 6 days
-
[Proposal] Allow configuring request timeout per plugin instead of using a single global timeoutPossibly taken @CoderSherlock claimed this 118 days ago. Open
Difficulty 5/5 Over a week Newbie friendliness 45/100
containerd/nri#287 · 7 comments · 7 reactions ·
Maintainers usually reply within 6 days
-
Difficulty 5/5 Over a week Newbie friendliness 32/100
containerd/nri#282 · 19 comments ·
Maintainers usually reply within 6 days
-
v1.0 required
Difficulty 5/5 Over a week Newbie friendliness 35/100
containerd/nri#273 · 2 comments ·
Maintainers usually reply within 6 days
-
Provide basic runtime metrics for NRI pluginsPossibly taken @mikebrow claimed this 33 days ago. Openv1.0 required
Difficulty 5/5 Over a week Newbie friendliness 25/100
containerd/nri#272 · 1 comment ·
Maintainers usually reply within 6 days
Similar issues
-
P3 tech debt
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
kind/feature needs-triage priority/unprioritized
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NVIDIA/k8s-test-infra#1504 ·
Maintainers usually reply within 1 day
-
Area/Infrastructure Aspect/Infra Resources Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
wso2/agent-manager#2717 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
open-policy-agent/opa#9685 · 1 comment ·
Maintainers usually reply within 1 day