1、准备机器:centos7 * 3
172.16.240.128
172.16.240.129
172.16.240.130
2、设置网卡信息(master/node)
vi /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=f1ce2db9-5a1c-4bae-8df0-6a8048b6e568
DEVICE=ens33
ONBOOT=yes
IPADDR=172.16.240.128
NETMASK=255.255.255.0
GATEWAY=172.16.240.2
DNS1=8.8.8.8
3、配置hostname(master/node)
[root@node01 ~]# cat /etc/hosts
172.16.240.128 node01
172.16.240.129 node02
172.16.240.130 node03
172.16.240.131 node04
4、配置阿里云镜像
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF
5、关闭selinx(master/node)
setenforce 0 # 临时关闭
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config # 永久关闭