systemctl stop firewalld.service
systemctl disable firewalld.service
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce 0
swapoff -a
sed -i 's/.*swap.*/#&/' /etc/fstab
yum install wget lrzsz vim epel-release.noarch ntp ntpdate -y
ntpdate ntp1.aliyun.com
cat > /etc/sysconfig/modules/ipvs.modules << EOF
modprobe – ip_vs
modprobe – ip_vs_rr
modprobe – ip_vs_wrr
modprobe – ip_vs_sh
modprobe – nf_conntrack_ipv4
EOF
chmod 755 /etc/sysconfig/modules/ipvs.modules
bash /etc/sysconfig/modules/ipvs.modules
modprobe br_netfilter (这句必须执行)
并且修改内核参数,编辑文件 /etc/sysctl.conf ,增加以下内容
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
vm.swappiness=0
sysctl -p
安装ansible(master)
yum install -y ansible
免密配置
ssh-keygen
ssh-copy-id 172.16.5.150/151/152 (三台都要)
mkdir -p /work/deploy/kubernetes/security
cd /work/deploy/kubernetes/security
复制一个/etc/pki/tls/openssl.cnf文件,编写openssl-k8s.cnf 和openssl-etcd.cnf 记得在v3_req 下添加:subjectAltName=@al