Replies: 1 comment 7 replies
-
One thing I'm completely missing here is: what prevents you from using plain port forwarding (Podman's |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
for development, testing, and debugging, I prefer to use rootless containers but I also from time to time need a way to connect to those rootless containers from the host, as an unprivileged user. I know that I can use
and the connection will work, seen as coming from 10.88.0.1. But the
podman unshare
is not often practical, for example when I need to check something with a browser or other more heavyweight mechanism.I know that as an unprivileged user, my processes are not able to manipulate network interfaces on the host. I'm OK with having a sudo or suid helper script to create the ingress to the rootless network, on temporary basis.
I first tried to create a new veth link from the host netns to the rootless netns where the
podman0
interface with 10.88.0.1 lives (for a typical bridge network and pasta setup) but I couldn't get pasta do the proper routing to the individual containers.So I then decided to create a helper container (actually a pod) and move its end of the veth link that pasta creates to the host netns. That way pastra treats connections from that interface as if they were coming from one of the rootless containers, not knowing that they in fact originate from processes in the host netns.
My current WIP investigation and setup is below. I wonder if this is a reasonable approach to use or if I'm missing some simpler way to create the ingress interface / route on the host?
All commands below are run as unprivileged user;
sudo
commands indicate where we need root privileges.Make sure NetworkManager does not touch our interface on the host
A one-off setup to prevent NetworkManager from attempting to handle IP address for the
podman-ingress
interface which we will create.Create a pod from which we will "steal" the link
Get its pid and IP address
Move the link to the host netns
Check the setup
In a different terminal, run a testing container:
In the first terminal, connect to it:
Tear down the setup
Move the link back to the pod, so that podman does not complain when removing it; avoiding
network: netavark: failed to delete container veth eth0: Netlink error: No such device (os error 19)
:Remove the
podman-ingress-pod
netns name:Remove the ingress pod:
Beta Was this translation helpful? Give feedback.
All reactions