一、准备一台或多台机器
二、硬件配置
2GB
或更多RAM,2个CPU或更多CPU,硬盘30GB或更多
集群中所有机器之间网络互通 可以访问外网,需要拉取镜像 禁止swap分区
主机名
|
IP
|
k8s-master
|
192.168.96.16
|
k8s-node01
|
192.168.96.129
|
k8s-node02
|
192.168.96.128
|
三、系统初始化配置
关闭防火墙
systemctl stop firewalldsystemctl disable firewalld(永久关闭)
关闭selinux
vim /etc/sysconfig/selinux
关闭swap
swapoff -a #临时关闭vi /etc/fstab #永久关闭,注释掉swap开机挂载行
设置主机名:
主机名根据自己的主机去使用这条命令
hostnamectl set-hostname xxxx
四、时间同步
yum install ntpdate -yntpdate us.pool.ntp.orghwclock -w
五、每台主机添加hosts
cat >> /etc/hosts << EOF192.168.96.16 k8s-master192.168.96.129 k8s-node01