Open topic with navigation

# Disabling Swap Space

Disabling of swap space on all master and worker nodes is necessary to evenly distribute resources and not allocate swap space.

This procedure does not apply to database nodes, because the database requires swap space. In the case where the database and Kubernetes master and worker nodes are co-located, such as an all-in-one single node deployment, you must enables swap because it is a hard requirement for the database installation. In such a single-node scenario, Kubernetes will operate properly with swap enabled because pod allocation is only to a single node, so swap does not affect the allocation logic.

To disable swap space:

1. Log on to the node.
2. Run the following command to disable the swap process.

    # swapoff -a

3. Open the `/etc/fstab` file in a supported editor.
4. Comment out the lines that display `swap` as the disk type, then save the file. For example:

    #/dev/mapper/centos_shcentos72x64-swap swap