ip规划与hosts:

172.16.0.5 k8s01
172.16.0.10 k8s02
172.16.0.16 k8s03
172.16.0.20 k8s-vip

先升级内核并开启ipvs

查看教程

安装docker

yum remove -y \
           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 docker-ce-cli containerd.io
service docker restart
chkconfig  docker on

安装

先强制密码为123456

echo 123456 | passwd --stdin root

下载工具

# 工具https://github.com/fanux/sealos
wget https://github.com/fanux/sealos/releases/download/v2.0.7/sealos 
chmod +x sealos 
/bin/cp -arf sealos /usr/bin 

安装

sealos init --passwd 123456 \
    --master 172.16.0.5  \
    --master 172.16.0.10  \
    --master 172.16.0.16  \
    --pkg-url https://sealyun.oss-cn-beijing.aliyuncs.com/37374d999dbadb788ef0461844a70151-1.16.0/kube1.16.0.tar.gz \
    --version v1.16.0

node状态:

[root@k8s01 ~]# kubectl get  nodes
NAME    STATUS   ROLES    AGE     VERSION
k8s01   Ready    master   2m52s   v1.16.0
k8s02   Ready    master   2m3s    v1.16.0
k8s03   Ready    master   65s     v1.16.0

信息

[root@k8s01 ~]# kubectl cluster-info
Kubernetes master is running at https://apiserver.cluster.local:6443
KubeDNS is running at https://apiserver.cluster.local:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
[root@k8s01 ~]# 

卸载

sealos clean \
    --master 172.16.0.5  \
    --master 172.16.0.10  \
    --master 172.16.0.16  \
    --user root \
    --passwd 123456

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code