欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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

  1. wget http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo
  2. yum -y install docker-ce-18.06.1.ce-3.el7
  3. systemctl enable docker && systemctl start docker
  4. systemctl restart docker.service #重启docker服务
相关标签: Java