-
Notifications
You must be signed in to change notification settings - Fork 39.2k
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
kubelet: new kubelet config option for disabling group oom kill #126096
base: master
Are you sure you want to change the base?
Conversation
Skipping CI for Draft Pull Request. |
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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-sigs/prow repository. |
12311ee
to
6e7d175
Compare
6e7d175
to
00f4125
Compare
/cc @tzneal |
/label api-review |
cc @bobbypage for review of cgroupv1-compatible options when running with cgroupv2 |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: utam0k 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 |
907fc20
to
d1b6bb6
Compare
/remove-sig api-machinery |
I will make time on Saturday and Sunday for the challenge. If I can't, I will ask someone else to pick up it. |
Co-authored-by: utam0k <k0ma@utam0k.jp> Signed-off-by: utam0k <k0ma@utam0k.jp>
Signed-off-by: utam0k <k0ma@utam0k.jp>
d1b6bb6
to
392f7a6
Compare
417caf3
to
1875ca5
Compare
Signed-off-by: utam0k <k0ma@utam0k.jp>
1875ca5
to
916b167
Compare
@@ -286,4 +288,15 @@ func SetDefaults_KubeletConfiguration(obj *kubeletconfigv1beta1.KubeletConfigura | |||
if obj.PodLogsDir == "" { | |||
obj.PodLogsDir = DefaultPodLogsDir | |||
} | |||
|
|||
if obj.SingleProcessOOMKill == nil { |
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.
On non-Linux platforms, the default value for SingleProcessOOMKill
is set to false
and has no effect. Since the IsCgroup2UnifiedMode()
, which checks if the system is running in cgroup v2 mode, always returns false
on non-Linux platforms, I think it makes more sense to align the behavior with what it does in cgroup v1 mode. If it's fine for SingleProcessOOMKill
to default to true
, then we could simplify the defaulting logic like this:
if !kubeletutil.IsCgroup2UnifiedMode() {
// This is a default behavior for cgroups v1 and non-Linux platforms.
obj.SingleProcessOOMKill = utilpointer.Bool(true)
else {
obj.SingleProcessOOMKill = utilpointer.Bool(false)
}
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?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: