@@ -296,63 +296,6 @@ the kubelet can use topology hints when making resource assignment decisions.
296296See [ Control Topology Management Policies on a Node] ( /docs/tasks/administer-cluster/topology-manager/ )
297297for more information.
298298
299- ## Swap memory management {#swap-memory}
300-
301- {{< feature-state feature_gate_name="NodeSwap" >}}
302-
303- To enable swap on a node, the ` NodeSwap ` feature gate must be enabled on
304- the kubelet (default is true), and the ` --fail-swap-on ` command line flag or ` failSwapOn `
305- [ configuration setting] ( /docs/reference/config-api/kubelet-config.v1beta1/ )
306- must be set to false.
307- To allow Pods to utilize swap, ` swapBehavior ` should not be set to ` NoSwap ` (which is the default behavior) in the kubelet config.
308-
309- {{< warning >}}
310- When the memory swap feature is turned on, Kubernetes data such as the content
311- of Secret objects that were written to tmpfs now could be swapped to disk.
312- {{< /warning >}}
313-
314- A user can also optionally configure ` memorySwap.swapBehavior ` in order to
315- specify how a node will use swap memory. For example,
316-
317- ``` yaml
318- memorySwap :
319- swapBehavior : LimitedSwap
320- ` ` `
321-
322- - ` NoSwap` (default): Kubernetes workloads will not use swap.
323- - `LimitedSwap` : The utilization of swap memory by Kubernetes workloads is subject to limitations.
324- Only Pods of Burstable QoS are permitted to employ swap.
325-
326- If configuration for `memorySwap` is not specified and the feature gate is
327- enabled, by default the kubelet will apply the same behaviour as the
328- ` NoSwap` setting.
329-
330- With `LimitedSwap`, Pods that do not fall under the Burstable QoS classification (i.e.
331- ` BestEffort` /`Guaranteed` Qos Pods) are prohibited from utilizing swap memory.
332- To maintain the aforementioned security and node health guarantees, these Pods
333- are not permitted to use swap memory when `LimitedSwap` is in effect.
334-
335- Prior to detailing the calculation of the swap limit, it is necessary to define the following terms :
336-
337- * `nodeTotalMemory`: The total amount of physical memory available on the node.
338- * `totalPodsSwapAvailable`: The total amount of swap memory on the node that is available for use by Pods
339- (some swap memory may be reserved for system use).
340- * `containerMemoryRequest`: The container's memory request.
341-
342- Swap limitation is configured as :
343- ` (containerMemoryRequest / nodeTotalMemory) * totalPodsSwapAvailable` .
344-
345- It is important to note that, for containers within Burstable QoS Pods, it is possible to
346- opt-out of swap usage by specifying memory requests that are equal to memory limits.
347- Containers configured in this manner will not have access to swap memory.
348-
349- Swap is supported only with **cgroup v2**, cgroup v1 is not supported.
350-
351- For more information, and to assist with testing and provide feedback, please
352- see the blog-post about [Kubernetes 1.28 : NodeSwap graduates to Beta1](/blog/2023/08/24/swap-linux-beta/),
353- [KEP-2400](https://github.com/kubernetes/enhancements/issues/4128) and its
354- [design proposal](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/2400-node-swap/README.md).
355-
356299## {{% heading "whatsnext" %}}
357300
358301Learn more about the following:
0 commit comments