Merge pull request #2903 from riverzhang/swap

Add manage swap on the worker node
pull/2907/merge
Rong Zhang 2018-06-21 22:20:23 +08:00 committed by GitHub
commit 1aee6ec371
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 0 deletions

View File

@ -1,4 +1,8 @@
---
# Disable swap
- import_tasks: swapoff.yml
when: disable_swap
- import_tasks: verify-settings.yml
tags:
- asserts

View File

@ -0,0 +1,10 @@
---
- name: Remove swapfile from /etc/fstab
mount:
name: swap
fstype: swap
state: absent
- name: Disable swap
command: swapoff -a
when: ansible_swaptotal_mb > 0

View File

@ -12,6 +12,8 @@ kube_api_anonymous_auth: false
# Default value, but will be set to true automatically if detected
is_atomic: false
# optional disable the swap
disable_swap: false
## Change this to use another Kubernetes version, e.g. a current beta release
kube_version: v1.10.4