Enable option to have K8s work with swap#87
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: kishen-v The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
cc @Karthik-K-N |
|
Thank you for adding this feature. |
| {% if (swap_enabled is defined) and swap_enabled %} | ||
| failSwapOn: false | ||
| featureGates: | ||
| NodeSwap: true |
There was a problem hiding this comment.
is this not beta yet? if yes - why in feature gate?
There was a problem hiding this comment.
Hi @mkumatag,
I'd followed this guide: https://kubernetes.io/blog/2023/08/24/swap-linux-beta/
Plus we do not require the featureGates to be set, it seems to work okay without it.
Thanks!
| swapon -s | ||
| when: swap_enabled | ||
|
|
||
| - name: Set SELinux to permissive mode |
There was a problem hiding this comment.
why is this selinux here?
There was a problem hiding this comment.
The selinux changes had been here for a while:
https://github.com/ppc64le-cloud/k8s-ansible/blob/5416284ada67db1fe6dc7a2d25fabe96d4892c11/roles/disable-swap-selinux/tasks/main.yml
This file was renamed from disable-swap-selinux to toggle-swap-selinux to bring relevance.
There was a problem hiding this comment.
toggling two different param which aren't related in one file doesn't make sense to me, we need to find some other way deal with these params.
This PR enables kubernetes to leverage swap memory, which is currently
beta- https://kubernetes.io/blog/2023/08/24/swap-linux-beta/Steps to use this feature:
Toggle
swap_enabledvar ingroupvars/alltotrue. Initially the swap size is set to 4GB, which can be revisited later.