kubespray 2.24 추가
This commit is contained in:
31
roles/network_plugin/calico/handlers/main.yml
Normal file
31
roles/network_plugin/calico/handlers/main.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
- name: Delete 10-calico.conflist
|
||||
file:
|
||||
path: /etc/cni/net.d/10-calico.conflist
|
||||
state: absent
|
||||
listen: Reset_calico_cni
|
||||
when: calico_cni_config is defined
|
||||
|
||||
- name: Calico | delete calico-node docker containers
|
||||
shell: "set -o pipefail && {{ docker_bin_dir }}/docker ps -af name=k8s_POD_calico-node* -q | xargs --no-run-if-empty {{ docker_bin_dir }}/docker rm -f"
|
||||
args:
|
||||
executable: /bin/bash
|
||||
register: docker_calico_node_remove
|
||||
until: docker_calico_node_remove is succeeded
|
||||
retries: 5
|
||||
when:
|
||||
- container_manager in ["docker"]
|
||||
- calico_cni_config is defined
|
||||
listen: Reset_calico_cni
|
||||
|
||||
- name: Calico | delete calico-node crio/containerd containers
|
||||
shell: 'set -o pipefail && {{ bin_dir }}/crictl pods --name calico-node-* -q | xargs -I% --no-run-if-empty bash -c "{{ bin_dir }}/crictl stopp % && {{ bin_dir }}/crictl rmp %"'
|
||||
args:
|
||||
executable: /bin/bash
|
||||
register: crictl_calico_node_remove
|
||||
until: crictl_calico_node_remove is succeeded
|
||||
retries: 5
|
||||
when:
|
||||
- container_manager in ["crio", "containerd"]
|
||||
- calico_cni_config is defined
|
||||
listen: Reset_calico_cni
|
||||
Reference in New Issue
Block a user