diff options
author | Christian Pointner <equinox@spreadspace.org> | 2020-06-20 19:39:23 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2020-06-20 19:39:23 +0200 |
commit | 954d477be41072cf8a8a4260a8fe46f66674c117 (patch) | |
tree | b5102e0d8f06088fb2c58072a63b31568ed9ced4 /common/kubernetes-cluster-cleanup.yml | |
parent | add ch-equinox-ws to managment vlan (diff) | |
parent | kubernetes: add network-plugin kube-router (diff) |
Merge branch 'topic/kubernetes-network-plugins'
Diffstat (limited to 'common/kubernetes-cluster-cleanup.yml')
-rw-r--r-- | common/kubernetes-cluster-cleanup.yml | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/common/kubernetes-cluster-cleanup.yml b/common/kubernetes-cluster-cleanup.yml index 83d6945c..5647e3d6 100644 --- a/common/kubernetes-cluster-cleanup.yml +++ b/common/kubernetes-cluster-cleanup.yml @@ -13,24 +13,19 @@ add_host: name: "{{ item }}" inventory_dir: "{{ hostvars[item].inventory_dir }}" - group: _kubernetes_nodes_remove_ + group: _kubernetes_nodes_prune_ changed_when: False - name: drain superflous nodes - loop: "{{ groups['_kubernetes_nodes_remove_'] | default([]) }}" + loop: "{{ groups['_kubernetes_nodes_prune_'] | default([]) }}" command: "kubectl drain {{ item }} --delete-local-data --force --ignore-daemonsets" +- name: prune superflous nodes from cluster + hosts: _kubernetes_nodes_ + roles: + - role: kubernetes/kubeadm/prune -- 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_ +- name: wipe superflous nodes + hosts: _kubernetes_nodes_prune_ roles: - role: kubernetes/kubeadm/reset - - role: kubernetes/net/kubeguard/reset - when: hostvars[groups['_kubernetes_primary_master_'][0]].kubernetes_network_plugin == 'kubeguard' |