Browse Source

Enable kubeadm upgrades to any version (#1709)

pull/1711/head
Matthew Mosesohn 7 years ago
committed by GitHub
parent
commit
689ded0413
1 changed files with 16 additions and 2 deletions
  1. 18
      roles/kubernetes/master/tasks/kubeadm-setup.yml

18
roles/kubernetes/master/tasks/kubeadm-setup.yml

@ -70,7 +70,14 @@
notify: Master | restart kubelet notify: Master | restart kubelet
- name: kubeadm | Upgrade first master - name: kubeadm | Upgrade first master
command: timeout -k 240s 240s {{ bin_dir }}/kubeadm upgrade apply --config={{ kube_config_dir }}/kubeadm-config.yaml {{ kube_version }} --skip-preflight-checks
command: >-
timeout -k 240s 240s
{{ bin_dir }}/kubeadm
upgrade apply -y {{ kube_version }}
--config={{ kube_config_dir }}/kubeadm-config.yaml
--skip-preflight-checks
--allow-experimental-upgrades
--allow-release-candidate-upgrades
register: kubeadm_upgrade register: kubeadm_upgrade
# Retry is because upload config sometimes fails # Retry is because upload config sometimes fails
retries: 3 retries: 3
@ -124,7 +131,14 @@
notify: Master | restart kubelet notify: Master | restart kubelet
- name: kubeadm | Upgrade other masters - name: kubeadm | Upgrade other masters
command: timeout -k 240s 240s {{ bin_dir }}/kubeadm upgrade apply --config={{ kube_config_dir }}/kubeadm-config.yaml {{ kube_version }} --skip-preflight-checks
command: >-
timeout -k 240s 240s
{{ bin_dir }}/kubeadm
upgrade apply -y {{ kube_version }}
--config={{ kube_config_dir }}/kubeadm-config.yaml
--skip-preflight-checks
--allow-experimental-upgrades
--allow-release-candidate-upgrades
register: kubeadm_upgrade register: kubeadm_upgrade
when: inventory_hostname != groups['kube-master']|first and (kubeadm_config.changed and admin_conf.stat.exists) when: inventory_hostname != groups['kube-master']|first and (kubeadm_config.changed and admin_conf.stat.exists)
failed_when: kubeadm_upgrade.rc != 0 and "field is immutable" not in kubeadm_upgrade.stderr failed_when: kubeadm_upgrade.rc != 0 and "field is immutable" not in kubeadm_upgrade.stderr

Loading…
Cancel
Save