-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bind LoadBalancer nodePort
for rootless k3s
#9511
Comments
I don't believe this is possible. When running k3s rootless, k3s runs within a user network namespace. Only LoadBalancer service ports are forwarded from the real host network namespace into the user's network namespace, that the rootless kubelet thinks is the host network namespace. I don't think it is desirable (or even possible) to map all the host ports. I would defer to @AkihiroSuda as the rootlesskit maintainer; if he thinks this is possible we can reopen but at the moment I am going to close this out as a documented limitation of rootless operation. |
It is still possible to monitor and map all the Kubernetes node ports. Probably just this function has to be modified to watch the node ports k3s/pkg/rootlessports/controller.go Lines 121 to 158 in 3e13e36
|
@hinshun if you wanted to open a PR to make these changes as suggested by @AkihiroSuda, we'd be glad to review it! |
Validated in RC v1.29.3-rc1+k3s1Environment
lb.yaml
Testing
Replication
port is less than 1024
port is greater than 1024
Validation
port is less than 1024
port is greater than 1024
|
Is your feature request related to a problem? Please describe.
When creating a service, typically the service port is for pod-to-pod access whereas
nodePort
is used for external access. In non-rootless mode, I was able to access a service of typeLoadBalancer
via localhost on both its service port andnodePort
. I assume that's unique to k3s with its Klipper embedded service load balancer?However, in rootless mode, I was only able to access it via localhost on its service port but not its
nodePort
. It is described in the advanced documentation but can be confusing for new users.https://docs.k3s.io/advanced#known-issues-with-rootless-mode
Describe the solution you'd like
Ideally, in rootless-mode, service's
nodePort
are also binded on the host to match the UX of rootful mode.The text was updated successfully, but these errors were encountered: