how to access the rootless pod (podman play kube) from host? #24233
-
podman play kube following yaml:
I cannot even ping the 10.89.0.1 from host. I guess there is namespace thing, but I wonder what is the canonical way to allow me to access the container in the pod via ip or container name? I do not want to publish the port. Because this is user owned rootless pods, publish port can result lots of conflict between users. Can somehow configure the rootless pod to connect to some macvlan like stuff to giving the rootless container an ip? How should I configure the pod to allow access from the host system without port publishing? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The short answer you don't you always need published ports. As rootless we simply no permissions to modify the host networking so there is absolutely no way to add any routing rules that could reach a rootless container, in particular as rootless everything has to happen inside rootless network namespaces which are then connected to the host via pasta or slirp4netns, see #22943 (comment) Now you could join the namespace and then connect via ip there, e.g. |
Beta Was this translation helpful? Give feedback.
The short answer you don't you always need published ports.
As rootless we simply no permissions to modify the host networking so there is absolutely no way to add any routing rules that could reach a rootless container, in particular as rootless everything has to happen inside rootless network namespaces which are then connected to the host via pasta or slirp4netns, see #22943 (comment)
Now you could join the namespace and then connect via ip there, e.g.
podman unshare --rootless-netns curl <containerip>