From ae7fbbe68d05f51d814033e6f501d54d6a589a43 Mon Sep 17 00:00:00 2001 From: Kevin Hannon Date: Tue, 13 Feb 2024 16:34:29 -0500 Subject: [PATCH 1/2] add swap website update --- content/en/docs/concepts/architecture/nodes.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/content/en/docs/concepts/architecture/nodes.md b/content/en/docs/concepts/architecture/nodes.md index 6473d35a17e25..9b8546982631a 100644 --- a/content/en/docs/concepts/architecture/nodes.md +++ b/content/en/docs/concepts/architecture/nodes.md @@ -518,9 +518,10 @@ During a non-graceful shutdown, Pods are terminated in the two phases: {{< feature-state state="beta" for_k8s_version="v1.28" >}} To enable swap on a node, the `NodeSwap` feature gate must be enabled on -the kubelet, and the `--fail-swap-on` command line flag or `failSwapOn` +the kubelet (default is true), and the `--fail-swap-on` command line flag or `failSwapOn` [configuration setting](/docs/reference/config-api/kubelet-config.v1beta1/) -must be set to false. +must be set to false. +To allow Pods to utilize swap, `swapBehavior` should be set to `LimitedSwap` in the kubelet config. {{< warning >}} When the memory swap feature is turned on, Kubernetes data such as the content @@ -532,17 +533,16 @@ specify how a node will use swap memory. For example, ```yaml memorySwap: - swapBehavior: UnlimitedSwap + swapBehavior: LimitedSwap ``` -- `UnlimitedSwap` (default): Kubernetes workloads can use as much swap memory as they - request, up to the system limit. +- `NoSwap` (default): Kubernetes workloads will not use swap. - `LimitedSwap`: The utilization of swap memory by Kubernetes workloads is subject to limitations. Only Pods of Burstable QoS are permitted to employ swap. If configuration for `memorySwap` is not specified and the feature gate is enabled, by default the kubelet will apply the same behaviour as the -`UnlimitedSwap` setting. +`NoSwap` setting. With `LimitedSwap`, Pods that do not fall under the Burstable QoS classification (i.e. `BestEffort`/`Guaranteed` Qos Pods) are prohibited from utilizing swap memory. From dabb663fcb0ad6c4006c61e2fca9691d7f1c61dd Mon Sep 17 00:00:00 2001 From: Kevin Hannon Date: Mon, 11 Mar 2024 08:55:21 -0400 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Itamar Holder <77444623+iholder101@users.noreply.github.com> --- content/en/docs/concepts/architecture/nodes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/concepts/architecture/nodes.md b/content/en/docs/concepts/architecture/nodes.md index 9b8546982631a..3266accaf622a 100644 --- a/content/en/docs/concepts/architecture/nodes.md +++ b/content/en/docs/concepts/architecture/nodes.md @@ -521,7 +521,7 @@ To enable swap on a node, the `NodeSwap` feature gate must be enabled on the kubelet (default is true), and the `--fail-swap-on` command line flag or `failSwapOn` [configuration setting](/docs/reference/config-api/kubelet-config.v1beta1/) must be set to false. -To allow Pods to utilize swap, `swapBehavior` should be set to `LimitedSwap` in the kubelet config. +To allow Pods to utilize swap, `swapBehavior` should not be set to `NoSwap` (which is the default behavior) in the kubelet config. {{< warning >}} When the memory swap feature is turned on, Kubernetes data such as the content