Browse Source

Merge pull request #1888 from chapsuk/issue_1885

Disable swap in vagrant vms
pull/1867/head
Spencer Smith 7 years ago
committed by GitHub
parent
commit
e90769c869
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions
  1. 3
      Vagrantfile
  2. 6
      roles/kubernetes/preinstall/tasks/verify-settings.yml

3
Vagrantfile

@ -129,6 +129,9 @@ Vagrant.configure("2") do |config|
config.vm.provision "shell", inline: "service network restart", run: "always"
end
# Disable swap for each vm
config.vm.provision "shell", inline: "swapoff -a"
# Only execute once the Ansible provisioner,
# when all the machines are up and ready.
if i == $num_instances

6
roles/kubernetes/preinstall/tasks/verify-settings.yml

@ -71,3 +71,9 @@
command: ping -c1 {{ access_ip }}
when: access_ip is defined
ignore_errors: "{{ ignore_assert_errors }}"
- name: Stop if swap enabled
assert:
that: ansible_swaptotal_mb == 0
when: kubelet_fail_swap_on|default(true)
ignore_errors: "{{ ignore_assert_errors }}"
Loading…
Cancel
Save