kubespray needs to set kubelet --fail-swap-on to false

Created on 12 Oct 2017  路  2Comments  路  Source: kubernetes-sigs/kubespray

Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

Environment:

  • Cloud provider or hardware configuration: Bare metal nodes
  • OS (printf "$(uname -srm)\n$(cat /etc/os-release)\n"): Debian 9

  • Version of Ansible (ansible --version): 2.4

Kubespray version (commit) (git rev-parse --short HEAD):

Network plugin used: canal

Copy of your inventory file:

3 masters, and 4 workers.

Command used to invoke ansible:

$ ansible-playbook -i my_inventory/inventory.cfg cluster.yml -K -k -b

Output of ansible run:

Anything else do we need to know:

Kubernetes 1.8 kubelet fails with:

Error: failed to run Kubelet: Running with swap on is not supported, please disable swap! or set --fail-swap-on flag to false.

kubespray should detect that swap is present on the system and add the flag to the kubelet systemd definition.

As it's not in place - this results in upgrading nodes and masters never starting up their kubelets and are stuck on NotReady after a 1.7.5 to 1.8 upgrade.

Most helpful comment

@jpds just add to my_inventory/group_vars/k8s-cluster.yml setting: kubelet_fail_swap_on: false (you need to be on master branch, not tagged version) and you will be good to go, i use swap for my dev machines, as they are limited on resources, but in production i will disable swap and it will work with default settings.

All 2 comments

We already added https://github.com/kubernetes-incubator/kubespray/pull/1773
Unfortunately, this is a breaking change that the k8s leaders decided was the right path. It would be irresponsible for us to automatically permit hosts with swap to deploy. You need to do this task manually.

@jpds just add to my_inventory/group_vars/k8s-cluster.yml setting: kubelet_fail_swap_on: false (you need to be on master branch, not tagged version) and you will be good to go, i use swap for my dev machines, as they are limited on resources, but in production i will disable swap and it will work with default settings.

Was this page helpful?
0 / 5 - 0 ratings