ansible-for-kubernetes icon indicating copy to clipboard operation
ansible-for-kubernetes copied to clipboard

Swap file not staying absent

Open wstrater opened this issue 5 years ago • 0 comments
trafficstars

I am marking the swap file as absent and it reappears after a reboot.

I run swapon -show after a reboot.

$ swapon -show
Filename				Type		Size	Used	Priority
/swap.img                              	file    	2097148	0	-2
$ kubectl get nodes
The connection to the server 192.168.1.210:6443 was refused - did you specify the right host or port?

I update my vars/main.yml to include the following. I tried with and without swap_file_path.

swap_file_state: absent
#swap_file_path: /swap.img

When I run my playbook that includes the geerlingguy.swap role the swap is removed and I can access Kubernetes using kubectl.

$ swapon -show
$ kubectl get nodes
NAME            STATUS   ROLES    AGE   VERSION
k8scontroller   Ready    master   17d   v1.18.8
k8sworker1      Ready    node     17d   v1.18.8
k8sworker2      Ready    node     17d   v1.18.8

When I reboot my machine the swap file is back and I can't access Kubernetes.

Wes.

wstrater avatar Sep 03 '20 17:09 wstrater