c12s-kubespray/roles/network_plugin/calico/handlers/main.yml
Sergey Kolekonov 428e52e0d1 Fix calico handler for containerd (#4985)
crictl tool must be used to delete containers in case of containerd
deployment
2019-07-16 08:35:24 -07:00

20 lines
694 B
YAML

---
- name: reset_calico_cni
command: /bin/true
notify:
- delete 10-calico.conflist
- docker | delete calico-node containers
- containerd | delete calico-node containers
- name: delete 10-calico.conflist
file:
path: /etc/cni/net.d/10-calico.conflist
state: absent
- name: docker | delete calico-node containers
shell: "docker ps -af name=k8s_POD_calico-node* -q | xargs --no-run-if-empty docker rm -f"
when: container_manager in ["docker"]
- name: containerd | delete calico-node containers
shell: 'crictl pods --name calico-node-* -q | xargs -I% --no-run-if-empty bash -c "crictl stopp % && crictl rmp %"'
when: container_manager in ["crio", "containerd"]