英文:
Podman: using netavark for rootless networking
问题
我正在运行 Podman 4.4.1 在 RHEL 8.6 实时版本上。我一直在使用默认的 CNI 网络在无根容器中遇到延迟问题,并正在尝试评估 netavark 作为后端。
我尝试过的操作:
- 运行了
podman system reset --force
- 将
/usr/share/containers/containers.conf
中的network-backend:"cni"
参数更改为network-backend:"netavark"
- 再次运行了
podman system reset --force
- 运行
podman info --debug
显示networkBackend: netavark
- 重新启动
- 运行
podman network create newnet
- 使用
--network=newnet
标志运行我的容器
问题是,运行容器仍然会启动 slirp4netns
进程。这使我认为它没有使用 netavark 后端。在使用 netavark 的无根容器时,是否仍然需要 slirp4netns?
英文:
I am running podman 4.4.1 on RHEL 8.6 Real-time. I have been having latency issues with the default CNI network in rootless containers and am trying to evaluate netavark as a backend.
What I have tried:
- I ran
podman system reset --force
- I changed
network-backend:"cni"
parameter in /usr/share/containers/containers.conf tonetwork-backend:"netavark"
- I repeated
podman system reset --force
- Running
podman info --debug
showsnetworkBackend: netavark
- Rebooting
- Running
podman network create newnet
- Running my container with the
--network=newnet
The problem is that running a container still starts the slirp4netns
process. This leads me to believe that it is not using the netavark backend. Is slirp4netns still required when using netavark on a rootless container?
答案1
得分: 1
首先,不要修改/usr/share/containers/containers.conf
。如果您计划修改libpod
配置,请将其复制到/etc/containers/containers.conf
。
其次,CNI和Netavark都需要root权限,无法在Podman的无根模式下使用。这就是为什么Podman会忽略您在network-backend
中指定的内容。这部分配置与无根网络无关。
在无根模式下,目前,除非您愿意自己处理网络,否则需要使用slirp4netns。
关于Podman无根网络的演进,最近的DevConf.cz有一些演示:
- Rootful Networking with Rootless Podman Containers - 这对您来说应该是当前情况中最有趣的演示。
- Root is Less: Container Networks Get in Shape with PASTA - 这个演示描述了无slirp4netns的无根网络的未来。
英文:
Firstly, do not modify /usr/share/containers/containers.conf
. Instead, copy it to /etc/containers/containers.conf
if you plan to modify the libpod
configuration.
Secondly, both CNI and Netavark require root privileges and cannot be used by Podman in rootless mode. That is why Podman ignores whatever you have specified in the network-backend
. This section of the configuration does not concern rootless networking at all.
In rootless mode, for now, you are required to use slirp4netns unless you are willing to handle networking yourself.
There have been some presentations about the evolution of rootless networking in Podman from the recent DevConf.cz:
- Rootful Networking with Rootless Podman Containers - This should be the most interesting one for you in the current situation.
- Root is Less: Container Networks Get in Shape with PASTA - This one describes the future of rootless networking without slirp4netns.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论