Disable swap #267
-
I assume that swap needs to be disabled during installation: ref why: k3s-io/k3s-ansible#147 ref how to: https://germaniumhq.com/2019/02/14/2019-02-14-Disabling-Swap-for-Kubernetes-in-an-Ansible-Playbook/ |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Don't mess with this in k3s-ansible. I have a preflight.yml and do whatever it requires in there. e.g. swap, enable/disable ipv6, install nfs-common, LANG to C.UTF-8, install ntp and htpdate (for fixing the clock after a VM restore), install qemu-guest-agent, So you see there is plenty to do - totaly legit - but it is 1000% out of the scope of k3s-ansible. |
Beta Was this translation helpful? Give feedback.
-
is the preflight optional in the procedure? i wonder why the swap hasnt been disabled in my case, maybe that was skipped ? can that be run on a already existing cluster? |
Beta Was this translation helpful? Give feedback.
-
Preflight is my own file I created.... (preflight.yml). |
Beta Was this translation helpful? Give feedback.
-
Check this: https://pastebin.com/3XPzSQfT |
Beta Was this translation helpful? Give feedback.
-
I would support adding an optional preflight list that could be enabled. It would make this a full solution for spinning up k3s aong with a os that supports cloud-init functionality. |
Beta Was this translation helpful? Give feedback.
-
Probably best to do it this way: - name: System Configuration | Disable swap
ansible.posix.mount:
name: "{{ item }}"
fstype: swap
state: absent
loop: ["none", "swap"] |
Beta Was this translation helpful? Give feedback.
Probably best to do it this way: