K8S集群架构及主机准备
- 本次集群部署主机分布
- K8S集群主机配置
- 主机静态IP设置
- 主机名解析
- ipvs管理工具安装及模块加载
- 主机系统升级
- 主机间免密登录配置
主机基础配置完后最好做个快照备份
- 2台负载均衡器
- Haproxy
- 高可用keepalived
- 3台k8s master节点
- 5台工作节点(至少2及以上)
本次集群部署主机分布
K8S集群主机配置
- 操作系统:ubuntu2022、centos79
- 主机软硬件配置:至少4核、8G及以上、512(1024G)及以上
关闭防火墙:所有节点,永久关闭且立刻执行
sudo systemctl disable --now ufw
设置服务器时区:ubuntu系统默认不是中国的标准时区
#方式一
sudo timedatectl set-timezone Asia/Shanghai
sudo systemctl restart systemd-timesyncd.service
timedatectl status
#方式二
apt install -y ntpdate
crontab -e
0 */1 * * * ntpdate time1.aliyun.com
ntpdate time1.aliyun.com
关闭swap分区:修改/etc/fstab,注释掉swap这一行
sudo vim /etc/fstab
sudo swapoff -a
关闭SELinux:
通过sestatus命令查看selinux状态,命令未安装可通过以下工具安装:
sudo apt