Replies: 3 comments
-
This is expected with the given design, netavark must always be executed in the rootless netns, compare #22943 (comment) What are you trying to do here with the host netns? You cannot modify it in any way as the process will always be part of the podman userns so even if your plugin would be setuid it will not work. The only thing you could do is read the network settings but you will never have CAP_SYS_ADMIN for the host netns. One option to work around that is to have a privileged helper daemon running on the host listing on some unix socket and then have the plugin connect over the socket and let the deamon do the actual work. |
Beta Was this translation helpful? Give feedback.
-
I move this to discussion as this works as designed currently. |
Beta Was this translation helpful? Give feedback.
-
I see. Looks like I missed some bits about podman's rootless architecture. I'm trying to integrate podman with a third party system that handles most networking aspects. Said system is mostly incompatible with all options netavark currently offers. I will have a look at the solution you suggested. Thank you for the explanation and helping me out. |
Beta Was this translation helpful? Give feedback.
-
Issue Description
During container setup it seems like rootless podman unconditionally creates a separate network namespace before delegating to the network backend (netavark in my case). For standard setups this is fine, but when a custom netavark plugin is in charge of the network this can lead so somewhat confusing behavior. In my case the custom driver expects to execute in the root network namespace where all host devices are available. But all it finds is the pasta device podman created. My guess is that running podman as root would fix this problem but running as root is not always desired/possible.
I don't know if this is a bug or desired behavior. After reading the documentation I expected netavark to be responsible for all networking related tasks. Or is there some setting the plugin can communicate to podman to suppress the pasta network namespace creation?
Steps to reproduce the issue
Steps to reproduce the issue
network_backend = "netavark"
and add path containing mydriver binary tonetavark_plugin_dirs
$ podman network create -d mydriver --interface-name mydev mynet
$ podman run --rm -it --network mynet docker.io/debian:bookworm /bin/bash
Describe the results you received
The mydriver plugin fails because it cannot find the mydev device.
Describe the results you expected
Expected shell prompt
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
Virtualbox VM running Debian Trixie
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions