Skip to content
Snippets Groups Projects
Unverified Commit ca66a96d authored by Lars's avatar Lars Committed by GitHub
Browse files

make pre-remove node draining a failable task (#6442)

and add configuration to allow ungraceful removal
parent 0c09ec5d
No related branches found
No related tags found
No related merge requests found
---
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment