-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 containers should have dedicated netns&veth under the singleton slirp4netns instance #1733
Comments
@AkihiroSuda @giuseppe Any movement on this? |
no, I am not sure about the design here and if having a single instance of slirp4netns is what we want |
Any other idea for supporting inter-container communication? |
I think they should be set to run in the same pod |
I agree when two containers should communicate on the same host ideally they should run in a pod. However the ability to make multiple pods communicate with each other provides more flexibility: Picture a Docker Compose project where multiple services use the same port and still communicate with each other. Now if you want to run this with podman you have to change the configuration or you even have to change the image. I am facing the same problem in ctnr (I am thinking about stopping development in favour of podman): |
@AkihiroSuda is already working on exposing network ports to the slirp4netns network. Once that lands, we will be able to expose ports from the host to the network namespace of each pod/container we wish to. This is the way, IMO, for different containers/pods to communicate, only by a selected and controlled set of ports. Said so, I agree on the CNI idea. It would be nice to enable support for CNI in rootless mode, so that these more complex configurations can be addressed as plugins. |
@giuseppe Is this fixed, can't we close this? |
Fixed in master. |
@AkihiroSuda Is there a way to expose a host port to a container? For example, I have nginx running on the host at localhost:80, can I make it accessible to a specific container? |
slirp4netns can expose localhost:80 on the host as 10.0.2.2:80 in the container, when A hacky way would be like this (untested) $ mv slirp4netns slirp4netns.real
$ cat > slirp4netns <<EOF
#!/bin/sh
set -eu
exec slirp4netns.real "$(echo $@ | sed -e s/--disable-host-loopback//g)"
EOF
$ chmod +x slirp4netns |
@AkihiroSuda thank you for the info. I guess podman disables this by default for security. It would be nice to have a flag to expose the host loopback. |
PR: #7460 |
Is this a BUG REPORT or FEATURE REQUEST?:
[//]: # kind feature
Description
Rootless containers should use a singleton slirp4netns instance, and create dedicated netns (and veth) under the slirp4netns netns
Steps to reproduce the issue:
Create a rootless container
Create the second one
Describe the results you received:
Dedicated slirp4netns is created for each of the containers. i.e. the two containers cannot communicate to each other.
Describe the results you expected:
Only single slirp4netns should be launched, and dedicated network namespaces and vEths under the slirp4netns should be created for each of the containers.
The containers should be able to communicate via vEths.
The text was updated successfully, but these errors were encountered: