Browse Source

Ignore deleting nodes that are not in cluster (#9244)

pull/9258/head
Ho Kim 2 years ago
committed by GitHub
parent
commit
ad7cefa352
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions
  1. 3
      roles/remove-node/post-remove/tasks/main.yml

3
roles/remove-node/post-remove/tasks/main.yml

@ -2,7 +2,8 @@
- name: remove-node | Delete node - name: remove-node | Delete node
command: "{{ kubectl }} delete node {{ kube_override_hostname|default(inventory_hostname) }}" command: "{{ kubectl }} delete node {{ kube_override_hostname|default(inventory_hostname) }}"
delegate_to: "{{ groups['kube_control_plane']|first }}" delegate_to: "{{ groups['kube_control_plane']|first }}"
when: inventory_hostname in groups['k8s_cluster']
# ignore servers that are not nodes
when: inventory_hostname in groups['k8s_cluster'] and inventory_hostname in nodes.stdout_lines
retries: "{{ delete_node_retries }}" retries: "{{ delete_node_retries }}"
# Sometimes the api-server can have a short window of indisponibility when we delete a master node # Sometimes the api-server can have a short window of indisponibility when we delete a master node
delay: "{{ delete_node_delay_seconds }}" delay: "{{ delete_node_delay_seconds }}"

Loading…
Cancel
Save