make pre-remove node draining a failable task (#6442)
and add configuration to allow ungraceful removalpull/6573/head
parent
0c09ec5d13
commit
ca66a96d0a
|
@ -1,3 +1,4 @@
|
|||
---
|
||||
allow_ungraceful_removal: false
|
||||
drain_grace_period: 300
|
||||
drain_timeout: 360s
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{{ bin_dir }}/kubectl cordon {{ hostvars[item]['kube_override_hostname']|default(item) }}
|
||||
with_items:
|
||||
- "{{ node.split(',') | default(groups['kube-node']) }}"
|
||||
failed_when: false
|
||||
failed_when: result.rc == 0 and not allow_ungraceful_removal
|
||||
delegate_to: "{{ groups['kube-master']|first }}"
|
||||
run_once: true
|
||||
ignore_errors: yes
|
||||
|
@ -19,7 +19,7 @@
|
|||
--delete-local-data {{ hostvars[item]['kube_override_hostname']|default(item) }}
|
||||
with_items:
|
||||
- "{{ node.split(',') | default(groups['kube-node']) }}"
|
||||
failed_when: false
|
||||
failed_when: result.rc == 0 and not allow_ungraceful_removal
|
||||
delegate_to: "{{ groups['kube-master']|first }}"
|
||||
run_once: true
|
||||
ignore_errors: yes
|
||||
|
|
Loading…
Reference in New Issue