After upgrade, allow cilium to be back before uncordoning (#7978)
* After upgrade, allow cilium to be back before uncordoning * add eol * use kube_config_dir variable resolves https://github.com/kubernetes-sigs/kubespray/pull/7978#discussion_r721685549
This commit is contained in:
parent
41e0ca3f85
commit
e707f78899
2 changed files with 15 additions and 0 deletions
3
roles/upgrade/post-upgrade/defaults/main.yml
Normal file
3
roles/upgrade/post-upgrade/defaults/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
# how long to wait for cilium after upgrade before uncordoning
|
||||||
|
upgrade_post_cilium_wait_timeout: 120s
|
|
@ -1,4 +1,16 @@
|
||||||
---
|
---
|
||||||
|
- name: wait for cilium
|
||||||
|
when:
|
||||||
|
- needs_cordoning|default(false)
|
||||||
|
- kube_network_plugin == 'cilium'
|
||||||
|
command: >
|
||||||
|
{{ bin_dir }}/kubectl --kubeconfig {{ kube_config_dir }}/admin.conf
|
||||||
|
wait pod -n kube-system -l k8s-app=cilium
|
||||||
|
--field-selector 'spec.nodeName=={{ kube_override_hostname|default(inventory_hostname) }}'
|
||||||
|
--for=condition=Ready
|
||||||
|
--timeout={{ upgrade_post_cilium_wait_timeout }}
|
||||||
|
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||||
|
|
||||||
- name: Uncordon node
|
- name: Uncordon node
|
||||||
command: "{{ bin_dir }}/kubectl --kubeconfig {{ kube_config_dir }}/admin.conf uncordon {{ kube_override_hostname|default(inventory_hostname) }}"
|
command: "{{ bin_dir }}/kubectl --kubeconfig {{ kube_config_dir }}/admin.conf uncordon {{ kube_override_hostname|default(inventory_hostname) }}"
|
||||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||||
|
|
Loading…
Reference in a new issue