Fix skip upgrade first master (#3915)

pull/3906/head
Rong Zhang 2018-12-19 21:16:14 +08:00 committed by Kubernetes Prow Robot
parent 50b884a32d
commit 925a820b56
2 changed files with 7 additions and 7 deletions

View File

@ -58,7 +58,7 @@
- name: Create kubeadm client config - name: Create kubeadm client config
template: template:
src: "kubeadm-client.conf.{{ kubeadmConfig_api_version }}.j2" src: "kubeadm-client.conf.{{ kubeadmConfig_api_version }}.j2"
dest: "{{ kube_config_dir }}/kubeadm-client.{{ kubeadmConfig_api_version }}.conf" dest: "{{ kube_config_dir }}/kubeadm-client.conf"
backup: yes backup: yes
when: not is_kube_master when: not is_kube_master
vars: vars:
@ -67,7 +67,7 @@
- name: Join to cluster if needed - name: Join to cluster if needed
command: >- command: >-
{{ bin_dir }}/kubeadm join {{ bin_dir }}/kubeadm join
--config {{ kube_config_dir}}/kubeadm-client.{{ kubeadmConfig_api_version }}.conf --config {{ kube_config_dir}}/kubeadm-client.conf
--ignore-preflight-errors=all --ignore-preflight-errors=all
register: kubeadm_join register: kubeadm_join
when: not is_kube_master and (not kubelet_conf.stat.exists) when: not is_kube_master and (not kubelet_conf.stat.exists)

View File

@ -123,11 +123,11 @@
- name: kubeadm | Create kubeadm config - name: kubeadm | Create kubeadm config
template: template:
src: "kubeadm-config.{{ kubeadmConfig_api_version }}.yaml.j2" src: "kubeadm-config.{{ kubeadmConfig_api_version }}.yaml.j2"
dest: "{{ kube_config_dir }}/kubeadm-config.{{ kubeadmConfig_api_version }}.yaml" dest: "{{ kube_config_dir }}/kubeadm-config.yaml"
register: kubeadm_config register: kubeadm_config
- name: kubeadm | Initialize first master - name: kubeadm | Initialize first master
command: timeout -k 600s 600s {{ bin_dir }}/kubeadm init --config={{ kube_config_dir }}/kubeadm-config.{{ kubeadmConfig_api_version }}.yaml --ignore-preflight-errors=all command: timeout -k 600s 600s {{ bin_dir }}/kubeadm init --config={{ kube_config_dir }}/kubeadm-config.yaml --ignore-preflight-errors=all
register: kubeadm_init register: kubeadm_init
# Retry is because upload config sometimes fails # Retry is because upload config sometimes fails
retries: 3 retries: 3
@ -140,7 +140,7 @@
timeout -k 600s 600s timeout -k 600s 600s
{{ bin_dir }}/kubeadm {{ bin_dir }}/kubeadm
upgrade apply -y {{ kube_version }} upgrade apply -y {{ kube_version }}
--config={{ kube_config_dir }}/kubeadm-config.{{ kubeadmConfig_api_version }}.yaml --config={{ kube_config_dir }}/kubeadm-config.yaml
--ignore-preflight-errors=all --ignore-preflight-errors=all
--allow-experimental-upgrades --allow-experimental-upgrades
--allow-release-candidate-upgrades --allow-release-candidate-upgrades
@ -186,7 +186,7 @@
when: inventory_hostname != groups['kube-master']|first when: inventory_hostname != groups['kube-master']|first
- name: kubeadm | Init other uninitialized masters - name: kubeadm | Init other uninitialized masters
command: timeout -k 600s 600s {{ bin_dir }}/kubeadm init --config={{ kube_config_dir }}/kubeadm-config.{{ kubeadmConfig_api_version }}.yaml --ignore-preflight-errors=all command: timeout -k 600s 600s {{ bin_dir }}/kubeadm init --config={{ kube_config_dir }}/kubeadm-config.yaml --ignore-preflight-errors=all
register: kubeadm_init register: kubeadm_init
retries: 10 retries: 10
until: kubeadm_init is succeeded or "field is immutable" in kubeadm_init.stderr until: kubeadm_init is succeeded or "field is immutable" in kubeadm_init.stderr
@ -199,7 +199,7 @@
timeout -k 600s 600s timeout -k 600s 600s
{{ bin_dir }}/kubeadm {{ bin_dir }}/kubeadm
upgrade apply -y {{ kube_version }} upgrade apply -y {{ kube_version }}
--config={{ kube_config_dir }}/kubeadm-config.{{ kubeadmConfig_api_version }}.yaml --config={{ kube_config_dir }}/kubeadm-config.yaml
--ignore-preflight-errors=all --ignore-preflight-errors=all
--allow-experimental-upgrades --allow-experimental-upgrades
--allow-release-candidate-upgrades --allow-release-candidate-upgrades