1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
| 配置源 [root@kub-k8s-master ~] [kubernetes] name=Kubernetes baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64 enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg EOF
安装对应版本 1.安装最新版本
========================================= 2.安装对应版本 [root@k8s-master ~]
加载ipvs相关内核模块
[root@k8s-master ~] modprobe ip_vs modprobe ip_vs_rr modprobe ip_vs_wrr modprobe ip_vs_sh modprobe nf_conntrack_ipv4
给与执行权限 [root@k8s-master ~] 重启服务器 [root@k8s-master ~]
配置转发相关参数,否则可能会出错 [root@k8s-master ~] net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 vm.swappiness=0 EOF
使配置生效 [root@k8s-master ~]
如果net.bridge.bridge-nf-call-iptables报错,加载br_netfilter模块 [root@k8s-master ~] [root@k8s-master ~]
查看是否加载成功 [root@k8s-master ~] ip_vs_sh 12688 0 ip_vs_wrr 12697 0 ip_vs_rr 12600 0 ip_vs 141092 6 ip_vs_rr,ip_vs_sh,ip_vs_wrr nf_conntrack 133387 2 ip_vs,nf_conntrack_ipv4 libcrc32c 12644 3 xfs,ip_vs,nf_conntrack
|