kubelet: introduce --protect-kernel-defaults to make the KernelTunableBehavior configurable
This commit is contained in:
@@ -199,7 +199,6 @@ func createManager(containerName string) *fs.Manager {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: plumb this up as a flag to Kubelet in a future PR
|
||||
type KernelTunableBehavior string
|
||||
|
||||
const (
|
||||
@@ -288,8 +287,11 @@ func (cm *containerManagerImpl) setupNode() error {
|
||||
if !f.cpuHardcapping {
|
||||
cm.status.SoftRequirements = fmt.Errorf("CPU hardcapping unsupported")
|
||||
}
|
||||
// TODO: plumb kernel tunable options into container manager, right now, we modify by default
|
||||
if err := setupKernelTunables(KernelTunableModify); err != nil {
|
||||
b := KernelTunableModify
|
||||
if cm.GetNodeConfig().ProtectKernelDefaults {
|
||||
b = KernelTunableError
|
||||
}
|
||||
if err := setupKernelTunables(b); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user