mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Rename cgroups-per-qos flag to not be experimental
This commit is contained in:
parent
ab794c6128
commit
04a909a257
@ -196,7 +196,7 @@ func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) {
|
|||||||
fs.MarkDeprecated("system-container", "Use --system-cgroups instead. Will be removed in a future version.")
|
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.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.ExperimentalCgroupsPerQOS, "experimental-cgroups-per-qos", s.ExperimentalCgroupsPerQOS, "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.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.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.StringVar(&s.ContainerRuntime, "container-runtime", s.ContainerRuntime, "The container runtime to use. Possible values: 'docker', 'rkt'. Default: 'docker'.")
|
||||||
|
@ -460,7 +460,7 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.KubeletDeps) (err error) {
|
|||||||
SystemCgroupsName: s.SystemCgroups,
|
SystemCgroupsName: s.SystemCgroups,
|
||||||
KubeletCgroupsName: s.KubeletCgroups,
|
KubeletCgroupsName: s.KubeletCgroups,
|
||||||
ContainerRuntime: s.ContainerRuntime,
|
ContainerRuntime: s.ContainerRuntime,
|
||||||
CgroupsPerQOS: s.ExperimentalCgroupsPerQOS,
|
CgroupsPerQOS: s.CgroupsPerQOS,
|
||||||
CgroupRoot: s.CgroupRoot,
|
CgroupRoot: s.CgroupRoot,
|
||||||
CgroupDriver: s.CgroupDriver,
|
CgroupDriver: s.CgroupDriver,
|
||||||
ProtectKernelDefaults: s.ProtectKernelDefaults,
|
ProtectKernelDefaults: s.ProtectKernelDefaults,
|
||||||
|
@ -298,7 +298,7 @@ type KubeletConfiguration struct {
|
|||||||
// And all Burstable and BestEffort pods are brought up under their
|
// And all Burstable and BestEffort pods are brought up under their
|
||||||
// specific top level QoS cgroup.
|
// specific top level QoS cgroup.
|
||||||
// +optional
|
// +optional
|
||||||
ExperimentalCgroupsPerQOS bool
|
CgroupsPerQOS bool
|
||||||
// driver that the kubelet uses to manipulate cgroups on the host (cgroupfs or systemd)
|
// driver that the kubelet uses to manipulate cgroups on the host (cgroupfs or systemd)
|
||||||
// +optional
|
// +optional
|
||||||
CgroupDriver string
|
CgroupDriver string
|
||||||
@ -311,7 +311,7 @@ type KubeletConfiguration struct {
|
|||||||
// +optional
|
// +optional
|
||||||
SystemCgroups string
|
SystemCgroups string
|
||||||
// CgroupRoot is the root cgroup to use for pods.
|
// CgroupRoot is the root cgroup to use for pods.
|
||||||
// If ExperimentalCgroupsPerQOS is enabled, this is the root of the QoS cgroup hierarchy.
|
// If CgroupsPerQOS is enabled, this is the root of the QoS cgroup hierarchy.
|
||||||
// +optional
|
// +optional
|
||||||
CgroupRoot string
|
CgroupRoot string
|
||||||
// containerRuntime is the container runtime to use.
|
// containerRuntime is the container runtime to use.
|
||||||
|
@ -204,8 +204,8 @@ func SetDefaults_KubeletConfiguration(obj *KubeletConfiguration) {
|
|||||||
if obj.CertDirectory == "" {
|
if obj.CertDirectory == "" {
|
||||||
obj.CertDirectory = "/var/run/kubernetes"
|
obj.CertDirectory = "/var/run/kubernetes"
|
||||||
}
|
}
|
||||||
if obj.ExperimentalCgroupsPerQOS == nil {
|
if obj.CgroupsPerQOS == nil {
|
||||||
obj.ExperimentalCgroupsPerQOS = boolVar(false)
|
obj.CgroupsPerQOS = boolVar(false)
|
||||||
}
|
}
|
||||||
if obj.ContainerRuntime == "" {
|
if obj.ContainerRuntime == "" {
|
||||||
obj.ContainerRuntime = "docker"
|
obj.ContainerRuntime = "docker"
|
||||||
@ -394,9 +394,9 @@ func SetDefaults_KubeletConfiguration(obj *KubeletConfiguration) {
|
|||||||
temp := int32(defaultIPTablesDropBit)
|
temp := int32(defaultIPTablesDropBit)
|
||||||
obj.IPTablesDropBit = &temp
|
obj.IPTablesDropBit = &temp
|
||||||
}
|
}
|
||||||
if obj.ExperimentalCgroupsPerQOS == nil {
|
if obj.CgroupsPerQOS == nil {
|
||||||
temp := false
|
temp := false
|
||||||
obj.ExperimentalCgroupsPerQOS = &temp
|
obj.CgroupsPerQOS = &temp
|
||||||
}
|
}
|
||||||
if obj.CgroupDriver == "" {
|
if obj.CgroupDriver == "" {
|
||||||
obj.CgroupDriver = "cgroupfs"
|
obj.CgroupDriver = "cgroupfs"
|
||||||
@ -404,8 +404,8 @@ func SetDefaults_KubeletConfiguration(obj *KubeletConfiguration) {
|
|||||||
// NOTE: this is for backwards compatibility with earlier releases where cgroup-root was optional.
|
// NOTE: this is for backwards compatibility with earlier releases where cgroup-root was optional.
|
||||||
// if cgroups per qos is not enabled, and cgroup-root is not specified, we need to default to the
|
// if cgroups per qos is not enabled, and cgroup-root is not specified, we need to default to the
|
||||||
// container runtime default and not default to the root cgroup.
|
// container runtime default and not default to the root cgroup.
|
||||||
if obj.ExperimentalCgroupsPerQOS != nil {
|
if obj.CgroupsPerQOS != nil {
|
||||||
if *obj.ExperimentalCgroupsPerQOS {
|
if *obj.CgroupsPerQOS {
|
||||||
if obj.CgroupRoot == "" {
|
if obj.CgroupRoot == "" {
|
||||||
obj.CgroupRoot = "/"
|
obj.CgroupRoot = "/"
|
||||||
}
|
}
|
||||||
|
@ -359,7 +359,7 @@ type KubeletConfiguration struct {
|
|||||||
// And all Burstable and BestEffort pods are brought up under their
|
// And all Burstable and BestEffort pods are brought up under their
|
||||||
// specific top level QoS cgroup.
|
// specific top level QoS cgroup.
|
||||||
// +optional
|
// +optional
|
||||||
ExperimentalCgroupsPerQOS *bool `json:"experimentalCgroupsPerQOS,omitempty"`
|
CgroupsPerQOS *bool `json:"cgroupsPerQOS,omitempty"`
|
||||||
// driver that the kubelet uses to manipulate cgroups on the host (cgroupfs or systemd)
|
// driver that the kubelet uses to manipulate cgroups on the host (cgroupfs or systemd)
|
||||||
// +optional
|
// +optional
|
||||||
CgroupDriver string `json:"cgroupDriver,omitempty"`
|
CgroupDriver string `json:"cgroupDriver,omitempty"`
|
||||||
|
@ -209,7 +209,7 @@ func NewContainerManager(mountUtil mount.Interface, cadvisorInterface cadvisor.I
|
|||||||
if nodeConfig.CgroupsPerQOS {
|
if nodeConfig.CgroupsPerQOS {
|
||||||
// this does default to / when enabled, but this tests against regressions.
|
// this does default to / when enabled, but this tests against regressions.
|
||||||
if nodeConfig.CgroupRoot == "" {
|
if nodeConfig.CgroupRoot == "" {
|
||||||
return nil, fmt.Errorf("invalid configuration: experimental-cgroups-per-qos was specified and cgroup-root was not specified. To enable the QoS cgroup hierarchy you need to specify a valid cgroup-root")
|
return nil, fmt.Errorf("invalid configuration: cgroups-per-qos was specified and cgroup-root was not specified. To enable the QoS cgroup hierarchy you need to specify a valid cgroup-root")
|
||||||
}
|
}
|
||||||
|
|
||||||
// we need to check that the cgroup root actually exists for each subsystem
|
// we need to check that the cgroup root actually exists for each subsystem
|
||||||
|
@ -453,7 +453,7 @@ func NewMainKubelet(kubeCfg *componentconfig.KubeletConfiguration, kubeDeps *Kub
|
|||||||
nodeStatusUpdateFrequency: kubeCfg.NodeStatusUpdateFrequency.Duration,
|
nodeStatusUpdateFrequency: kubeCfg.NodeStatusUpdateFrequency.Duration,
|
||||||
os: kubeDeps.OSInterface,
|
os: kubeDeps.OSInterface,
|
||||||
oomWatcher: oomWatcher,
|
oomWatcher: oomWatcher,
|
||||||
cgroupsPerQOS: kubeCfg.ExperimentalCgroupsPerQOS,
|
cgroupsPerQOS: kubeCfg.CgroupsPerQOS,
|
||||||
cgroupRoot: kubeCfg.CgroupRoot,
|
cgroupRoot: kubeCfg.CgroupRoot,
|
||||||
mounter: kubeDeps.Mounter,
|
mounter: kubeDeps.Mounter,
|
||||||
writer: kubeDeps.Writer,
|
writer: kubeDeps.Writer,
|
||||||
|
@ -142,7 +142,7 @@ func GetHollowKubeletConfig(
|
|||||||
c.EnableCustomMetrics = false
|
c.EnableCustomMetrics = false
|
||||||
c.EnableDebuggingHandlers = true
|
c.EnableDebuggingHandlers = true
|
||||||
c.EnableServer = true
|
c.EnableServer = true
|
||||||
c.ExperimentalCgroupsPerQOS = false
|
c.CgroupsPerQOS = false
|
||||||
// hairpin-veth is used to allow hairpin packets. Note that this deviates from
|
// hairpin-veth is used to allow hairpin packets. Note that this deviates from
|
||||||
// what the "real" kubelet currently does, because there's no way to
|
// what the "real" kubelet currently does, because there's no way to
|
||||||
// set promiscuous mode on docker0.
|
// set promiscuous mode on docker0.
|
||||||
|
@ -143,7 +143,7 @@ var _ = framework.KubeDescribe("Kubelet Cgroup Manager", func() {
|
|||||||
Describe("QOS containers", func() {
|
Describe("QOS containers", func() {
|
||||||
Context("On enabling QOS cgroup hierarchy", func() {
|
Context("On enabling QOS cgroup hierarchy", func() {
|
||||||
It("Top level QoS containers should have been created", func() {
|
It("Top level QoS containers should have been created", func() {
|
||||||
if !framework.TestContext.KubeletConfig.ExperimentalCgroupsPerQOS {
|
if !framework.TestContext.KubeletConfig.CgroupsPerQOS {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
cgroupsToVerify := []cm.CgroupName{cm.CgroupName(v1.PodQOSBurstable), cm.CgroupName(v1.PodQOSBestEffort)}
|
cgroupsToVerify := []cm.CgroupName{cm.CgroupName(v1.PodQOSBurstable), cm.CgroupName(v1.PodQOSBestEffort)}
|
||||||
@ -158,7 +158,7 @@ var _ = framework.KubeDescribe("Kubelet Cgroup Manager", func() {
|
|||||||
Describe("Pod containers", func() {
|
Describe("Pod containers", func() {
|
||||||
Context("On scheduling a Guaranteed Pod", func() {
|
Context("On scheduling a Guaranteed Pod", func() {
|
||||||
It("Pod containers should have been created under the cgroup-root", func() {
|
It("Pod containers should have been created under the cgroup-root", func() {
|
||||||
if !framework.TestContext.KubeletConfig.ExperimentalCgroupsPerQOS {
|
if !framework.TestContext.KubeletConfig.CgroupsPerQOS {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var (
|
var (
|
||||||
@ -202,7 +202,7 @@ var _ = framework.KubeDescribe("Kubelet Cgroup Manager", func() {
|
|||||||
})
|
})
|
||||||
Context("On scheduling a BestEffort Pod", func() {
|
Context("On scheduling a BestEffort Pod", func() {
|
||||||
It("Pod containers should have been created under the BestEffort cgroup", func() {
|
It("Pod containers should have been created under the BestEffort cgroup", func() {
|
||||||
if !framework.TestContext.KubeletConfig.ExperimentalCgroupsPerQOS {
|
if !framework.TestContext.KubeletConfig.CgroupsPerQOS {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var (
|
var (
|
||||||
@ -246,7 +246,7 @@ var _ = framework.KubeDescribe("Kubelet Cgroup Manager", func() {
|
|||||||
})
|
})
|
||||||
Context("On scheduling a Burstable Pod", func() {
|
Context("On scheduling a Burstable Pod", func() {
|
||||||
It("Pod containers should have been created under the Burstable cgroup", func() {
|
It("Pod containers should have been created under the Burstable cgroup", func() {
|
||||||
if !framework.TestContext.KubeletConfig.ExperimentalCgroupsPerQOS {
|
if !framework.TestContext.KubeletConfig.CgroupsPerQOS {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var (
|
var (
|
||||||
|
Loading…
Reference in New Issue
Block a user