系统要求
- kubernetes >= 1.16
- Helm >= 3.0
- Linux Kernel >= 4.9.17
升级内核
wget https://mirrors.nju.edu.cn/elrepo/kernel/el7/x86_64/RPMS/kernel-lt-5.4.146-1.el7.elrepo.x86_64.rpm
rpm -ivh kernel-lt-5.4.146-1.el7.elrepo.x86_64.rpm
cat /boot/grub2/grub.cfg | grep menuentry
grub2-set-default 'CentOS Linux (5.4.146-1.el7.elrepo.x86_64) 7 (Core)'
grub2-editenv list
grub2-mkconfig -o /boot/grub2/grub.cfg
reboot
卸载 Calico
(1)删除集群资源
kubectl -n kube-system delete ds calico-node
kubectl -n kube-system delete deploy calico-kube-controllers
kubectl -n kube-system delete sa calico-node
kubectl -n kube-system delete sa calico-kube-controllers
kubectl -n kube-system delete cm calico-config
kubectl -n kube-system delete secret calico-config
kubectl get crd | grep calico | awk '{print $1}' | xargs kubectl delete crd
(2)关闭 Tunl0 网卡
ifconfig tunl0 down
(3)移除 Calico 配置文件
rm -rf /etc/cni/net.d/*
安装 Cilium
(1)安装 cilium 和 Hubble
helm repo add cilium https://helm.cilium.io/
helm install cilium cilium/cilium --version 1.10.4 \
--namespace kube-system\
--set hubble.relay.enabled=true \
--set hubble.ui.enabled=true
(2)更改 Hubble UI 为 NodePort
kubectl -n kube-system patch svc hubble-ui -p '{"spec": {"type": "NodePort"}}'
kubectl -n kube-system get svc hubble-ui
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hubble-ui NodePort 10.105.132.71 <none> 80:32523/TCP 11m
(3)访问 Hubble UI 查看网络连接
访问 http://IP:32523
访问即可。