2018-03-05 15:02:47 +08:00
|
|
|
---
|
2022-07-27 01:51:09 +08:00
|
|
|
- name: remove-node | Delete node
|
2022-01-05 18:26:32 +08:00
|
|
|
command: "{{ kubectl }} delete node {{ kube_override_hostname|default(inventory_hostname) }}"
|
2021-03-24 08:26:05 +08:00
|
|
|
delegate_to: "{{ groups['kube_control_plane']|first }}"
|
2022-09-06 10:50:54 +08:00
|
|
|
# ignore servers that are not nodes
|
2022-10-07 06:03:52 +08:00
|
|
|
when: inventory_hostname in groups['k8s_cluster'] and kube_override_hostname|default(inventory_hostname) in nodes.stdout_lines
|
2022-07-27 01:51:09 +08:00
|
|
|
retries: "{{ delete_node_retries }}"
|
2021-11-08 18:22:58 +08:00
|
|
|
# Sometimes the api-server can have a short window of indisponibility when we delete a master node
|
2022-07-27 01:51:09 +08:00
|
|
|
delay: "{{ delete_node_delay_seconds }}"
|
2021-11-08 18:22:58 +08:00
|
|
|
register: result
|
|
|
|
until: result is not failed
|