-
Notifications
You must be signed in to change notification settings - Fork 434
Flannel CNI切换为Kube OVN CNI
oilbeater edited this page Jun 27, 2022
·
4 revisions
Wiki 下的中文文档将不在维护,请访问我们最新的中文文档网站,获取最新的文档更新。
- 删除 Flannel CNI的配置
新建脚本,将以下内容拷入,执行脚本,删除Flannel的配置信息。注意过滤条件 -lapp=galaxy 需要修改为适配自己情况的条件,或者直接查出来全部的Flannel Pod,分步骤执行命令。
#!/usr/bin/env bash
set -euo pipefail
echo "[Step -1] Delete flannel and galaxy resource on host"
for galaxy in $(kubectl get pod --no-headers -n kube-system -lapp=galaxy | awk '{print $1}')
do
kubectl exec -n kube-system "$galaxy" -- ip link del flannel.1
kubectl exec -n kube-system "$galaxy" -- rm -rf /host/etc/cni/net.d/00-galaxy.conf
kubectl exec -n kube-system "$galaxy" -- rm -rf /etc/cni/net.d/00-galaxy.conf
done
echo "-------------------------------"
echo ""
echo "[Step 0] delete flannel and galaxy resource in kubernetes"
kubectl delete ds flannel galaxy-daemonset -n kube-system --ignore-not-found=true
kubectl delete cm cni-etc galaxy-etc kube-flannel-cfg -n kube-system --ignore-not-found=true
kubectl delete sa flannel galaxy --ignore-not-found=true
kubectl delete clusterrole flannel --ignore-not-found=true
kubectl delete clusterrolebindings flannel galaxy --ignore-not-found=true
kubectl annotate no --all flannel.alpha.coreos.com/backend-data-
kubectl annotate no --all flannel.alpha.coreos.com/backend-type-
kubectl annotate no --all flannel.alpha.coreos.com/kube-subnet-manager-
kubectl annotate no --all flannel.alpha.coreos.com/public-ip-
echo "-------------------------------"
echo ""
- 执行Kube-OVN的安装脚本,安装Kube-OVN CNI插件