1、环境准备
1.1安装规划
服务器准备
服务器 | ip | 组件 |
master-1 | 192.168.177.15 | ectd、api-server、controller-master、scheduler、docker |
node-1 | 192.168.177.16 | etcd、kubelet、kube-proxy、docker |
node-1 | 192.168.177.17 | etcd、kubelet、kube-proxy、docker |
软件版本
软件 | 版本 | 备注 |
OS | centos7 | |
kubernetes | 1.19.11 | |
Etcd | v3.4.15 | |
docker | 19.03.9 | |
cfssl、cfssljson、cfssl-certinfo | 1.5.0 | 证书自签工具-用的cloudflare的 |
1.2 系统设置
#以下操作3台主机都需要操作
# 1、修改主机名
hostnamectl set-hostname master-1 #192.168.177.15
hostnamectl set-hostname node-1 #192.168.177.16
hostnamectl set-hostname node-2 #192.168.177.17
# 2、主机名解析
cat >> /etc/hosts <<EOF
192.168.177.15 master-1
192.168.177.16 node-1
192.168.177.17 node-2
EOF
# 3、禁用swap
swapoff -a && sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
# 4、将桥接的IPV4的流量传递到iptables的链
cat > /etc/sysctl.d/k8s.conf << EOF
net.bridge.bridge-nf-call-ipv6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sysctl --system
# 5、域名解析、相当于在网卡中添加DNS
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
# 6、时间同步(也可以使用chrony)
yum install -y ntpdate
ntpdate ntp1.aliyun.com
# 7、添加定时器同步
crontab -e
- */30 * * * * /usr/sbin/ntpdate-u ntp1.aliyun.com >> /var/log/ntpdate.log 2>&1
# 8、创建日志目录
mkdir -p /var/log/kubernetes
标签:node,log,二进制,ntpdate,192.168,etc,集群,docker,K8S From: https://www.cnblogs.com/littlecc/p/18226484