rootless-containers / usernetes

Kubernetes without the root privileges
https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2033-kubelet-in-userns-aka-rootless
Apache License 2.0
865 stars 58 forks source link

Network connection failed from external network to slirp network #276

Open cheungsuifai opened 1 year ago

cheungsuifai commented 1 year ago

It seems I can not ping from host to slirp network, but reverse it's OK.

And this prevent external user to access Load Balance Service in u7s cluster.

It there any solution?

AkihiroSuda commented 1 year ago

See https://github.com/rootless-containers/usernetes/tree/v20221007.0#expose-netns-ports-to-the-host

$ ./rootlessctl.sh add-ports 0.0.0.0:30080:30080/tcp
cheungsuifai commented 1 year ago

but load balance is different from nodeport.

For nodeport service, external user use the host node IP and service port to access the service. After the traffic arrived at the host, it will be forwarded due to the port-forwarding which provider by rootlessctl(socat).

But for load balances service, an external IP must be assigned to the service. so that external user can accessed the service via this IP. But this external IP connection is broken due to no route from external network to slirp network crossing the host network.