所有机器上操作
#关闭防火墙
[root@etcd01 ~]# systemctl stop firewalld
[root@etcd01 ~]# systemctl disable firewalld
#关闭selinux
[root@k8s-master02 ~]# swapoff -a
[root@k8s-master01 ~]# cat /etc/fstab
# /etc/fstab
UUID=c7a2826b-82a9-43de-b408-ecd64e8f419a / xfs defaults 0 0
UUID=d5682938-f765-4684-8423-99be73aa8a2f /boot xfs defaults 0 0
#UUID=b9f8329a-3023-4786-bafa-e576d6a18404 swap swap defaults 0 0
#设置时间同步
[root@k8s-master02 ~]# /usr/sbin/ntpdate -u 10.16.8.18
#添加/etc/hosts
[root@k8s-master01 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.16.8.150 k8s-master01
10.16.8.151 k8s-master02
10.16.8.152 k8s-node01
10.16.8.153 k8s-node02
10.16.8.154 k8s-node03
10.16.8.161 etcd01
10.16.8.162 etcd02
10.16.8.163 etcd03
#关闭dnsmasq
service dnsmasq stop && systemctl disable dnsmasq
系统参数设置
cat /etc/sysctl.d/kubernetes.conf
net.bridge.bridge-nf-call-iptables=1
net.bridge.bridge-nf-call-ip6tables=1
net.ipv4.ip_forward=1
vm.swappiness=0
vm.overcommit_memory=1
vm.panic_on_oom=0
fs.inotify.max_user_watches=89100
sysctl -p /etc/sysctl.d/kubernetes.conf