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