Skip to content

Commit ffe7808

Browse files
committed
API Changes - KubeConfig addition: LimitedSwap update
Signed-off-by: Itamar Holder <[email protected]>
1 parent 4d03ff8 commit ffe7808

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

keps/sig-node/2400-node-swap/README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -616,24 +616,20 @@ type KubeletConfiguration struct {
616616
}
617617
618618
type MemorySwapConfiguration struct {
619-
// Configure swap memory available to container workloads. May be one of
620-
// "", "NoSwap": workload will not use swap
621-
// "LimitedSwap": workload combined memory and swap usage cannot exceed pod memory limit
622-
SwapBehavior string
623-
}
619+
// swapBehavior configures swap memory available to container workloads. May be one of
620+
// "", "NoSwap": workloads can not use swap, default option.
621+
// "LimitedSwap": workload swap usage is limited. The swap limit is proportionate to the container's memory request.
622+
// +featureGate=NodeSwap
623+
// +optional
624+
SwapBehavior string `json:"swapBehavior,omitempty"`}
624625
```
625626
626627
We want to expose common swap configurations based on the [Docker] and open
627628
container specification for the `--memory-swap` flag. Thus, the
628629
`MemorySwapConfiguration.SwapBehavior` setting will have the following effects:
629630

630-
* If `SwapBehavior` is set to `"LimitedSwap"`, containers do not have
631-
access to swap beyond their memory limit. This value prevents a container
632-
from using swap in excess of their memory limit, even if it is enabled on a
633-
system.
634-
* With cgroups v2, swap is configured independently from memory. Thus, the
635-
container runtimes can set [`memory.swap.max`] to 0 in this case, and _no_ swap
636-
usage will be permitted.
631+
* If `SwapBehavior` is set to `"LimitedSwap"`, containers have limited (or no) swap access.
632+
See "Steps to Calculate Swap Limit" above.
637633
* If `SwapBehavior` is set to `""` or `"NoSwap"`, no workloads will utilize swap.
638634

639635
[docker]: https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details

0 commit comments

Comments
 (0)