Skip to content

kubelet: new kubelet config option for disabling group oom kill#126096

Merged
k8s-ci-robot merged 1 commit into
kubernetes:masterfrom
utam0k:support-disabling-oom-group-kill
Nov 7, 2024
Merged

kubelet: new kubelet config option for disabling group oom kill#126096
k8s-ci-robot merged 1 commit into
kubernetes:masterfrom
utam0k:support-disabling-oom-group-kill

Conversation

@utam0k
Copy link
Copy Markdown
Member

@utam0k utam0k commented Jul 15, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

There is a difference in the OOM behavior between cgroup v1 and v2 by default. It's important to note that in cgroup v1 if one of the processes within a container is killed, the other processes will remain running. Ideally, we might want to align with cgroup v2's behavior, where all processes within a container are killed if an OOM event occurs. However, in reality, we need to maintain the behavior of cgroup v1 for the time being. Therefore, this pull request will introduce the singleProcessOOMKill flag to enable like cgroup v1's behavior in cgroup v2.

Appearently, this workaround has already been discussed in a SIG-Node meeting.
#117793 (comment)

Which issue(s) this PR fixes:

Carry: #122813 by @tzneal

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Added `singleProcessOOMKill` flag to the kubelet configuration. Setting that to true enable single process OOM killing in cgroups v2. In this mode, if a single process is OOM killed within a container, the remaining processes will not be OOM killed.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jul 15, 2024
@k8s-ci-robot k8s-ci-robot added area/code-generation area/kubelet area/test kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 15, 2024
@utam0k utam0k force-pushed the support-disabling-oom-group-kill branch from 12311ee to 6e7d175 Compare July 15, 2024 06:43
@utam0k utam0k marked this pull request as ready for review July 15, 2024 06:45
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 15, 2024
@k8s-ci-robot k8s-ci-robot requested a review from liggitt July 15, 2024 06:45
@utam0k utam0k marked this pull request as draft July 15, 2024 06:54
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 15, 2024
@utam0k utam0k force-pushed the support-disabling-oom-group-kill branch from 6e7d175 to 00f4125 Compare July 15, 2024 12:01
@utam0k utam0k marked this pull request as ready for review July 18, 2024 12:04
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 18, 2024
@k8s-ci-robot k8s-ci-robot requested a review from kannon92 July 18, 2024 12:04
@utam0k
Copy link
Copy Markdown
Member Author

utam0k commented Jul 18, 2024

For reviewers: I have just fixed the conflict in the previous PR because it had already been reviewed and was fine in itself.

@dchen1107
Copy link
Copy Markdown
Member

LGTM overall. Please address @roycaihw's comments above and fixed the failing tests. We are ready to go.

/approve to unblock you.

@utam0k
Copy link
Copy Markdown
Member Author

utam0k commented Nov 6, 2024

/test pull-kubernetes-node-kubelet-serial-containerd

@utam0k
Copy link
Copy Markdown
Member Author

utam0k commented Nov 6, 2024

/test pull-kubernetes-e2e-capz-windows-master

@utam0k
Copy link
Copy Markdown
Member Author

utam0k commented Nov 6, 2024

I guess /test pull-kubernetes-node-kubelet-serial-containerd might be broken... 🤔 I've passed the e2e test I added with following command.

$ make test-e2e-node FOCUS="The containers should not be OOMKilled" SKIP="\[Slow\]"  

Comment thread staging/src/k8s.io/kubelet/config/v1beta1/types.go Outdated
@knabben
Copy link
Copy Markdown
Member

knabben commented Nov 6, 2024

Hey @utam0k @roycaihw
⚠️ Do we still intend to merge this for v1.32? Just a reminder that the code freeze is starting 02:00 UTC Friday November 8th 2024 (a little less than 1 week from now). Please make sure the PR has both lgtm and approved labels before the code freeze. Thanks!

@utam0k
Copy link
Copy Markdown
Member Author

utam0k commented Nov 6, 2024

⚠️ Do we still intend to merge this for v1.32?

Yes, I do.

@utam0k
Copy link
Copy Markdown
Member Author

utam0k commented Nov 6, 2024

/test pull-kubernetes-node-kubelet-serial-containerd

@roycaihw
Copy link
Copy Markdown
Member

roycaihw commented Nov 7, 2024

/lgtm
/approve

Waiting for the test result: #126096 (comment)
(the pull-kubernetes-node-kubelet-serial-containerd job takes 90min to finish...)

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 02a3d5adf9dd34dc0ccf88bb694342898a14d5b9

Comment thread test/e2e_node/oomkiller_linux_test.go Outdated
@roycaihw
Copy link
Copy Markdown
Member

roycaihw commented Nov 7, 2024

pull-kubernetes-node-kubelet-serial-containerd passed

/assign @liggitt
for approval

@utam0k
Copy link
Copy Markdown
Member Author

utam0k commented Nov 7, 2024

/test pull-kubernetes-node-kubelet-serial-containerd

I believe it will pass.

Comment thread pkg/kubelet/util/util_linux.go Outdated
Copy link
Copy Markdown
Member

@liggitt liggitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/hold for a nit on config field godoc to align with the yaml values users will specify, and one fix needed on the build tagging

Comment thread staging/src/k8s.io/kubelet/config/v1beta1/types.go Outdated
Comment thread staging/src/k8s.io/kubelet/config/v1beta1/types.go Outdated
Comment thread staging/src/k8s.io/kubelet/config/v1beta1/types.go Outdated
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dchen1107, liggitt, roycaihw, SergeyKanzhelev, utam0k, yujuhong

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@utam0k
Copy link
Copy Markdown
Member Author

utam0k commented Nov 7, 2024

/test pull-kubernetes-node-kubelet-serial-containerd

@utam0k
Copy link
Copy Markdown
Member Author

utam0k commented Nov 7, 2024

@liggitt Thanks for your review. I've updated following your suggestions.

@liggitt
Copy link
Copy Markdown
Member

liggitt commented Nov 7, 2024

/lgtm
/hold cancel

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 1434b7ecb2606f35843efb840e693f15a8685a68

@utam0k
Copy link
Copy Markdown
Member Author

utam0k commented Nov 7, 2024

/test pull-kubernetes-unit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by an approver from all required OWNERS files. area/code-generation area/kubelet area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Projects

Status: API review completed, 1.32
Archived in project
Archived in project
Status: Done

Development

Successfully merging this pull request may close these issues.