# Swap Off - why is it necessary?

**URL:** <https://discuss.kubernetes.io/t/swap-off-why-is-it-necessary/6879>\
**Category:** General Discussions\
**Created:** [June 21, 2019, 4:13pm UTC](https://discuss.kubernetes.io/t/swap-off-why-is-it-necessary/6879 "2019-06-21T16:13:59Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Claire](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/claire/32/7630_2.png) [@Claire](https://discuss.kubernetes.io/u/Claire)\
**Post date:** [May 13, 2021, 1:03pm UTC](https://discuss.kubernetes.io/t/swap-off-why-is-it-necessary/6879/4 "2021-05-13T13:03:30Z")

</div>

To complete the @thockin comment, as the doc precise as a requirement at the beginning of the [Installing kubeadm](https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#before-you-begin) process:

> You MUST disable swap in order for the kubelet to work properly.

I would add this command to be totally sure everything is disabled:

```auto
# First diasbale swap
sudo swapoff -a

# And then to disable swap on startup in /etc/fstab
sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab

```

---

_[View the full topic](https://discuss.kubernetes.io/t/swap-off-why-is-it-necessary/6879)._
