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=188.8.131.52 --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/
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
- Kubernetes Cheat Sheet for day to day DevOps operations?
- Delete Kubernetes POD stuck in terminating state?
- How to Delete PV(Persistent Volume) and PVC(Persistent Volume Claim) stuck in terminating state?
- Share kubernetes secrets between namespaces?
- How to use Kubernetes secrets?
- How to delete all kubernetes PODS?
- kubernetes pods getting recreated?
- Implementing Kubernetes liveness, Readiness and Startup probes with Spring Boot Microservice Application?
- kubectl export yaml OR How to generate YAML for deployed kubernetes resources
- Kubernetes Updates
- CI/CD Kubernetes | Setting up CI/CD Jenkins pipeline for kubernetes
- Kubernetes cluster setup with Jenkins
- How to use Persistent Volume and Persistent Claims | Kubernetes
- How to fix ProvisioningFailed persistentvolume controller no volume plugin matched
- Fixing – Cannot bind to requested volume: storageClasseName does not match
- Fixing – pod has unbound immediate persistentvolumeclaims or cannot bind to requested volume incompatible accessmode
- How to fix kubernetes dashboard forbidden 403 error – message services https kubernetes-dashboard is forbidden User
- How to fix Kubernetes – error execution phase preflight [preflight]
- Deploy Spring Boot microservices on kubernetes?
- How to fix – ansible_memtotal_mb minimal_master_memory_mb
- How to use kubespray – 12 Steps for Installing a Production Ready Kubernetes Cluster
- How to setup kubernetes on CentOS 8 and CentOS 7
- How to fix – How to fix - ERROR Swap running with swap on is not supported. Please disable swap
- 14 Steps to Install kubernetes on Ubuntu 20.04(bento/ubuntu-20.04), 18.04(hashicorp/bionic64)
- Kubernetes Dashboard | Kubernetes Admin GUI | Kubernetes Desktop Client
- Install Kubernetes with Minikube