2018-12-25 07:06:27 +00:00
|
|
|
---
|
|
|
|
- name: kubeadm | Upgrade first master
|
|
|
|
command: >-
|
|
|
|
timeout -k 600s 600s
|
|
|
|
{{ bin_dir }}/kubeadm
|
|
|
|
upgrade apply -y {{ kube_version }}
|
|
|
|
--config={{ kube_config_dir }}/kubeadm-config.yaml
|
|
|
|
--ignore-preflight-errors=all
|
|
|
|
--allow-experimental-upgrades
|
|
|
|
--allow-release-candidate-upgrades
|
|
|
|
--etcd-upgrade=false
|
|
|
|
--force
|
|
|
|
register: kubeadm_upgrade
|
|
|
|
# Retry is because upload config sometimes fails
|
|
|
|
retries: 3
|
|
|
|
when: inventory_hostname == groups['kube-master']|first
|
|
|
|
failed_when: kubeadm_upgrade.rc != 0 and "field is immutable" not in kubeadm_upgrade.stderr
|
|
|
|
notify: Master | restart kubelet
|
|
|
|
|
2019-04-19 13:01:54 +00:00
|
|
|
# FIXME: https://github.com/kubernetes/kubeadm/issues/1498 remove stdout_lines
|
|
|
|
# check after issue is fixed
|
2018-12-25 07:06:27 +00:00
|
|
|
- name: kubeadm | Upgrade other masters
|
|
|
|
command: >-
|
|
|
|
timeout -k 600s 600s
|
|
|
|
{{ bin_dir }}/kubeadm
|
|
|
|
upgrade apply -y {{ kube_version }}
|
|
|
|
--config={{ kube_config_dir }}/kubeadm-config.yaml
|
|
|
|
--ignore-preflight-errors=all
|
|
|
|
--allow-experimental-upgrades
|
|
|
|
--allow-release-candidate-upgrades
|
|
|
|
--etcd-upgrade=false
|
2019-07-09 12:41:59 +00:00
|
|
|
--force
|
2018-12-25 07:06:27 +00:00
|
|
|
register: kubeadm_upgrade
|
|
|
|
when: inventory_hostname != groups['kube-master']|first
|
2019-04-19 13:01:54 +00:00
|
|
|
failed_when:
|
|
|
|
- kubeadm_upgrade.rc != 0
|
|
|
|
- '"field is immutable" not in kubeadm_upgrade.stderr'
|
|
|
|
- kubeadm_upgrade.stdout_lines | length > 1
|
2018-12-25 07:06:27 +00:00
|
|
|
notify: Master | restart kubelet
|