Skip to content

Commit

Permalink
vagrant: 'kubeadm init --skip-preflight-checks' is deprecated
Browse files Browse the repository at this point in the history
New versions of kubeadm do not have --skip-preflight-checks anymore. It
seems to have been replaced by --ignore-preflight-errors=all.

Before running 'kubeadm init', check if the help text lists the
--skip-preflight-checks option. If it does, then it needs to be used,
otherwise use --ignore-preflight-errors=all by default.

Signed-off-by: Niels de Vos <[email protected]>
  • Loading branch information
nixpanic authored and jarrpa committed Jan 9, 2019
1 parent 9f21d2f commit 4702a03
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion vagrant/roles/master/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,17 @@
register: kubelet

- block:
- name: get parameters of kubeadm init
command: kubeadm init --help
register: kubeadm_init_help

- name: kubeadm needs deprecated --skip-preflight-checks
set_fact:
kubeadm_preflight: '--skip-preflight-checks'
when: kubeadm_init_help.stdout.find('--skip-preflight-checks') != -1

- name: kubeadm init
command: kubeadm init --skip-preflight-checks --token={{ kubernetes_token }} --kubernetes-version=v{{ kube_ver.stdout }} --apiserver-advertise-address={{ ansible_eth1.ipv4.address }}
command: kubeadm init {{ kubeadm_preflight | default('--ignore-preflight-errors=all') }} --token={{ kubernetes_token }} --kubernetes-version=v{{ kube_ver.stdout }} --apiserver-advertise-address={{ ansible_eth1.ipv4.address }}

- name: create root kube dir
file:
Expand Down

0 comments on commit 4702a03

Please sign in to comment.