summaryrefslogtreecommitdiff
path: root/playbooks/k8s-emc.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'playbooks/k8s-emc.yaml')
-rw-r--r--playbooks/k8s-emc.yaml8
1 files changed, 7 insertions, 1 deletions
diff --git a/playbooks/k8s-emc.yaml b/playbooks/k8s-emc.yaml
index e1ec695e..7c6a21dd 100644
--- a/playbooks/k8s-emc.yaml
+++ b/playbooks/k8s-emc.yaml
@@ -65,6 +65,10 @@
group: k8s-emc-remove
changed_when: False
+ - name: drain superflous nodes
+ with_items: "{{ groups['k8s-emc-remove'] | default([]) }}"
+ command: "kubectl drain {{ item }} --delete-local-data --force --ignore-daemonsets"
+
- name: try to clean superflous nodes
hosts: k8s-emc-remove
vars:
@@ -80,4 +84,6 @@
with_items: "{{ groups['k8s-emc-remove'] | default([]) }}"
command: "kubectl delete node {{ item }}"
- # TODO: remove boostrap token
+ - name: remove bootstrap-token
+ when: kube_bootstrap_token != ""
+ command: "kubectl --namespace kube-system delete secret bootstrap-token-{{ kube_bootstrap_token.split('.') | first }}"