k8s学习笔记之启用ipvs
1,在所有节点安装ipvsyum install ipset ipvsadm2,在所有节点运行cat > /etc/sysconfig/modules/ipvs.modules <<EOF#!/bin/bashmodprobe -- ip_vsmodprobe -- ip_vs_rrmodprobe -- ip_vs_wrrmodprobe -- ip_vs_shmodprobe
1,在所有节点安装ipvs
yum install ipset ipvsadm
2,在所有节点运行
cat > /etc/sysconfig/modules/ipvs.modules <<EOF
#!/bin/bash
modprobe -- ip_vs
modprobe -- ip_vs_rr
modprobe -- ip_vs_wrr
modprobe -- ip_vs_sh
modprobe -- nf_conntrack_ipv4
EOF
chmod 755 /etc/sysconfig/modules/ipvs.modules
bash /etc/sysconfig/modules/ipvs.modules
lsmod | grep ip_vs
每个节点执行完毕应该都可以看见已经加载的ipvs模块
3,开启ipvs
kubectl edit -n kube-system cm kube-proxy
将mode: " "修改为mode: "ipvs"
4,重新生成kube-poxy的pod
先查出各个kube-proxy的pod
删除所有kube-proxy打头的pod
系统会重新生成新的pod
kubectl get pods -n kube-system|grep kube-proxy|cut -d" " -f1|xargs -i -n 1 kubectl delete pod {} -n kube-system
5,查看:
ipvsadm -ln
kubectl describe -n kube-system cm kube-proxy
kubectl get deploy,pods -n kube-system -o wide
更多推荐
所有评论(0)