Merge pull request #126096 from utam0k/support-disabling-oom-group-kill

kubelet: new kubelet config option for disabling group oom kill

Kubernetes-commit: c462d4c8e52f3e7bcfd0765b5729569f8d5daa65
This commit is contained in:
Kubernetes Publisher 2024-11-07 06:29:36 +00:00
commit 1a76702573
4 changed files with 20 additions and 6 deletions

View File

@ -354,6 +354,15 @@ type KubeletConfiguration struct {
// Default: "None"
// +optional
CPUManagerPolicy string `json:"cpuManagerPolicy,omitempty"`
// singleProcessOOMKill, if true, will prevent the `memory.oom.group` flag from being set for container
// cgroups in cgroups v2. This causes processes in the container to be OOM killed individually instead of as
// a group. It means that if true, the behavior aligns with the behavior of cgroups v1.
// The default value is determined automatically when you don't specify.
// On non-linux such as windows, only null / absent is allowed.
// On cgroup v1 linux, only null / absent and true are allowed.
// On cgroup v2 linux, null / absent, true and false are allowed. The default value is false.
// +optional
SingleProcessOOMKill *bool `json:"singleProcessOOMKill,omitempty"`
// cpuManagerPolicyOptions is a set of key=value which allows to set extra options
// to fine tune the behaviour of the cpu manager policies.
// Requires both the "CPUManager" and "CPUManagerPolicyOptions" feature gates to be enabled.

View File

@ -254,6 +254,11 @@ func (in *KubeletConfiguration) DeepCopyInto(out *KubeletConfiguration) {
*out = new(bool)
**out = **in
}
if in.SingleProcessOOMKill != nil {
in, out := &in.SingleProcessOOMKill, &out.SingleProcessOOMKill
*out = new(bool)
**out = **in
}
if in.CPUManagerPolicyOptions != nil {
in, out := &in.CPUManagerPolicyOptions, &out.CPUManagerPolicyOptions
*out = make(map[string]string, len(*in))

4
go.mod
View File

@ -11,9 +11,9 @@ require (
github.com/gogo/protobuf v1.3.2
github.com/stretchr/testify v1.9.0
google.golang.org/grpc v1.65.0
k8s.io/api v0.0.0-20241106230208-459b3bf01982
k8s.io/api v0.0.0-20241108114310-4772861d607e
k8s.io/apimachinery v0.0.0-20241106231735-d941d9fb4c83
k8s.io/apiserver v0.0.0-20241107032436-3a2942bdffd0
k8s.io/apiserver v0.0.0-20241108130125-a16a110639e2
k8s.io/client-go v0.0.0-20241107030607-c57dbd8decb0
k8s.io/component-base v0.0.0-20241107031631-88ede593c6c4
k8s.io/cri-api v0.0.0-20241107034520-f9fb3fa09445

8
go.sum
View File

@ -153,12 +153,12 @@ gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.0.0-20241106230208-459b3bf01982 h1:dawXS/j3CvWhfIXAJA29WpGivkWXdaOE6HmDY24ujcU=
k8s.io/api v0.0.0-20241106230208-459b3bf01982/go.mod h1:a1KpjW7qk2zdbW2qzX85ex/fBhKNkow9dOvgGEKU+u8=
k8s.io/api v0.0.0-20241108114310-4772861d607e h1:SJxpg9FSTdq3qp/R+LRlZv+xjY+miO+30ZpC7QkSkoM=
k8s.io/api v0.0.0-20241108114310-4772861d607e/go.mod h1:h7yaPC7+0KxMELdLjLoo6n6m3EWq6AeHEY25PjH4cPI=
k8s.io/apimachinery v0.0.0-20241106231735-d941d9fb4c83 h1:4KfMPmiiRIpvYJQ8cBYFEFht59EKysW1anuJWzHLHNg=
k8s.io/apimachinery v0.0.0-20241106231735-d941d9fb4c83/go.mod h1:HqhdaJUgQqky29T1V0o2yFkt/pZqLFIDyn9Zi/8rxoY=
k8s.io/apiserver v0.0.0-20241107032436-3a2942bdffd0 h1:xmpHpMvNUx/gRPXNI9mmn0N3jXQBMygbEbhns5FpeSA=
k8s.io/apiserver v0.0.0-20241107032436-3a2942bdffd0/go.mod h1:+bSZ/y/dm4ijqupY9KOiKYg1lElk/v+BOiovBxcsbRE=
k8s.io/apiserver v0.0.0-20241108130125-a16a110639e2 h1:q71K5wAlFyryMU0XhOTkatQ0yOG7bQoIayw04x2xiXo=
k8s.io/apiserver v0.0.0-20241108130125-a16a110639e2/go.mod h1:VLDdKhkEntyKQ7rqi4HyQPg0SPHjCBtQDzr65k2Juyk=
k8s.io/client-go v0.0.0-20241107030607-c57dbd8decb0 h1:oDzLA4eLxznpJJ7JNIpfFwtH1ItBtE6BS+YBhPJYoJE=
k8s.io/client-go v0.0.0-20241107030607-c57dbd8decb0/go.mod h1:rCMwfXeYh7ZWimHMUemazxHxkYOS3cd0ZjlzAQjtt78=
k8s.io/component-base v0.0.0-20241107031631-88ede593c6c4 h1:BK9K3H+e0KCAmVfWLpKPnFbDGyDj32JWiyLRFd995kk=