mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Merge pull request #33783 from derekwaynecarr/phase-1-pod-cgroups
Automatic merge from submit-queue Add cgroup-driver and cgroups-per-qos flags to kubelet Add the flags needed to support pod-level cgroups to kubelet. /cc @vishh @dchen1107 @dubstack
This commit is contained in:
commit
2ecd96100e
@ -164,7 +164,8 @@ func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) {
|
||||
fs.MarkDeprecated("system-container", "Use --system-cgroups instead. Will be removed in a future version.")
|
||||
fs.StringVar(&s.SystemCgroups, "system-cgroups", s.SystemCgroups, "Optional absolute name of cgroups in which to place all non-kernel processes that are not already inside a cgroup under `/`. Empty for no container. Rolling back the flag requires a reboot. (Default: \"\").")
|
||||
|
||||
//fs.BoolVar(&s.CgroupsPerQOS, "cgroups-per-qos", s.CgroupsPerQOS, "Enable creation of QoS cgroup hierarchy, if true top level QoS and pod cgroups are created.")
|
||||
fs.BoolVar(&s.CgroupsPerQOS, "cgroups-per-qos", s.CgroupsPerQOS, "Enable creation of QoS cgroup hierarchy, if true top level QoS and pod cgroups are created.")
|
||||
fs.StringVar(&s.CgroupDriver, "cgroup-driver", s.CgroupDriver, "Driver that the kubelet uses to manipulate cgroups on the host. Possible values: 'cgroupfs', 'systemd'")
|
||||
fs.StringVar(&s.CgroupRoot, "cgroup-root", s.CgroupRoot, "Optional root cgroup to use for pods. This is handled by the container runtime on a best effort basis. Default: '', which means use the container runtime default.")
|
||||
fs.StringVar(&s.ContainerRuntime, "container-runtime", s.ContainerRuntime, "The container runtime to use. Possible values: 'docker', 'rkt'. Default: 'docker'.")
|
||||
fs.DurationVar(&s.RuntimeRequestTimeout.Duration, "runtime-request-timeout", s.RuntimeRequestTimeout.Duration, "Timeout of all runtime requests except long running request - pull, logs, exec and attach. When timeout exceeded, kubelet will cancel the request, throw out an error and retry later. Default: 2m0s")
|
||||
|
@ -56,6 +56,7 @@ cadvisor-port
|
||||
cert-dir
|
||||
certificate-authority
|
||||
cgroup-root
|
||||
cgroup-driver
|
||||
cgroups-per-qos
|
||||
chaos-chance
|
||||
clean-start
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -279,7 +279,9 @@ type KubeletConfiguration struct {
|
||||
// Enable QoS based Cgroup hierarchy: top level cgroups for QoS Classes
|
||||
// And all Burstable and BestEffort pods are brought up under their
|
||||
// specific top level QoS cgroup.
|
||||
CgroupsPerQOS bool `json:"CgroupsPerQOS,omitempty"`
|
||||
CgroupsPerQOS bool `json:"cgroupsPerQOS,omitempty"`
|
||||
// driver that the kubelet uses to manipulate cgroups on the host (cgroupfs or systemd)
|
||||
CgroupDriver string `json:"cgroupDriver,omitempty"`
|
||||
// Cgroups that container runtime is expected to be isolated in.
|
||||
RuntimeCgroups string `json:"runtimeCgroups,omitempty"`
|
||||
// SystemCgroups is absolute name of cgroups in which to place
|
||||
|
@ -351,6 +351,13 @@ func SetDefaults_KubeletConfiguration(obj *KubeletConfiguration) {
|
||||
temp := int32(defaultIPTablesDropBit)
|
||||
obj.IPTablesDropBit = &temp
|
||||
}
|
||||
if obj.CgroupDriver == "" {
|
||||
obj.CgroupDriver = "cgroupfs"
|
||||
}
|
||||
if obj.CgroupsPerQOS == nil {
|
||||
temp := false
|
||||
obj.CgroupsPerQOS = &temp
|
||||
}
|
||||
}
|
||||
|
||||
func boolVar(b bool) *bool {
|
||||
|
@ -343,7 +343,9 @@ type KubeletConfiguration struct {
|
||||
// Enable QoS based Cgroup hierarchy: top level cgroups for QoS Classes
|
||||
// And all Burstable and BestEffort pods are brought up under their
|
||||
// specific top level QoS cgroup.
|
||||
CgroupsPerQOS *bool `json:"CgroupsPerQOS,omitempty"`
|
||||
CgroupsPerQOS *bool `json:"cgroupsPerQOS,omitempty"`
|
||||
// driver that the kubelet uses to manipulate cgroups on the host (cgroupfs or systemd)
|
||||
CgroupDriver string `json:"cgroupDriver,omitempty"`
|
||||
// containerRuntime is the container runtime to use.
|
||||
ContainerRuntime string `json:"containerRuntime"`
|
||||
// remoteRuntimeEndpoint is the endpoint of remote runtime service
|
||||
|
@ -248,6 +248,7 @@ func autoConvert_v1alpha1_KubeletConfiguration_To_componentconfig_KubeletConfigu
|
||||
if err := api.Convert_Pointer_bool_To_bool(&in.CgroupsPerQOS, &out.CgroupsPerQOS, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.CgroupDriver = in.CgroupDriver
|
||||
out.ContainerRuntime = in.ContainerRuntime
|
||||
out.RemoteRuntimeEndpoint = in.RemoteRuntimeEndpoint
|
||||
out.RemoteImageEndpoint = in.RemoteImageEndpoint
|
||||
@ -425,6 +426,7 @@ func autoConvert_componentconfig_KubeletConfiguration_To_v1alpha1_KubeletConfigu
|
||||
if err := api.Convert_bool_To_Pointer_bool(&in.CgroupsPerQOS, &out.CgroupsPerQOS, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.CgroupDriver = in.CgroupDriver
|
||||
out.RuntimeCgroups = in.RuntimeCgroups
|
||||
out.SystemCgroups = in.SystemCgroups
|
||||
out.CgroupRoot = in.CgroupRoot
|
||||
|
@ -257,6 +257,7 @@ func DeepCopy_v1alpha1_KubeletConfiguration(in interface{}, out interface{}, c *
|
||||
} else {
|
||||
out.CgroupsPerQOS = nil
|
||||
}
|
||||
out.CgroupDriver = in.CgroupDriver
|
||||
out.ContainerRuntime = in.ContainerRuntime
|
||||
out.RemoteRuntimeEndpoint = in.RemoteRuntimeEndpoint
|
||||
out.RemoteImageEndpoint = in.RemoteImageEndpoint
|
||||
|
@ -268,6 +268,7 @@ func DeepCopy_componentconfig_KubeletConfiguration(in interface{}, out interface
|
||||
out.CloudConfigFile = in.CloudConfigFile
|
||||
out.KubeletCgroups = in.KubeletCgroups
|
||||
out.CgroupsPerQOS = in.CgroupsPerQOS
|
||||
out.CgroupDriver = in.CgroupDriver
|
||||
out.RuntimeCgroups = in.RuntimeCgroups
|
||||
out.SystemCgroups = in.SystemCgroups
|
||||
out.CgroupRoot = in.CgroupRoot
|
||||
|
@ -2499,13 +2499,20 @@ var OpenAPIDefinitions *common.OpenAPIDefinitions = &common.OpenAPIDefinitions{
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"CgroupsPerQOS": {
|
||||
"cgroupsPerQOS": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Enable QoS based Cgroup hierarchy: top level cgroups for QoS Classes And all Burstable and BestEffort pods are brought up under their specific top level QoS cgroup.",
|
||||
Type: []string{"boolean"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"cgroupDriver": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "driver that the kubelet uses to manipulate cgroups on the host (cgroupfs or systemd)",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"runtimeCgroups": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Cgroups that container runtime is expected to be isolated in.",
|
||||
@ -13963,13 +13970,20 @@ var OpenAPIDefinitions *common.OpenAPIDefinitions = &common.OpenAPIDefinitions{
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"CgroupsPerQOS": {
|
||||
"cgroupsPerQOS": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Enable QoS based Cgroup hierarchy: top level cgroups for QoS Classes And all Burstable and BestEffort pods are brought up under their specific top level QoS cgroup.",
|
||||
Type: []string{"boolean"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"cgroupDriver": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "driver that the kubelet uses to manipulate cgroups on the host (cgroupfs or systemd)",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"containerRuntime": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "containerRuntime is the container runtime to use.",
|
||||
|
Loading…
Reference in New Issue
Block a user