summaryrefslogtreecommitdiff
path: root/common/kubernetes-cleanup.yml
diff options
context:
space:
mode:
Diffstat (limited to 'common/kubernetes-cleanup.yml')
-rw-r--r--common/kubernetes-cleanup.yml15
1 files changed, 8 insertions, 7 deletions
diff --git a/common/kubernetes-cleanup.yml b/common/kubernetes-cleanup.yml
index be55d11e..41678204 100644
--- a/common/kubernetes-cleanup.yml
+++ b/common/kubernetes-cleanup.yml
@@ -20,6 +20,14 @@
loop: "{{ groups['_kubernetes_nodes_remove_'] | default([]) }}"
command: "kubectl drain {{ item }} --delete-local-data --force --ignore-daemonsets"
+
+- name: remove nodes from api server
+ hosts: _kubernetes_primary_master_
+ tasks:
+ - name: remove superflous nodes
+ loop: "{{ groups['_kubernetes_nodes_remove_'] | default([]) }}"
+ command: "kubectl delete node {{ item }}"
+
- name: try to clean superflous nodes
hosts: _kubernetes_nodes_remove_
roles:
@@ -28,10 +36,3 @@
when: hostvars[groups['_kubernetes_primary_master_'][0]].kubernetes_network_plugin == 'kubeguard'
vars:
kubeguard_action: remove
-
-- name: remove node from api server
- hosts: _kubernetes_primary_master_
- tasks:
- - name: remove superflous nodes
- loop: "{{ groups['_kubernetes_nodes_remove_'] | default([]) }}"
- command: "kubectl delete node {{ item }}"