Skip to content

Create and configure network before container is created in case of rootless Podman #2897

@amshinde

Description

@amshinde

In case of rootless containers, the network flow is as follows:

  1. Rootless podman passes an empty path for the network namespace in the OCI config.json
  2. OCI runtime spawns a container creating a new network namespace
  3. podman then calls slirp4netns passing it the pid of the container to create a tap interface in the process's network namespace.

My proposal is to change the network creation flow similar to how it is done today when podman is run with root privileges i.e move the network creation and configuration before the container is created. With this:

  1. Rootless podman would create the network namespace.
  2. slirp4netns would then be called to create the tap interface.
  3. podman would then call the OCI runtime to create the sandbox.

This approach would benefit VM-based runtimes like Kata, as the network would be fully configured when the container is created (Kata scans the network namespace at the time of container creation assuming that the network has been created and configured)

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions