1. Load Module ipvs:
1)加载ipvs: [root@master ipvs]# vim ipvs.sh #!/bin/bash modprobe -- ip_vs modprobe -- ip_vs_sh modprobe -- ip_vs_rr modprobe -- ip_vs_wrr modprobe -- nf_conntrack_ipv4 2).执行脚本: [root@master ipvs]# chmod +x ipvs.sh [root@master ipvs]# bash ipvs.sh [root@master ipvs]# lsmod |grep ip_vs ip_vs_wrr 12697 0 ip_vs_rr 12600 0 ip_vs_sh 12688 0 ip_vs 145 497 . 6 ip_vs_rr, ip_vs_sh, ip_vs_wrr nf_conntrack is 133 095 . 9 ip_vs, nf_nat, nf_nat_ipv4, nf_nat_ipv6, xt_conntrack, nf_nat_masquerade_ipv4, nf_conntrack_netlink, nf_conntrack_ipv4, nf_conntrack_ipv6 libcrc32c 12644 . 4 XFS, ip_vs, nf_nat, nf_conntrack is
[the root @ Master IPVS] # echo " /root/kubernetes/ipvs/ipvs.sh " >> / etc / rc.local [root @ Master ipvs] # chmod + the X-/ etc / rc.local ## ipvs this time has been loaded successfully, the other nodes also need to load ipvs .
3 ) distribute additional node node: [root @ Master the IPVS] #for i in node1 node2; do scp ipvs.sh $ i: / root / ; DONE ## other nodes need to execute the script, add open from Kai
4 ) Verify that all nodes opened the IPVS: [root @ Master the IPVS] # lsmod | grep ip_vs
2. Install ipvsadm tools: (All nodes installed ipvsadm)
[Master IPVS the root @] #yum the install IPSET the ipvsadm - Y 2) edit kube- Proxy configuration file: [@ Master IPVS the root] # kubectl Edit ConfigMap -n-Kube Kube-Proxy System
3 ) Restart Kube-Proxy:
[root @ Master ~] # kubectl GET -n Kube-POD System ## View
[root @ Master ~] # kubectl the Delete POD -n-System Kube Kube-Proxy-2nhf6 ## Note 3 Ge kube-proxy in order to restart
3. View:
[root@master ~]# ipvsadm -ln