97ebbb9672
Based on #718 introduced by rsmitty. Includes all roles and all options to support deployment of new hosts in case they were added to inventory. Main difference here is that master role is evaluated first so that master components get upgraded first. Fixes #694
12 lines
401 B
YAML
12 lines
401 B
YAML
---
|
|
|
|
- name: Cordon node
|
|
command: "{{ bin_dir }}/kubectl cordon {{ ansible_hostname }}"
|
|
delegate_to: "{{ groups['kube-master'][0] }}"
|
|
|
|
- name: Drain node
|
|
command: "{{ bin_dir }}/kubectl drain --force --ignore-daemonsets --grace-period 30 --delete-local-data {{ ansible_hostname }}"
|
|
delegate_to: "{{ groups['kube-master'][0] }}"
|
|
|
|
- name: Sleep for grace period for draining
|
|
pause: seconds=30
|