k8s的集群搭建
程序员文章站
2024-02-27 22:55:09
...
关闭防火墙:systemctl disable firewalld #永久关闭
关闭selinux:sed -i ‘s/enforcing/disabled’ /etc/selinux/config
关闭swap:sed -ri ‘s/.swap./#&/’ /etc/fstab
设置hostname:hostnamectl set -hostname k8smaster
在master添加hosts:`
cat >> /etc/host << EOF
192.168.3.215 k8smaster
192.168.163.142 k8snode1
192.168.163.143 k8snode2
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 #生效
#时间同步
yum install ntpdate -y
ntpdate time.window.com
#安装docker
- wget http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo
- yum -y install docker-ce-18.06.1.ce-3.el7
- systemctl enable docker && systemctl start docker
- systemctl restart docker.service #重启docker服务
上一篇: css滤镜效果(一)