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
Branches
Tags
No related merge requests found
--- ---
allow_ungraceful_removal: false
drain_grace_period: 300 drain_grace_period: 300
drain_timeout: 360s drain_timeout: 360s
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
{{ bin_dir }}/kubectl cordon {{ hostvars[item]['kube_override_hostname']|default(item) }} {{ bin_dir }}/kubectl cordon {{ hostvars[item]['kube_override_hostname']|default(item) }}
with_items: with_items:
- "{{ node.split(',') | default(groups['kube-node']) }}" - "{{ 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 }}" delegate_to: "{{ groups['kube-master']|first }}"
run_once: true run_once: true
ignore_errors: yes ignore_errors: yes
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
--delete-local-data {{ hostvars[item]['kube_override_hostname']|default(item) }} --delete-local-data {{ hostvars[item]['kube_override_hostname']|default(item) }}
with_items: with_items:
- "{{ node.split(',') | default(groups['kube-node']) }}" - "{{ 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 }}" delegate_to: "{{ groups['kube-master']|first }}"
run_once: true run_once: true
ignore_errors: yes ignore_errors: yes
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment