rancher安装k8s集群

北慕城南 提交于 2019-12-17 09:13:03

1配置环境

systemctl set-hostname master01

systemctl set-hostname master02

systemctl set-hostname node01

systemctl set-hostname node02

 

vi /etc/hosts

192.168.198.154 master01

192.168.198.155 master02

192.168.198.156 node01

192.168.198.157 node02

 

scp /etc/hosts root@master02:/etc/hosts

scp /etc/hosts root@node01:/etc/hosts

scp /etc/hosts root@node02:/etc/hosts

 

关闭swap

swapoff -a

vi /etc/fstab

 

关闭防火墙

iptables -F

systemctl stop firewalld && systemctl disable firewalld

关闭selinux

sed -i 's/enforcing/disabled/g' /etc/selinux/config; setenforce 0

 

2安装docker

curl http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker.repo

yum makecache fast

yum install -y docker-ce

 

配置镜像加速:

cat > /etc/docker/daemon.json <<EOF

{

"registry-mirrors": ["https://jzbtfwo9.mirror.aliyuncs.com"]

}

EOF

启动docker

systemctl start docker && systemctl enable docker

 

3安装rancher

docker run -d --restart=unless-stopped -p 8080:80 -p 8443:443 rancher/rancher:v2.3.1

 

4图形界面操作

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!