-
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
Rootless kube play
creates new network in bridge mode instead of using default slirp4netns
#16940
Comments
kube play
creates network in bridge mode instead of using slirp4netnskube play
creates network in bridge mode instead of using default slirp4netns
kube play
creates network in bridge mode instead of using default slirp4netnskube play
creates new network in bridge mode instead of using default slirp4netns
From the man page:
this was added in to make communication across different pods started by play kube possible: #16029 |
Is there a way to disable this behavior for rootless containers via config? Otherwise using the default slirp4netns network is impossible with the new [email protected] without changing the service file. |
I don't think there is way to overwrite it via config file at the moment but I agree it should respect the default set in containers.conf |
In the slirp4netns paragraph just above states:
This should probably be removed (as well as the bridge paragraph for rootful containers) to reflect the actual behavior.
For now, I am using a systemd override to add EDIT: To be consistent with all other podman commands unless specified otherwise in containers.conf or an additional CLI argument. |
Yeah the problem is we use the same paragraph for podman run/create as well. There slirp4netns is the correct default. Only kube play is special because it should be closer to k8s behaviour. @edsantiago With your man page include mechanism is there a way to exclude certain things for only one command. I would really not like to copy the full |
Sorry, no. It's just a simple, trivial preprocessor. I looked into using |
That said, suggestions welcome. If you can find a decent simple way to implement this, I'd be happy to look into it. |
You can break it into two or three includes though. |
@Luap99 Just to clarify, I actually meant this the other way around. |
No see #16029, the old behaviour was fine but most users want a close to k8s behavior so it was changed to use a named network by default because this will allow communication between pods. |
I see, in that case, how would you make |
A friendly reminder that this issue had no activity for 30 days. |
A friendly reminder that this issue had no activity for 30 days. |
@Luap99 What is up with this one? |
New to podman and trying to thread the needle here - it seems like slirp4netns is no longer the default (I'm on 5.0.2) and pasta is used instead. I managed to bring up a pod via Is this issue still relevant with the move away from slirp4netns? Excuse me if I'm misunderstanding :) |
Oh, I see it is an error in the
I'm not sure why pasta is running then. @edsantiago Sorry to bother you but can you confirm the man page is supposed to be formatted this way? There are list items If this is wrong I can try to take a stab at a fix or open a separate issue. |
That is expected because we still have to connect the rootless netns to host (so either via pasta or slirp4netns), bridge means the the containers get the bridge/veth setup similar to root to allow inter container communication. |
The formatting of the man page was fixed in #22372 I think, however yes looks like the default is documented incorrectly after the pasta switch |
Hey, I'm in the same situation as the OP. My goal is to be able to declare Pods in a .yaml and be able to manage these with systemd, mostly to enable the service and run container after a system shutdown. Would it be a good idea to specify the network in the .yaml via annotations ? apiVersion: v1
kind: Pod
metadata:
name: <pod_name>
annotations:
io.podman.annotations.infra.name: "vector-infra"
io.podman.annotations.network.name: "my-custom-network" # This is the bit that I'm proposing
labels:
app: <appname>
spec:
hostNetwork: false # <-- This has to be false otherwise ignore annotation.
containers:
... Ofcourse the network should previously exist. |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
When creating a pod by running
podman kube play
rootless, a bridge networkpodman-default-kube-network
is created instead of using the defaultpodman
network.This can be changed by running
podman kube play --network slirp4netns
instead, but according to the documentation,slirp4netns
should already be the default for rootless containers.Steps to reproduce the issue:
Write a pod specification or generate one from a running pod via
podman generate kube
Play that pod via
podman kube play
Check the network of the pod via
podman pod inspect --format "{{.InfraConfig.Networks}}" <podname>
Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
When generating the specgen of such a pod, the
netns
is specified asbridge
, but for other pods (not run viakube play
or viakube play --network slirp4netns
) it is specified asslirp4netns
.Output of
podman version
:Output of
podman info
:Package info (e.g. output of
rpm -q podman
orapt list podman
orbrew info podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
None.
The text was updated successfully, but these errors were encountered: