mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-18 17:37:32 -02:30
Use async/poll on drain tasks to prevent SSH connection timeouts (#13081)
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
--grace-period {{ drain_grace_period }}
|
||||
--timeout {{ drain_timeout }}
|
||||
--delete-emptydir-data {{ kube_override_hostname }}
|
||||
async: "{{ (drain_timeout | regex_replace('s$', '') | int) + 120 }}"
|
||||
poll: 15
|
||||
when:
|
||||
- groups['kube_control_plane'] | length > 0
|
||||
# ignore servers that are not nodes
|
||||
|
||||
@@ -59,6 +59,8 @@
|
||||
--timeout {{ drain_timeout }}
|
||||
--delete-emptydir-data {{ kube_override_hostname | default(inventory_hostname) }}
|
||||
{% if drain_pod_selector %}--pod-selector '{{ drain_pod_selector }}'{% endif %}
|
||||
async: "{{ (drain_timeout | regex_replace('s$', '') | int) + 120 }}"
|
||||
poll: 15
|
||||
when: drain_nodes
|
||||
register: result
|
||||
failed_when:
|
||||
@@ -82,6 +84,8 @@
|
||||
--delete-emptydir-data {{ kube_override_hostname | default(inventory_hostname) }}
|
||||
{% if drain_pod_selector %}--pod-selector '{{ drain_pod_selector }}'{% endif %}
|
||||
--disable-eviction
|
||||
async: "{{ (drain_fallback_timeout | regex_replace('s$', '') | int) + 120 }}"
|
||||
poll: 15
|
||||
register: drain_fallback_result
|
||||
until: drain_fallback_result.rc == 0
|
||||
retries: "{{ drain_fallback_retries }}"
|
||||
|
||||
Reference in New Issue
Block a user