Retry kubeadm proxy and secondary master init tasks (#3715)
Due to suboptimal external loadbalancer configs, the LoadBalancer might point to a downed kube-apiserver that is not set up yet.
This commit is contained in:
parent
d188876a91
commit
ff09141a14
1 changed files with 5 additions and 0 deletions
|
@ -139,6 +139,9 @@
|
||||||
# FIXME(mattymo): remove when https://github.com/kubernetes/kubeadm/issues/433 is fixed
|
# FIXME(mattymo): remove when https://github.com/kubernetes/kubeadm/issues/433 is fixed
|
||||||
- name: kubeadm | Enable kube-proxy
|
- name: kubeadm | Enable kube-proxy
|
||||||
command: "{{ bin_dir }}/kubeadm alpha phase addon kube-proxy --config={{ kube_config_dir }}/kubeadm-config.{{ kubeadmConfig_api_version }}.yaml"
|
command: "{{ bin_dir }}/kubeadm alpha phase addon kube-proxy --config={{ kube_config_dir }}/kubeadm-config.{{ kubeadmConfig_api_version }}.yaml"
|
||||||
|
register: kubeadm_kube_proxy_enable
|
||||||
|
retries: 10
|
||||||
|
until: kubeadm_kube_proxy_enable is succeeded
|
||||||
when: inventory_hostname == groups['kube-master']|first
|
when: inventory_hostname == groups['kube-master']|first
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
|
@ -177,6 +180,8 @@
|
||||||
- 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.{{ kubeadmConfig_api_version }}.yaml --ignore-preflight-errors=all
|
||||||
register: kubeadm_init
|
register: kubeadm_init
|
||||||
|
retries: 10
|
||||||
|
until: kubeadm_init is succeeded or "field is immutable" in kubeadm_init.stderr
|
||||||
when: inventory_hostname != groups['kube-master']|first and not kubeadm_already_run.stat.exists
|
when: inventory_hostname != groups['kube-master']|first and not kubeadm_already_run.stat.exists
|
||||||
failed_when: kubeadm_init.rc != 0 and "field is immutable" not in kubeadm_init.stderr
|
failed_when: kubeadm_init.rc != 0 and "field is immutable" not in kubeadm_init.stderr
|
||||||
notify: Master | restart kubelet
|
notify: Master | restart kubelet
|
||||||
|
|
Loading…
Reference in a new issue