-
Notifications
You must be signed in to change notification settings - Fork 41.5k
kubelet & kube-proxy: ignore sysctl errors and rlimit errors when running in UserNS (for rootless) #92863
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
Conversation
Hi @AkihiroSuda. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
cc @giuseppe @cyphar @rhatdan @KentaTada FYI |
/ok-to-test |
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
/retest |
This PR doesn't change any API other than |
CI failure doesn't seem related |
CI failure is unrelated
/retest |
/retest |
/approve |
i recommend amending the release note to be more specific of what the change is about and what components are being modified. |
Updated.
/retest |
/retest |
Enables support for running kubelet in a user namespace. The user namespace has to be created before running kubelet. All the node components such as CRI need to be running in the same user namespace. See kubernetes/enhancements PR 1371 (merged) and issue 2033. Signed-off-by: Akihiro Suda <[email protected]>
Errors during setting the following sysctl values are ignored: - vm.overcommit_memory - vm.panic_on_oom - kernel.panic - kernel.panic_on_oops - kernel.keys.root_maxkeys - kernel.keys.root_maxbytes Signed-off-by: Akihiro Suda <[email protected]>
Ignore an error during setting RLIMIT_NOFILE. Signed-off-by: Akihiro Suda <[email protected]>
oomwatcher.NewWatcher returns "open /dev/kmsg: operation not permitted" error, when running with sysctl value `kernel.dmesg_restrict=1`. The error is negligible for KubeletInUserNamespace. Signed-off-by: Akihiro Suda <[email protected]>
Rebased |
@kubernetes/sig-node-pr-reviews Can we get this reviewed before v1.22 Code Freeze on July 8th? 🙏 |
@AkihiroSuda: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/skip |
/hold cancel the KEP is ready for 1.22 |
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AkihiroSuda, aojea, dims, kolyshkin, mrunalp The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Thanks all for reviewing and approval! Opened a doc PR: kubernetes/website#28827 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Ignore sysctl errors and rlimit errors when running in UserNS.
These changes are required for Rootless mode. See KEP for the further information.
Special notes for your reviewer:
How to test rootless mode with this PR:
make kubelet kube-proxy
make
kubelet
andkube-proxy
binaries inside thebin
directory of the Usernetes to test the codes in this PR. To just try rootless mode, no need to replace the binaries../install.sh
export KUBECONFIG="$HOME/.config/usernetes/master/admin-localhost.kubeconfig"
kubectl
To run the smoke test suite, run
./hack/smoketest-binaries.sh
instead of./install.sh ...
.After this PR gets merged, I'm planning to add kind tests with Rootless Docker (or Podman).
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
The patches are from Usernetes project: https://github.com/rootless-containers/usernetes/tree/master/src/patches/kubernetes
KEP: https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2033-kubelet-in-userns-aka-rootless
Tracking issue: kubernetes/enhancements#2033
Documentation PR: kubernetes/website#28827
kubelet changes
Ignore errors that happens during setting the following sysctl values:
vm.overcommit_memory
vm.panic_on_oom
kernel.panic
kernel.panic_on_oops
kernel.keys.root_maxkeys
kernel.keys.root_maxbytes
Also ignores an error during opening
/dev/kmsg
.Gated by
KubeletInUserNamespace
feature gate.kube-proxy changes
Ignore an error during setting
RLIMIT_NOFILE