mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
dockertools: disable MemorySwap on Linux
According to docker docs, setting MemorySwap equals to Memory can prevent docker containers from using any swap, instead of setting MemorySwap to zero.
This commit is contained in:
parent
6775a3252d
commit
ecc13c8d86
@ -104,8 +104,9 @@ func (ds *dockerService) updateCreateConfig(
|
||||
rOpts := lc.GetResources()
|
||||
if rOpts != nil {
|
||||
createConfig.HostConfig.Resources = dockercontainer.Resources{
|
||||
// Memory and MemorySwap are set to the same value, this prevents containers from using any swap.
|
||||
Memory: rOpts.MemoryLimitInBytes,
|
||||
MemorySwap: DefaultMemorySwap(),
|
||||
MemorySwap: rOpts.MemoryLimitInBytes,
|
||||
CPUShares: rOpts.CpuShares,
|
||||
CPUQuota: rOpts.CpuQuota,
|
||||
CPUPeriod: rOpts.CpuPeriod,
|
||||
|
Loading…
Reference in New Issue
Block a user