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:
bobahspb 2019-05-22 09:36:05 +03:00 committed by Kubernetes Prow Robot
parent 4bc204925a
commit a3fff1e438

View file

@ -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: >-