kubelet: introduce --protect-kernel-defaults to make the KernelTunableBehavior configurable

This commit is contained in:
Jan Chaloupka
2016-07-26 12:21:17 +02:00
parent 7bd2db47f9
commit eb967ad143
7 changed files with 32 additions and 18 deletions

View File

@@ -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
}