1. 软件版本
首先要把centos7系统的内核升级最好4.4以上(默认3.10的内核,运行大规模docker的时候会有bug)
软件/系统版本备注Centos7.9最小安装版k8s1.15.1flannel0.11etcd3.3.102. 角色分配
k8s角色主机名节点IP备注master1+etcd1master1.host.com10.0.0.70master节点master2+etcd2master2.host.com10.0.0.71master3+etcd3master3.host.com10.0.0.72node1node1.host.com10.0.0.73node节点node2node2.host.com10.0.0.74haproxy1+keepalivedhaproxy1.host.com10.0.0.75负载均衡(vip:10.0.0.80)haproxy2+keepalivedhaproxy2.host.com10.0.0.763. 安装流程
第1个里程: 初始化工具安装
所有节点都执行
点击查看代码- yum install net-tools vim wget -y
复制代码 第2个里程: 关闭防火墙与Selinux
所有节点都执行- systemctl stop firewalld
- systemctl disable firewalld
- sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
- reboot
复制代码 第3个里程: 设置时区
所有节点都执行- \cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime -rf
复制代码 第4个里程: 关闭交换分区
所有节点都执行- swapoff -a
- sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
复制代码 第5个里程:设置系统时间同步
所有节点都执行- yum install -y ntpdate
- ntpdate -u ntp.aliyun.com
- echo "*/5 * * * * ntpdate ntp.aliyun.com >/dev/null 2>&1" >> /etc/crontab
- systemctl start crond.service
- systemctl enable crond.service
复制代码 第6个里程: 设置主机名
[code]cat > /etc/hosts /etc/sysctl.d/kubernetes.conf |