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

18 lines
552 B
YAML
Raw Normal View History

---
- name: Lookup node IP in kubernetes
shell: >-
{{ bin_dir }}/kubectl get nodes {{ node }}
-o jsonpath='{range.status.addresses[?(@.type=="InternalIP")]}{.address}{"\n"}{end}'
register: remove_node_ip
when:
- inventory_hostname in groups['etcd']
- ip is not defined
- access_ip is not defined
delegate_to: "{{ groups['etcd']|first }}"
failed_when: false
- name: Delete node
command: "{{ bin_dir }}/kubectl delete node {{ inventory_hostname }}"
2018-06-23 14:40:59 +08:00
delegate_to: "{{ groups['kube-master']|first }}"
ignore_errors: yes