K8s Calico替换为Cilium,以及安装Cilium过程
一、删除Calico
kubectl delete daemonset calico-node -n kube-system
kubectl delete deployment calico-kube-controllers -n kube-system
kubectl delete ds kube-flannel-ds -n kube-system
kubectl delete cm calico-config -n kube-system
kubectl delete secret calico-etcd-secrets -n kube-system
kubectl delete clusterrolebinding calico-node
kubectl delete clusterrole calico-node
kubectl delete sa calico-node -n kube-system
kubectl delete sa calico-kube-controllers -n kube-system
kubectl delete crd bgppeers.crd.projectcalico.org
kubectl delete crd bgpconfigurations.crd.projectcalico.org
kubectl delete crd ippools.crd.projectcalico.org
kubectl delete crd hostendpoints.crd.projectcalico.org
kubectl delete crd clusterinformations.crd.projectcalico.org
kubectl delete crd felixconfigurations.crd.projectcalico.org
kubectl delete crd networkpolicies.crd.projectcalico.org
kubectl delete crd globalnetworkpolicies.crd.projectcalico.org
kubectl delete crd globalnetworksets.crd.projectcalico.org
kubectl delete crd networksets.crd.projectcalico.org
二、下载Cilium
curl -L --remote-name-all https://github.com/cilium/cilium-cli/releases/download/v0.10.4/cilium-linux-amd64.tar.gz{,.sha256sum}
sha256sum --check cilium-linux-amd64.tar.gz.sha256sum
sudo tar xzvfC cilium-linux-amd64.tar.gz /usr/local/bin
rm cilium-linux-amd64.tar.gz{,.sha256sum}
三、安装Cilium
要使用 Helm 下载 Cilium 到本地,你可以按照以下步骤操作:
### 步骤 1:安装 Helm
如果你还没有安装 Helm,可以使用以下命令安装 Helm:
```bash
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
```
### 步骤 2:添加 Cilium Helm 仓库
添加 Cilium 的 Helm 仓库:
```bash
helm repo add cilium https://helm.cilium.io/
helm repo update
```
### 步骤 3:下载 Cilium Helm Chart 到本地
使用 `helm pull` 命令下载 Cilium 的 Helm Chart 到本地:
```bash
helm pull cilium/cilium --version 1.16.1 --untar
```
这将会下载并解压 Cilium 的 Helm Chart 到当前目录下的 `cilium` 文件夹中。
### 示例总结
#### 安装 Helm
```bash
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
```
#### 添加 Cilium Helm 仓库
```bash
helm repo add cilium https://helm.cilium.io/
helm repo update
cilium install
四、安装连接和状态
cilium status
cilium connectivity test
五、helm验证