1.關(guān)閉防火墻:
2.關(guān)閉selinux:
3.關(guān)閉swap:
4.設(shè)置主機(jī)名:
5.添加hosts映射
6.將橋接的IPv4流量傳遞到iptables的鏈:
7.時(shí)間同步:
'''
關(guān)閉防火墻:
systemctl stop firewalld
systemctl disable firewalld
關(guān)閉selinux:
sed -i 's/enforcing/disabled/' /etc/selinux/config # 永久
setenforce 0 # 臨時(shí)
關(guān)閉swap:
swapoff -a # 臨時(shí)
sed -i 's/.swap./#&/' /etc/fstab # 永久
設(shè)置主機(jī)名:
hostnamectl set-hostname <hostname>
在master添加hosts:
cat >> /etc/hosts << EOF
192.168.31.61 k8s-master
192.168.31.62 k8s-node1
192.168.31.63 k8s-node2
EOF
將橋接的IPv4流量傳遞到iptables的鏈:
cat > /etc/sysctl.d/k8s.conf << EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sysctl --system # 生效
時(shí)間同步:
yum install ntpdate -y
ntpdate time.windows.com
'''