安装kubesphere集群

2022-03-28 21:42:02 浏览数 (1)

环境:

kubesphere:3.1.1

kubernetes:1.20.4

系统:ubuntu 20.04

1、准备4台机器,1台做master节点,3个worker节点

配置如下:

master节点:4核 16G

worker节点:8核 32G

下面进入安装步骤:

1、在所有机器上安装docker,提前配置好阿里的apt源(ubuntu20.04配置国内apt源_johnhuster的专栏-CSDN博客)

2、执行命令apt install docker.io安装docker

3、配置docker国内加速(很有必要),修改/etc/docker/daemon.json文件

4、使上述配置生效,执行命令:

systemctl daemon-reload

systemctl restart docker

5、下载kubekey文件,执行命令

curl -sfL https://get-kk.kubesphere.io | VERSION=v1.1.1 sh -

6、创建config文件,执行命令

./kk create config

7、修改生成的config-sample文件,

代码语言:javascript复制
spec:
  hosts:
  - - {name: master, address: xx.xx.xx.1, internalAddress: xx.xx.xx.1, user: xx, password: xxxx}
  - {name: worker1, address: xx.xx.xx.2, internalAddress: xx.xx.xx.2, user: xx, password: xxxx}
  - {name: worker2, address: xx.xx.xx.2, internalAddress: xx.xx.xx.3, user: xx, password: xxxx}
  - {name: worker3, address: xx.xx.xx.4, internalAddress: xx.xx.xx.4, user: xx, password: xxxx}

  roleGroups:
    etcd:
    - master
    master:
    - master
    worker:
    - worker1
    - worker2
    - worker3

8、创建kubesphere集群,执行命令

./kk create cluster -f config-sample.yaml

9、 集群创建成功后会打印如下信息

参考文章:

1、在 Linux 上以 All-in-One 模式安装 KubeSphere

0 人点赞