使用 Kubekey 快速安装 KubeSphere

一、创建目录

cd /opt/
sudo mkdir softwares
sudo mkdir modules

[hemei@localhost opt]$ sudo chmod -R 777 modules
[hemei@localhost opt]$ sudo chmod -R 777 softwares/

二、下载KubeKey

先执行以下命令以确保您从正确的区域下载 KubeKey。

export KKZONE=cn

执行以下命令下载 KubeKey。

cd /opt/softwares/
curl -sfL https://get-kk.kubesphere.io | VERSION=v1.0.1 sh -

使用如上命令会报错:

[hemei@localhost softwares]$ curl -sfL https://get-kk.kubesphere.io | VERSION=v1.0.1 sh -

Downloading kubekey v1.0.1 from https://kubernetes.pek3b.qingstor.com/kubekey/releases/download/v1.0.1/kubekey-v1.0.1-linux-amd64.tar.gz ...

Failed to download Kubekey v1.0.1 !

Please verify the version you are trying to download.

直接从 GitHub Release Page 下载 KubeKey 或直接使用以下命令。

file

[hemei@localhost softwares]$ wget https://github.com/kubesphere/kubekey/releases/download/v1.0.1/kubekey-v1.0.1-linux-amd64.tar.gz

解压缩:

[hemei@localhost softwares]$  sudo tar -zxf kubekey-v1.0.1-linux-amd64.tar.gz -C /opt/modules/

解压缩之后的文件为 kk

为 kk 添加可执行权限:

[hemei@localhost modules]$ sudo chmod +x kk
[hemei@localhost modules]$ ls -l
total 55156
-rwxr-xr-x. 1 1001 116 56478440 Nov  9 01:03 kk

三、开始安装

安装组件:

$ yum -y install socat
$ yum install -y conntrack

在本快速入门教程中,您只需执行一个命令即可进行安装,其模板如下所示:

./kk create cluster [--with-kubernetes version] [--with-kubesphere version]

若要同时安装 Kubernetes 和 KubeSphere,可参考以下示例命令:

cd /opt/modules
sudo ./kk create cluster --with-kubernetes v1.18.6 --with-kubesphere v3.0.0

相关文章:
在 Linux 上以 All-in-One 模式安装 KubeSphere

为者常成,行者常至