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

一、下载 KubeKey

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

如果下载不下来,可以直接通过连接下载:

wget https://github.com/kubesphere/kubekey/releases/download/v1.1.1/kubekey-v1.1.1-linux-amd64.tar.gz

为 kk 添加可执行权限:

chmod +x kk

二、开始安装

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

# export KKZONE=cn # 该命令一定要执行,否则相关的包和镜像拉不下来
./kk create cluster --with-kubernetes v1.20.4 --with-kubesphere v3.1.1

在安装的时候,报了如下错误:

[root@centos03 kubesphere]# chmod +x kk
[root@centos03 kubesphere]# ls -l
总用量 13348
-rwxr-xr-x. 1 root root 13668116 10月  9 19:02 kk
[root@centos03 kubesphere]# ./kk create cluster --with-kubernetes v1.20.4 --with-kubesphere v3.1.1
+----------+------+------+---------+----------+-------+-------+-----------+--------+------------+-------------+------------------+--------------+
| name     | sudo | curl | openssl | ebtables | socat | ipset | conntrack | docker | nfs client | ceph client | glusterfs client | time         |
+----------+------+------+---------+----------+-------+-------+-----------+--------+------------+-------------+------------------+--------------+
| centos03 | y    | y    | y       | y        |       | y     |           |        |            |             |                  | CST 19:04:26 |
+----------+------+------+---------+----------+-------+-------+-----------+--------+------------+-------------+------------------+--------------+
centos03: conntrack is required. 

安装工具:

> yum install conntrack-tools

然后重新执行上边的命令:
file

又报了如下错误:

file

处理器核数至少为2核,所以,需要分配更大的核数(2)和内存(4G)。

修改完虚拟机核数和内存后,继续执行上边的命令:

...
clusterrole.rbac.authorization.k8s.io/ks-installer unchanged
clusterrolebinding.rbac.authorization.k8s.io/ks-installer unchanged
deployment.apps/ks-installer unchanged
clusterconfiguration.installer.kubesphere.io/ks-installer created
#####################################################
###              Welcome to KubeSphere!           ###
#####################################################

Console: http://192.168.222.12:30880
Account: admin
Password: P@88w0rd

NOTES:
  1. After you log into the console, please check the
     monitoring status of service components in
     "Cluster Management". If any service is not
     ready, please wait patiently until all components 
     are up and running.
  2. Please change the default password after login.

#####################################################
https://kubesphere.io             2021-10-09 19:45:14
#####################################################
INFO[19:45:22 CST] Installation is complete.

Please check the result using the command:

       kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f

三、访问

安装成功后,访问:http://192.168.222.12:30880, 重置密码为:K8s@kaiyi
file


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

为者常成,行者常至