Skip to content

Commit

Permalink
fix: cilium clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmzj committed Aug 11, 2018
1 parent 7261653 commit c7e4ac7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 99.clean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@
ip link del kube-bridge; \
ip link del dummy0; \
ip link del kube-ipvs0; \
ip link del cilium_net; \
ip link del cilium_vxlan; \
systemctl restart networking; \
systemctl restart network"
ignore_errors: true
Expand Down
23 changes: 23 additions & 0 deletions tools/change_k8s_network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
run_once: true
when: '"calico" in pod_info.stdout'

- name: 删除原network插件cilium部署
shell: "{{ bin_dir }}/kubectl delete -f /opt/kube/kube-system/cilium/ || \
{{ bin_dir }}/kubectl delete -f /root/local/kube-system/cilium/"
ignore_errors: true
run_once: true
when: '"cilium" in pod_info.stdout'

- name: 删除原network插件flannel部署
shell: "{{ bin_dir }}/kubectl delete -f /opt/kube/kube-system/flannel/ || \
{{ bin_dir }}/kubectl delete -f /root/local/kube-system/flannel/"
Expand Down Expand Up @@ -59,7 +66,11 @@
- "/run/flannel/"
- "/etc/calico/"
- "/var/run/calico/"
- "/var/lib/calico/"
- "/var/log/calico/"
- "/etc/cilium/"
- "/var/run/cilium/"
- "/sys/fs/bpf/tc/"
- "/var/lib/cni/"
- "/var/lib/kube-router/"
- "/opt/kube/kube-system/"
Expand All @@ -71,6 +82,9 @@
ip link del mynet0; \
ip link del kube-bridge; \
ip link del dummy0; \
ip link del kube-ipvs0; \
ip link del cilium_net; \
ip link del cilium_vxlan; \
systemctl restart networking; \
systemctl restart network"
ignore_errors: true
Expand All @@ -87,6 +101,15 @@
tasks:
- name: 重启lb的keepalived服务
service: name=keepalived state=restarted

- name: 轮询等待apiserver服务恢复
command: "{{ bin_dir }}/kubectl get node"
register: result
until: result.rc == 0
retries: 5
delay: 6
delegate_to: "{{ groups.deploy[0] }}"
run_once: true

- hosts:
- kube-master
Expand Down

0 comments on commit c7e4ac7

Please sign in to comment.