root@ubuntu:~# kubectl delete -f kube-flannel.yml podsecuritypolicy.policy "psp.flannel.unprivileged" deleted clusterrole.rbac.authorization.k8s.io "flannel" deleted clusterrolebinding.rbac.authorization.k8s.io "flannel" deleted serviceaccount "flannel" deleted configmap "kube-flannel-cfg" deleted daemonset.apps "kube-flannel-ds-amd64" deleted daemonset.apps "kube-flannel-ds-arm64" deleted daemonset.apps "kube-flannel-ds-arm" deleted daemonset.apps "kube-flannel-ds-ppc64le" deleted daemonset.apps "kube-flannel-ds-s390x" deleted
#第二步,在node节点清理flannel网络留下的文件 ifconfig cni0 down ip link delete cni0 ifconfig flannel.1 down ip link delete flannel.1 rm -rf /var/lib/cni/ rm -f /etc/cni/net.d/*
root@cloud:~# ifconfig cni0 down root@cloud:~# ip link delete cni0 root@cloud:~# ifconfig flannel.1 down root@cloud:~# ip link delete flannel.1 root@cloud:~# rm -rf /var/lib/cni/ root@cloud:~# rm -f /etc/cni/net.d/* root@cloud:~#