Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rootless: run the puller/pusher in the host netns (but still in the userns) #814

Closed
AkihiroSuda opened this issue Feb 14, 2022 · 3 comments · Fixed by #2723
Closed

rootless: run the puller/pusher in the host netns (but still in the userns) #814

AkihiroSuda opened this issue Feb 14, 2022 · 3 comments · Fixed by #2723
Assignees

Comments

@AkihiroSuda
Copy link
Member

With the upcoming bypass4netns integration, rootless containers no longer needs to be slowed down with slirp, however, the puller and the pusher are still slowed down.

We should now look into possibility of running the puller/pusher in the host netns to avoid the slirp overhead.

@AkihiroSuda
Copy link
Member Author

AkihiroSuda commented Mar 28, 2023

@fahedouch

The idea is to add a new flag like --detach-netns to rootlesskit.
When this flag is specified, RootlessKit mounts the new NetNS to $ROOTLESSKIT_STATE_DIR/netns and launches slirp4netns (or pasta) for that netns, but leaves the command process (i.e., containerd) in the host NetNS (w/ unshared UserNS and MountNS).
nerdctl and BuildKit have to support running CNI in the $ROOTLESSKIT_STATE_DIR/netns namespace.

@fahedouch
Copy link
Member

fahedouch commented Apr 5, 2023

@AkihiroSuda thanks for your insights

RootlessKit mounts the new NetNS to $ROOTLESSKIT_STATE_DIR/netns

  • are you pointing to the new NetNS created by unshare() ? Or previously created netns (before launching rootlesskit) which will be mounted when invoke --detach-netns and then passed to slirp4netns . I beleive that in this case we should avoid unshared NetNS , right ?

launches slirp4netns (or pasta) for that netns, but leaves the command process (i.e., containerd) in the host NetNS (w/ unshared UserNS and MountNS)

once we disable unsharing netns for /proc/self/exec , process will run into new MountNS and new UserNS which are already cloned , So why should I unshare them ?

@AkihiroSuda
Copy link
Member Author

are you pointing to the new NetNS created by unshare() ?

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants