Browse Source
make pre-remove node draining a failable task (#6442)
and add configuration to allow ungraceful removal
pull/6573/head
Lars
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
2 deletions
-
roles/remove-node/pre-remove/defaults/main.yml
-
roles/remove-node/pre-remove/tasks/main.yml
|
|
@ -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 |