From e41c0532e3d23d521bce549446d68e939d16269c Mon Sep 17 00:00:00 2001 From: Aivars Sterns Date: Wed, 11 Oct 2017 21:49:31 +0300 Subject: [PATCH] add possibility to disable fail with swap (#1773) --- roles/kubernetes/node/defaults/main.yml | 3 +++ roles/kubernetes/node/templates/kubelet.kubeadm.env.j2 | 1 + roles/kubernetes/node/templates/kubelet.standard.env.j2 | 1 + 3 files changed, 5 insertions(+) diff --git a/roles/kubernetes/node/defaults/main.yml b/roles/kubernetes/node/defaults/main.yml index 4b6ed6b14..05a34cec1 100644 --- a/roles/kubernetes/node/defaults/main.yml +++ b/roles/kubernetes/node/defaults/main.yml @@ -25,6 +25,9 @@ kubelet_enforce_node_allocatable: "\"\"" # Note that PID namespace sharing requires docker >= 1.13.1. kubelet_disable_shared_pid: true +### fail with swap on (default true) +kubelet_fail_swap_on: true + # Reserve this space for system resources kubelet_memory_limit: 256M kubelet_cpu_limit: 100m diff --git a/roles/kubernetes/node/templates/kubelet.kubeadm.env.j2 b/roles/kubernetes/node/templates/kubelet.kubeadm.env.j2 index 817c8a34a..57a800471 100644 --- a/roles/kubernetes/node/templates/kubelet.kubeadm.env.j2 +++ b/roles/kubernetes/node/templates/kubelet.kubeadm.env.j2 @@ -28,6 +28,7 @@ KUBELET_HOSTNAME="--hostname-override={{ kube_override_hostname }}" --node-status-update-frequency={{ kubelet_status_update_frequency }} \ --cgroup-driver={{ kubelet_cgroup_driver|default(kubelet_cgroup_driver_detected) }} \ --docker-disable-shared-pid={{ kubelet_disable_shared_pid }} \ +--fail-swap-on={{ kubelet_fail_swap_on|default(true)}} \ {% endset %} {# Node reserved CPU/memory #} diff --git a/roles/kubernetes/node/templates/kubelet.standard.env.j2 b/roles/kubernetes/node/templates/kubelet.standard.env.j2 index 574a541ba..677b886c2 100644 --- a/roles/kubernetes/node/templates/kubelet.standard.env.j2 +++ b/roles/kubernetes/node/templates/kubelet.standard.env.j2 @@ -21,6 +21,7 @@ KUBELET_HOSTNAME="--hostname-override={{ kube_override_hostname }}" {% endif %} --cgroup-driver={{ kubelet_cgroup_driver|default(kubelet_cgroup_driver_detected) }} \ --cgroups-per-qos={{ kubelet_cgroups_per_qos }} \ +--fail-swap-on={{ kubelet_fail_swap_on|default(true)}} \ --enforce-node-allocatable={{ kubelet_enforce_node_allocatable }} {% endif %}{% endset %} {# DNS settings for kubelet #}