How to fix – How to fix - ERROR Swap running with swap on is not supported. Please disable swap

The root cause for the error is swapping is on master as well as worker node.

Fixing the error

Step 1 - Disable the swap on both master and worker node (please run the below command on both master and worker node)

1vagrant@master:~$ sudo swapoff -a


Step 2 - After disabling the swap, re-run the kubeadm init

1vagrant@master:~$ sudo kubeadm init --apiserver-advertise-address=100.0.0.1 --pod-network-cidr=10.244.0.0/16

After that you should be able to initialize the kubernetes cluster successfully

 1Your Kubernetes control-plane has initialized successfully!
 2
 3To start using your cluster, you need to run the following as a regular user:
 4
 5  mkdir -p $HOME/.kube
 6  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
 7  sudo chown $(id -u):$(id -g) $HOME/.kube/config
 8
 9You should now deploy a pod network to the cluster.
10Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
11  https://;kubernetes.io/docs/concepts/cluster-administration/addons/

[ERROR Swap]: running with swap on is not supported
[ERROR Swap]: running with swap on is not supported



Want to learn more about Kubernetes

Follow my guide on "14 Steps to Install kubernetes on Ubuntu 18.04 and 16.04"

Posts in this Series