-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
userspace network between containers #6863
Comments
@vrothberg I'm looking for Container <-> Container communication. This is what I'd like (similar to rootfull network):
|
That doesn't work at the moment. Pulling in the slirp4netns specialists: @AkihiroSuda @giuseppe, what do you think? |
I think this is something we need to look into in the future; the limitation on what we can do with networking in rootless is a major drawback. |
Duplicate: #1733 |
Documented how to set up inter-namespace communication: https://github.com/rootless-containers/slirp4netns/blob/master/slirp4netns.1.md#inter-namespace-communication So, podman could support multi-container networks in two possible ways:
Rootless Docker supports |
A friendly reminder that this issue had no activity for 30 days. |
POC scripts for allowing an equivalent of
@giuseppe @rhatdan Do you think executing CNI inside a "sandbox" container is the right approach? |
definitely. I've started working on the side on supporting it in rootless podman: https://github.com/giuseppe/libpod/tree/allow-rootless-cni But before that, we need a new release of iptables with this patch: https://git.netfilter.org/iptables/commit/?id=5105e844c2ff6a3e320bf8cdadc5094d4eaef2b7 |
The branch doesn't seem to contain sandboxing code at the moment, is there anything I can help?
Not necessarily if you execute sandbox as a container, or at least unshare mount namespace and mount a writable tmpfs on |
I like your idea of sandboxing the network and I think it makes sense for something like KIND.
I am still not sure how it should work, so I was just playing around with it. The painful part with having a new network namespace and then create bridges there, is that for each exposed port we need to make sure slirp4netns allocates them and also frees them when the container exits while now we don't risk such leaks if the slirp4netns process is per-container. I am all hears to suggestions on how it should look like :-) Perhaps something similar to what you've done but per pod and embedded in Podman itself? We already have some limitations with what ports are exposed, so maybe per pod it would not be too bad.
but that would cover the host |
Should be per user rather than per pod, so as to support attaching multiple networks. (For single-network usecase, we can optionally support spawning slirp4netns per network. That would provide slightly better isolation.) |
it would be better, I am just worried it becomes more difficult to keep track of open ports and cleaning them up. |
As long as the port_handler is set to rootlesskit, |
Opened draft PR #7460 |
@mheon @giuseppe @AkihiroSuda I'd like to try this out. I've installed
I'm not able to create a network:
What is the recommended way to install a version of |
@baude What's going on with the COPR? It's claiming to provide 2.1.0 but it seems like it's a very old version if it hasn't picked this up yet? |
I have it installed from updates-testing now:
Creating a network doesn't work for me yet, I get a permission denied error:
@giuseppe @AkihiroSuda is this broken, or am I still missing some bits? |
If you have |
@AkihiroSuda I commented out |
Creating a network requires root.
To avoid that, you can:
Both options use ports from the same "host", so it is not possible to run multiple containers that have the same containerport, like when the same image is used to create multiple containers.
Can podman support creating a 'network' between containers that: doesn't require root, allows containers to bind to the same port, and map ports from the containers to the host?
Related slirp4netns issue: rootless-containers/slirp4netns#172
This would be useful also for https://github.com/containers/podman-compose.
The text was updated successfully, but these errors were encountered: