KEP-2400keps/sig-node/2400-node-swap
Node system swap support
Kubernetes currently does not support the use of swap memory on Linux, as it is difficult to provide guarantees and account for pod memory utilization when swap is involved. As part of Kubernetes’ earlier design, swap support was considered out of scope. However, there are a number of use cases that would benefit from Kubernetes nodes supporting swap. Hence… Full summary
Kubernetes currently does not support the use of swap memory on Linux, as it is difficult to provide guarantees and account for pod memory utilization when swap is involved. As part of Kubernetes’ earlier design, swap support was considered out of scope. However, there are a number of use cases that would benefit from Kubernetes nodes supporting swap. Hence, this proposal aims to add swap support to nodes in a controlled, predictable manner so that Kubernetes users can perform testing and provide data to continue building cluster capabilities on top of swap. This KEP aims to introduce basic swap enablement and leave further extensions to follow-up KEPs. This way Kubernetes users / vendors would be able to use swap in a basic manner quickly while extensions would be brought to discussion in dedicated KEPs that would progress in the meantime. For example, to achieve this goal, this KEP does not introduce any APIs that allow customizing how the feature behaves, but instead only determines whether the feature is enabled or disabled. From an API perspective, this is being done by presenting the kubelet swapBehavior configuration field. Within the scope of this KEP we will support only two basic behaviors: NoSwap and LimitedSwap. Both do not provide any customizability, as NoSwap disables swap for workloads and LimitedSwap's behaviour is automatic and implicit that requires minimum user intervention (see proposal below for more details). As mentioned above, in the very near future, follow-up KEPs would bring API extension and customizability, supporting zswap, and many other extensions to discussion. These customization capabilities will probably be introduced as additional "swap behaviors" which will probably bring some API changes, perhaps at the pod level, that will extend this feature and make it more su
Facts
- Approvers
- @dchen1107@derekwaynecarr
- Reviewers
- @sftim@deads2k@anguslees@harche
- Tracking issue
- #2400(opens GitHub in a new tab) closedcompletedclosed 2025-09-17 15:18 UTCmilestone v1.34sig/nodestage/stable
- Milestones
- alpha v1.22beta v1.30stable v1.34
- Participating SIGs
- none
- Feature gates
- NodeSwap
- Created / last updated
- 2021-04-06 / none