Podman: 使用 Netavark 进行无根网络配置

huangapple go评论94阅读模式
英文:

Podman: using netavark for rootless networking

问题

我正在运行 Podman 4.4.1 在 RHEL 8.6 实时版本上。我一直在使用默认的 CNI 网络在无根容器中遇到延迟问题,并正在尝试评估 netavark 作为后端。

我尝试过的操作:

  1. 运行了 podman system reset --force
  2. /usr/share/containers/containers.conf 中的 network-backend:"cni" 参数更改为 network-backend:"netavark"
  3. 再次运行了 podman system reset --force
  4. 运行 podman info --debug 显示 networkBackend: netavark
  5. 重新启动
  6. 运行 podman network create newnet
  7. 使用 --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:

  1. I ran podman system reset --force
  2. I changed network-backend:"cni" parameter in /usr/share/containers/containers.conf to network-backend:"netavark"
  3. I repeated podman system reset --force
  4. Running podman info --debug shows networkBackend: netavark
  5. Rebooting
  6. Running podman network create newnet
  7. 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有一些演示:

英文:

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:

huangapple
  • 本文由 发表于 2023年6月1日 20:28:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/76381861.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定