feature: support Memory QoS for cgroups v2
This commit is contained in:
@@ -522,6 +522,11 @@ func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend
|
||||
return err
|
||||
}
|
||||
|
||||
// Warn if MemoryQoS enabled with cgroups v1
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.MemoryQoS) &&
|
||||
!isCgroup2UnifiedMode() {
|
||||
klog.InfoS("Warning: MemoryQoS feature only works with cgroups v2 on Linux, but enabled with cgroups v1")
|
||||
}
|
||||
// Obtain Kubelet Lock File
|
||||
if s.ExitOnLockContention && s.LockFilePath == "" {
|
||||
return errors.New("cannot exit on lock file contention: no lock file specified")
|
||||
|
@@ -19,6 +19,8 @@ package app
|
||||
import (
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/utils/inotify"
|
||||
|
||||
libcontainercgroups "github.com/opencontainers/runc/libcontainer/cgroups"
|
||||
)
|
||||
|
||||
func watchForLockfileContention(path string, done chan struct{}) error {
|
||||
@@ -44,3 +46,7 @@ func watchForLockfileContention(path string, done chan struct{}) error {
|
||||
}()
|
||||
return nil
|
||||
}
|
||||
|
||||
func isCgroup2UnifiedMode() bool {
|
||||
return libcontainercgroups.IsCgroup2UnifiedMode()
|
||||
}
|
||||
|
@@ -23,3 +23,7 @@ import "errors"
|
||||
func watchForLockfileContention(path string, done chan struct{}) error {
|
||||
return errors.New("kubelet unsupported in this build")
|
||||
}
|
||||
|
||||
func isCgroup2UnifiedMode() bool {
|
||||
return false
|
||||
}
|
||||
|
Reference in New Issue
Block a user