Skip to content

Commit

Permalink
Move swap into a its own header
Browse files Browse the repository at this point in the history
Signed-off-by: Itamar Holder <[email protected]>
  • Loading branch information
iholder101 committed Aug 29, 2024
1 parent 3b95b00 commit 3b09c30
Showing 1 changed file with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@ see the [Creating a cluster with kubeadm](/docs/setup/production-environment/too
* Full network connectivity between all machines in the cluster (public or private network is fine).
* Unique hostname, MAC address, and product_uuid for every node. See [here](#verify-mac-address) for more details.
* Certain ports are open on your machines. See [here](#check-required-ports) for more details.
* Swap configuration: The default behavior of a kubelet is to fail to start if swap memory is detected on a node.
This means that swap should either be disabled or tolerated by kubelet.
* To tolerate swap, add `failSwapOn: false` to kubelet configuration or as a command line argument.
Note: even if `failSwapOn: false` is provided, workloads wouldn't have swap access by default.
This can be changed by setting a `swapBehavior`, again in the kubelet configuration file. To use swap,
set a `swapBehavior` other than the default `NoSwap` setting.
See [Swap memory management](/docs/concepts/architecture/nodes/#swap-memory) for more details.
* To disable swap, `sudo swapoff -a` can be used to disable swapping temporarily.
To make this change persistent across reboots, make sure swap is disabled in
config files like `/etc/fstab`, `systemd.swap`, depending how it was configured on your system.

{{< note >}}
The `kubeadm` installation is done via binaries that use dynamic linking and assumes that your target system provides `glibc`.
Expand Down Expand Up @@ -76,6 +66,21 @@ The pod network plugin you use may also require certain ports to be
open. Since this differs with each pod network plugin, please see the
documentation for the plugins about what port(s) those need.

## Swap configuration {#swap-configuration}

The default behavior of a kubelet is to fail to start if swap memory is detected on a node.
This means that swap should either be disabled or tolerated by kubelet.

* To tolerate swap, add `failSwapOn: false` to kubelet configuration or as a command line argument.
Note: even if `failSwapOn: false` is provided, workloads wouldn't have swap access by default.
This can be changed by setting a `swapBehavior`, again in the kubelet configuration file. To use swap,
set a `swapBehavior` other than the default `NoSwap` setting.
See [Swap memory management](/docs/concepts/architecture/nodes/#swap-memory) for more details.
* To disable swap, `sudo swapoff -a` can be used to disable swapping temporarily.
To make this change persistent across reboots, make sure swap is disabled in
config files like `/etc/fstab`, `systemd.swap`, depending how it was configured on your system.


## Installing a container runtime {#installing-runtime}

To run containers in Pods, Kubernetes uses a
Expand Down

0 comments on commit 3b09c30

Please sign in to comment.