个人笔记-快速搭建k8s-1.16.0
阅读原文时间:2023年07月10日阅读:3

1.阿里云购买4台实例 4核16G 120G云盘 centos7.6 固定带宽1M(双主双从)

https://www.aliyun.com/

2.安装docker
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
yum install -y docker-ce-18.09.7 docker-ce-cli-18.09.7 containerd.io
systemctl start docker.service
systemctl enable docker.service

3.设置国内源
vi /etc/docker/daemon.json
{
"registry-mirrors": ["https://registry.docker-cn.com"]
}

  • docker官方中国区 https://registry.docker-cn.com
  • 网易 http://hub-mirror.c.163.com
  • ustc http://docker.mirrors.ustc.edu.cn
  • daocloud http://f1361db2.m.daocloud.io
  • 阿里云 http://<你的ID>.mirror.aliyuncs.com

systemctl daemon-reload
systemctl restart docker.service

4.安装sealos

https://github.com/fanux/sealos

wget https://github.com/fanux/sealos/releases/download/v2.0.7/sealos && \
    chmod +x sealos && mv sealos /usr/bin
sealos init --passwd YOUR_SERVER_PASSWD \
    --master 192.168.0.1  --master 192.168.0.2  --master 192.168.0.3  \
    --node 192.168.0.4 \
    --pkg-url https://sealyun.oss-cn-beijing.aliyuncs.com/37374d999dbadb788ef0461844a70151-1.16.0/kube1.16.0.tar.gz \
    --version v1.16.05.安装ingress(nginx)https://www.jianshu.com/p/c726ed03562a6.安装helmhttps://www.rancher.cn/docs/rancher/v2.x/cn/installation/ha-install/helm-rancher/