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
pull/8049/head
Rene Luria 2021-10-05 21:56:58 +02:00 committed by GitHub
parent 41e0ca3f85
commit e707f78899
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,3 @@
---
# how long to wait for cilium after upgrade before uncordoning
upgrade_post_cilium_wait_timeout: 120s

View File

@ -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
command: "{{ bin_dir }}/kubectl --kubeconfig {{ kube_config_dir }}/admin.conf uncordon {{ kube_override_hostname|default(inventory_hostname) }}"
delegate_to: "{{ groups['kube_control_plane'][0] }}"