一、系统初始化
调整系统的内核参数
cat > kubernetes.conf <<EOF
net.bridge.bridge-call-iptables = 1
net.bridge.bridge-call-ip6tables = 1
net.ipv4.ip_forward = 1
net.ipv4.tcp_tw_recycle = 0
vm.swappiness = 0 #禁止系统使用swap空间,只有当系统oom时才允许使用它
vm.overcommit_memory = 1 #不检查物理内存是否够用
vm.panic_on_oom = 0 # 是否开启oom
fs.inotify.max_user_instances = 8192
fs.inotify.max_user_watches = 1048576
fs.file-max = 52706963
fs.nr_open = 52706963
net.ipv6conf.all.disable_ipv6 = 1
net.netfilter.nf_conntrack_max = 2310720
EOF
cp kubernetes.conf /etc/sysctl.d/kubernetes.conf
sysctl -p /etc/sysctl.d/kubernetes.conf
关闭selinux,临时关闭和永久关闭
setenforce 0 && sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
关闭系统不需要的服务
systemctl stop postfix && systemctl disable postfix