Set MemorySwapLimitInBytes for CRI when NodeSwapEnabled

This commit is contained in:
Elana Hashman
2021-06-16 16:27:50 -07:00
parent 7342acb0b8
commit 0deef4610e
4 changed files with 109 additions and 0 deletions

View File

@@ -144,6 +144,9 @@ type kubeGenericRuntimeManager struct {
// Use RuntimeDefault as the default seccomp profile for all workloads.
seccompDefault bool
// MemorySwapBehavior defines how swap is used
memorySwapBehavior string
}
// KubeGenericRuntime is a interface contains interfaces for container runtime and command.
@@ -186,6 +189,7 @@ func NewKubeGenericRuntimeManager(
logManager logs.ContainerLogManager,
runtimeClassManager *runtimeclass.Manager,
seccompDefault bool,
memorySwapBehavior string,
) (KubeGenericRuntime, error) {
kubeRuntimeManager := &kubeGenericRuntimeManager{
recorder: recorder,
@@ -206,6 +210,7 @@ func NewKubeGenericRuntimeManager(
runtimeClassManager: runtimeClassManager,
logReduction: logreduction.NewLogReduction(identicalErrorDelay),
seccompDefault: seccompDefault,
memorySwapBehavior: memorySwapBehavior,
}
typedVersion, err := kubeRuntimeManager.getTypedVersion()