多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
[TOC] ## 安装ipvsadm ```shell # 所有节点都安装 sudo yum -y install ipvsadm ``` ## 修改kube-proxy配置文件 将配置文件中的mode,改成ipvs即可 ```shell # service格式的配置文件 --proxy-mode=ipvs # yaml格式的配置文件 sed -ri 's@(mode:).*@\1 ipvs@g' /data/k8s/conf/kube-proxy-config.yml ``` ## 重启kube-proxy服务 ```shell $ systemctl restart kube-proxy.service ``` ## 验证 ```shell $ kubectl get svc kubernetes NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kubernetes ClusterIP 10.183.0.1 <none> 443/TCP 141d $ kubectl get ep kubernetes NAME ENDPOINTS AGE kubernetes 192.168.31.103:6443,192.168.31.79:6443 141d $ ipvsadm -Ln IP Virtual Server version 1.2.1 (size=4096) Prot LocalAddress:Port Scheduler Flags -> RemoteAddress:Port Forward Weight ActiveConn InActConn TCP 10.183.0.1:443 rr -> 192.168.31.103:6443 Masq 1 1 0 -> 192.168.31.79:6443 Masq 1 0 0 ```