cordon all deleted nodes before drain (#4756)
Kubespray waits exit of every drain before run other one. Running drain every after each other seems better than parallel, because we should check resources availability every time. But, this way, we have one additional problem: possible restart pods on the nodes that are killed little bit later. Fast cordon before heavy drain seems like an easy solution.
This commit is contained in:
parent
4bc204925a
commit
a3fff1e438
1 changed files with 9 additions and 0 deletions
|
@ -1,4 +1,13 @@
|
||||||
---
|
---
|
||||||
|
- name: cordon-node | Mark all nodes as unschedulable before drain
|
||||||
|
command: >-
|
||||||
|
{{ bin_dir }}/kubectl cordon {{ item }}
|
||||||
|
with_items:
|
||||||
|
- "{{ node.split(',') | default(groups['kube-node']) }}"
|
||||||
|
failed_when: false
|
||||||
|
delegate_to: "{{ groups['kube-master']|first }}"
|
||||||
|
run_once: true
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
- name: remove-node | Drain node except daemonsets resource
|
- name: remove-node | Drain node except daemonsets resource
|
||||||
command: >-
|
command: >-
|
||||||
|
|
Loading…
Reference in a new issue