-
Notifications
You must be signed in to change notification settings - Fork 1.6k
KEP-5607: Allow hostNetwork pods to use user namespaces #5608
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
base: master
Are you sure you want to change the base?
Conversation
HirazawaUi
commented
Oct 3, 2025
- One-line PR description: Allow hostNetwork pods to use user namespaces
- Issue link: Allow HostNetwork Pods to Use User Namespaces #5607
- Other comments:
6252f70
to
f4441d3
Compare
When the `UserNamespacesHostNetworkSupport` feature gate is enabled, we will relax this validation check. | ||
The kube-apiserver will accept such a Pod spec and pass it on to the kubelet. | ||
At this point, the responsibility for successfully creating and running the Pod shifts to the container runtime. | ||
If the low-level container runtime (e.g., containerd/runc) does not support this combination, the pod will remain stuck in the `ContainerCreating` state and report an exception event, which is the expected behavior. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we go with this proposal, we should include making it work with containers/crio/runc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
containerd needs changes for this, I think runc too. I'm unsure about crio and crun. @giuseppe ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crun supports it. I am not sure about CRI-O but I don't see any explicit check to prevent that combination
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been added as a graduation requirement for the beta phase.
### User Stories (Optional) | ||
|
||
#### Story 1 | ||
As a cluster administrator, I want to enable user namespaces for my control plane static Pods (e.g., kube-apiserver, kube-controller-manager) to follow the principle of least privilege and reduce the attack surface. These Pods need to use hostNetwork to interact correctly with the cluster network. By enabling the new feature gate, I can add a critical layer of security isolation to these vital components without changing their networking model. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeap, this will need quite some documentation. To make sure users understand you probably can't bind on privileged ports even if you have cap whatever or maybe even the sysctl to change the privileged port range is ineffective too.
But LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that capabilities such as CAP_NET_RAW
, CAP_NET_ADMIN
, and CAP_NET_BIND_SERVICE
remain restricted. I have also added this as a graduation requirement for the beta phase in the KEP.
Please correct me if I'm wrong, as I am not deeply familiar with this area.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM. I'd say let's document this in alpha, but I don't oppose as doing it for beta. I don't see why to postpone it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During the alpha stage, this feature is not accessible to users, as we are still awaiting runtime support across the board. Additionally, we need to wait until runtime support is in place to finalize the scope of this feature :)
6fcfeb6
to
19be9bb
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: HirazawaUi The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |