-
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
Declare and use networks in yaml with podman play kube
#12965
Comments
Original discussion in #12852 I believe this is related to |
For comparison with kubernetes: k8s automatically adds a network interface to each pod. That interface is attached to k8s's network. It is not possible to attach multiple network interfaces to the pod, unless a plugin such as Multus is used. Multus uses an annotation ( It would be great if podman supported those annotations too, but this may prove difficult:
|
Or we need support for |
A friendly reminder that this issue had no activity for 30 days. |
@mheon please remove the stale status |
Regarding I don't think supporting them would solve this issue, but it could be a nice addition in the future (although it may be hard to implement in podman due to its dependency on labels and such). |
I think that's a separate feature request, but it's definitely an interesting one. Mind making a separate issue for it? I think this has applications even outside of |
A friendly reminder that this issue had no activity for 30 days. |
/remove Stale |
A friendly reminder that this issue had no activity for 30 days. |
/remove Stale |
@Luap99 PTAL |
|
A friendly reminder that this issue had no activity for 30 days. |
/remove Stale |
A friendly reminder that this issue had no activity for 30 days. |
/remove Stale |
@umohnani8 PTAL |
@mheon PTAL |
I'm really missing this currently, as now we have official docs and blog posts explaining how to go from docker-compose services -> kubernetes yaml files -> systemd running via |
FWIU, new networks can be declared using the I think it would make sense to add support for |
@umohnani8 @haircommander @saschagrunert WDYT? ^^ |
In order to mimic K8s behavior in regards to network, we have to create one common network to which all pods created by play-kube will be added. podman network create play-kube-network
podman play kube --network play-kube-network KUBEFILE This would allow pods to discover and communicate with other pods - that's the basic of K8s network model. |
I think the basic is solved. (But also IPv6 is broken, see #15850) And I think the following things are still missing:
|
While #16029 makes sure that pods share a common network by default, it does not address the case where you have defined your own networks and want to use them by referencing them in the YAML manifest. The current way to use those networks requires passing additional options (namely, |
NetworkPolicy and multiple networks (as with Multus) are provided in K8s by CNI (and plugins). To some extent there is a conflict with podman network stack direction (see https://www.redhat.com/sysadmin/podman-new-network-stack) and podman-kube - which mimics K8s as a single node deployment.
While I definitely like to have podman-kube 100% compatibility with k8s it seems that we're implementing k8s in podman - which only make sense if podman-kube is meant to be used in production and it's aim is to have k8s "API" compatibility - but then maybe podman-kube should use CNI and not netavark/aardark? Edit: |
In my case I run rootless podman as a single node container solution in my private servers. In our company we run a kubernetes cluster, but I can't simply deploy podman kube yaml files there, because of the missing compatibility. |
I also miss this basic feature, to add the network name in the yaml. For the time being, I just copied the systemd service file and made the links point to /etc/systemd/user...
Please let me know if there is a better way :-) |
I really don't care if the option is available as an cli option or an yaml annotation, however using an automatic GitOps pipeline (containers/fetchit#280), currently there is no way to set the network, because the cli options are not available in that context. Means all pods are created on the default network, which is unexpected. It would be better if a simple yaml annotation can be added, where we can set existing network names. |
@Luap99 Thoughts? |
I would like this feature, too. The less extra scripting (or other steps) that we have to do would be preferred. |
@ygalblum something you could tackle? |
This would be extremely useful to me too, because I'm using My "temporary fix" for now is the following: sudo sed -i 's|^\(ExecStart=/usr/bin/podman play kube\)|\1 --net slirp4netns:port_handler=slirp4netns|' \
/usr/lib/systemd/*/[email protected] but honestly I don't like it a lot because it alters Podman's systemd files |
@ygalblum do you have ideas? I think Quadlet can help out here if not already supported. |
Yes. Quadlet already has everything in place to support what @dmotte is describing. Assuming the K8S YAML is
You can see more info here: https://docs.podman.io/en/stable/markdown/podman-systemd.unit.5.html#kube-units-kube |
Thank you so much for the answers guys! Didn't know about Quadlet. I did some research and found that "It has been merged into Podman 4.4" (source). Unfortunately, on the server:
Because I'm using Podman from the Debian 12 repos :( I guess I'll have to install Podman in some other way, or keep my current solution for now. But thanks anyway for letting me know! |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind feature
Description
I miss the ability to create and use networks in yaml files like PVCs.
Steps to reproduce the issue:
No issue
Describe the results you received:
Missing support.
Describe the results you expected:
Support of the feature.
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
Arch Linux
The text was updated successfully, but these errors were encountered: