Operating system: CentOS 7.5 Kernel version: 3.10
1. Install ipvsadm, conntrack
yum -y install ipvsadm conntrack-tools
2. Load ipvs module
vim /etc/sysconfig/modules/ipvs.modules p>
#! / bin / bash
ipvs_modules = "ip_vs ip_vs_lc ip_vs_wlc ip_vs_rr ip_vs_wrr ip_vs_lblc ip_vs_lblcr ip_vs_dh ip_vs_sh ip_vs_fo ip_vs_nq ip_vs_sed ip_vs_ftp nf_conntrack_ipv4"
for kernel_module in \${ipvs_modules}; do
/sbin/modinfo -F filename \${kernel_module}> /dev/null 2>&1
if [$? -eq 0] ; then
/sbin/modprobe \${kernel_module}
fi
done
Execute
chmod 755 /etc/sysconfig/modules/ipvs.modules && bash /etc/sysconfig/modules/ipvs.modules && lsmod | grep ip_vs
3. Modify the server kernel parameters, add
cat >>/etcsysctl.conf <net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
Execute again
sysctl -p
4. Modify kube-proxy configuration parameters
vim /etc/kubernetes/proxy
KUBE_PROXY_ARGS="--bind -address=192.168.0.210 \ #ServerIP
--hostname-override=192.168.0.210 \ #ServerIP
--masquerade-all=true \ #Ensure reverse traffic passes
--feature-gates=SupportIPVSProxyMode= true \ #open support for ipvs mode
--proxy-mode=ipvs \ #clear proxy mode is ipvs
--ipvs-min-sync-period=5s --ipvs-sync-period=5s- -ipvs-scheduler=rr \ #Select the scheduling method as round-robin scheduling
--kubeconfig=/etc/kubernetes/kube-proxy.kubeconfig --cluster-cidr=10.254.0.0/16"
< /p>