mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-01 01:28:11 -03:30
Add capability to use swap, requires Kube 1.22 (#8241)
* Alpha-NodeSwap: allow nodes to use swap * CI: Add Fedora 35 with experimental swap job
This commit is contained in:
@@ -106,3 +106,7 @@ eventRecordQPS: {{ kubelet_event_record_qps }}
|
||||
shutdownGracePeriod: {{ kubelet_shutdown_grace_period }}
|
||||
shutdownGracePeriodCriticalPods: {{ kubelet_shutdown_grace_period_critical_pods }}
|
||||
{% endif %}
|
||||
{% if not kubelet_fail_swap_on|default(true) %}
|
||||
memorySwap:
|
||||
swapBehavior: {{ kubelet_swap_behavior|default("LimitedSwap") }}
|
||||
{% endif %}
|
||||
|
||||
@@ -13,11 +13,17 @@
|
||||
command: /sbin/swapon -s
|
||||
register: swapon
|
||||
changed_when: no
|
||||
|
||||
- name: Disable swap
|
||||
command: /sbin/swapoff -a
|
||||
when: swapon.stdout
|
||||
when:
|
||||
- swapon.stdout
|
||||
- kubelet_fail_swap_on | default(True)
|
||||
ignore_errors: "{{ ansible_check_mode }}" # noqa ignore-errors
|
||||
|
||||
- name: Disable swapOnZram for Fedora
|
||||
command: touch /etc/systemd/zram-generator.conf
|
||||
when: swapon.stdout and ansible_distribution in ['Fedora']
|
||||
when:
|
||||
- swapon.stdout
|
||||
- ansible_distribution in ['Fedora']
|
||||
- kubelet_fail_swap_on | default(True)
|
||||
|
||||
Reference in New Issue
Block a user