13 lines
401 B
YAML
13 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
|