Skip to content

Support for running containers in any existing network namespace #3246

@dancavallaro

Description

@dancavallaro

What is the problem you're trying to solve

I have a software-defined networking use case that involves creating and using Linux network namespaces outside of any container-driven lifecycle, but I would like to run services in containers with access to these namespaces.

In some cases I might be able to use bridge networking, with a customization to the CNI bridge plugin that lets me override the bridge namespace. But in other cases what I really need is host networking, with the ability to override the netns that the container runs in.

Describe the solution you'd like

Ideally I'd like to continue using nerdctl for its higher-level orchestration features, but I don't see a way of getting what I want here without a change to nerdctl (i.e., as far as I can tell it's not possible to override the container netns solely via a CNI plugin).

Would you be open to considering a PR for this feature? Here's a drafty first crack at this in my fork: dancavallaro@102c2d3. It works in my testing so far, but I'd be more than happy for feedback on anything I might've missed here, or possible alternative approaches.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions