From 50d75cab61f31c666602d129a578e971ec8e6f2f Mon Sep 17 00:00:00 2001 From: Rain Wen Date: Fri, 6 May 2022 16:09:11 +0000 Subject: [PATCH 01/19] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20In?= =?UTF-8?q?stall-KubeSphere/README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Install-KubeSphere/README.md | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 Install-KubeSphere/README.md diff --git a/Install-KubeSphere/README.md b/Install-KubeSphere/README.md deleted file mode 100644 index f1259e3..0000000 --- a/Install-KubeSphere/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# 环境介绍 - -- 操作系统: - -- 容器运行时: - -- kubeadm版本: - -- CNI : - -# 操作系统基础配置 - -...... - -# 容器运行时安装 - -...... -- Gitee From 725abe048c12cac73d922072125065812187c7f1 Mon Sep 17 00:00:00 2001 From: Rain Wen Date: Fri, 6 May 2022 16:10:02 +0000 Subject: [PATCH 02/19] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20Install-KubeSphere?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Install-KubeSphere/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Install-KubeSphere/.keep diff --git a/Install-KubeSphere/.keep b/Install-KubeSphere/.keep new file mode 100644 index 0000000..e69de29 -- Gitee From 66fa94f6a963fba501ccac05353ae128ebf2319e Mon Sep 17 00:00:00 2001 From: Rain Wen Date: Fri, 6 May 2022 16:10:48 +0000 Subject: [PATCH 03/19] README --- Install-KubeSphere/README.md | 218 +++++++++++++++++++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 Install-KubeSphere/README.md diff --git a/Install-KubeSphere/README.md b/Install-KubeSphere/README.md new file mode 100644 index 0000000..957293d --- /dev/null +++ b/Install-KubeSphere/README.md @@ -0,0 +1,218 @@ +# KubeSphere安装及应用部署 + +# 一、**环境介绍** + +## 准备Linux机器 + +可以参考以下硬件规格准备一台符合要求的主机节点开始 `all-in-one`模式的安装。 + +### 硬件推荐配置 + +| 操作系统 | 最低配置 | +| --- | --- | +| Ubuntu 16.04, 18.04 | 2 核 CPU,4 GB 内存,40 GB 磁盘空间 | +| CentOS 7.x | 2 核 CPU,4 GB 内存,40 GB 磁盘空间 | +| Red Hat Enterprise Linux 7 | 2 核 CPU,4 GB 内存,40 GB 磁盘空间 | + +> 本次实验选择的操作系统为:**CentOS 7.9**,配置为:**4 核 CPU**,**8 GB 内存**,**40 GB 磁盘空间**。 +> + +### 节点要求 + +1. 节点能通过`SSH`连接; +2. 节点上可以使用`sudo/curl/openssl`命令; + +### 容器运行时 + +集群中必须有一个可用的容器运行时,如果使用自动化搭建集群,K**ubeKey** 会默认安装最新版本的Docker,或是,在创建集群前手动安装Docker的选定版本或其他容器运行时。 + +| 支持的容器运行时 | 版本 | +| --- | --- | +| Docker | 19.3.8+ | +| containerd | 最新版 | + +> 如果采用离线部署KubeSphere,需要提前安装好一个容器运行时。 +> + +> KubeKey 是用 Go 语言开发的一款全新的安装工具。KubeKey 提供了灵活的安装选择,可以分别安装 KubeSphere 和 Kubernetes 或二者同时安装。 +> + +### 依赖项要求 + +KubeKey 可以将 Kubernetes 和 KubeSphere 一同安装。针对不同的 Kubernetes 版本,需要安装的依赖项可能有所不同。您可以参考以下列表,查看是否需要提前在节点上安装相关的依赖项。 + +| 依赖项 | Kubernetes 版本 ≥ 1.18 | Kubernetes 版本 < 1.18 | +| --- | --- | --- | +| socat | 必须 | 可选但建议 | +| conntrack | 必须 | 可选但建议 | +| ebtables | 可选但建议 | 可选但建议 | +| ipset | 可选但建议 | 可选但建议 | + +### 网络要求 + +1. 如果网络配置使用防火墙规则或安全组,请务必确保基础设施组件可以通过特定端口相互通信,建议您关闭防火墙。需指出的是,端口号30000 - 32767 务必放行,具体参数见下表。 + +| 服务 | 协议 | 行为 | 起始端口 | 结束端口 | 备注 | +| --- | --- | --- | --- | --- | --- | +| ssh | TCP | allow | 22 | 0 | | +| etcd | TCP | allow | 2379 | 2380 | | +| apiserver | TCP | allow | 6443 | 0 | | +| calico | TCP | allow | 9099 | 9100 | | +| bgp | TCP | allow | 179 | 0 | | +| nodeport | TCP | allow | 30000 | 32767 | | +| master | TCP | allow | 10250 | 10258 | | +| dns | TCP | allow | 53 | 0 | | +| dns | UDP | allow | 53 | 0 | | +| local-registry | TCP | allow | 5000 | 0 | 离线环境需要 | +| local-apt | TCP | allow | 5080 | 0 | 离线环境需要 | +| rpcbind | TCP | allow | 111 | 0 | 使用 NFS 时需要 | +| ipip | IPENCAP / IPIP | allow | 0 | 0 | Calico 需要使用 IPIP 协议 | +| metrics-server | TCP | allow | 8443 | 0 | | + +> 如果需要特别指定使用 Calico 网络插件并且在云平台上使用经典网络运行集群时,您需要对源地址启用 IPENCAP 和 IPIP 协议。 +> +1. 支持的CNI 插件:Calico 和 Flannel 等。 +2. (可选)为Docker配置阿里云等镜像加速器,需要提前安装好Docker。 + +# 二、部署KubeSphere + +## 步骤1:下载KubeKey + +- 鉴于网络环境的原因,在部署前将地域调整至CN + +```powershell +export KKZONE=cn +``` + +- 执行以下命令下载KubeKey + +```powershell +curl -sfL [https://get-kk.kubesphere.io](https://get-kk.kubesphere.io/) | VERSION=v2.0.0 sh - +``` + +- 为`kk`添加可执行权限 + +```bash +chmod +x kk +``` + +## 步骤2:开始安装 + +如上所述,本次实验为All-in-one默认最小化安装,只需要执行一个命令即可自动化部署,命令模版如下: + +```powershell +./kk create cluster [--with-kubernetes version] [--with-kubesphere version] +``` + +且本次实验将同时安装 Kubernetes 和 KubeSphere,命令如下: + +```powershell +./kk create cluster --with-kubernetes v1.21.5 --with-kubesphere v3.2.1 +``` + +> 一般对于 All-in-One 安装,无需更改任何配置。 +> + +> 如果在这一步的命令中不添加标志 `-with-kubesphere`,则不会部署 KubeSphere,KubeKey 将只安装 Kubernetes。如果添加标志 `-with-kubesphere` 时不指定 KubeSphere 版本,则会安装最新版本的 KubeSphere。 +> + +执行该命令后,KubeKey 将检查您的安装环境,结果显示在一张表格中。若无问题,输入 `yes`继续安装流程。 + +## 步骤3:验证安装结果 + +当您看到以下输出时,表明安装已经完成。 + +```powershell +INFO[20:22:07CST]Installation is complete. + +Please check the result using the command: + + kubectl logs-n kubesphere-system$(kubectl get pod-n kubesphere-system-1app=ks-install-o jsonpath='{.items[0].metadata.name}')-f + +``` + +输入以下命令以检查安装结果: + +```powershell +kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f +``` + +输出信息会显示 Web 控制台的 IP 地址和端口号,默认的 NodePort 是 `30880`。现在可以使用默认的帐户和密码 (`admin/P@88w0rd`) 通过 `:30880`访问控制台。 + +```powershell +##################################################### +### Welcome to KubeSphere! ### +##################################################### + +Console: http://192.168.0.2: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 20xx-xx-xx xx:xx:xx +##################################################### +``` + +登录至控制台后,您可以在**系统组件**中查看各个组件的状态。如果要使用相关服务,您可能需要等待部分组件启动并运行。 + +也可以在命令行使用 `kubectl get pod --all-namespaces`来检查 KubeSphere 相关组件的运行状况。 + +# 安装后启用可插拔组件 + +### 启用DevOps + +1. 以 `admin` 用户登录控制台,点击左上角的**平台管理**,选择**集群管理**。 +2. 点击 **CRD**,在搜索栏中输入 `clusterconfiguration`,点击搜索结果查看其详细页面。 + +> 定制资源定义(CRD)允许用户在不新增 API 服务器的情况下创建一种新的资源类型,用户可以像使用其他 Kubernetes 原生对象一样使用这些定制资源。 +> +1. 在**自定义资源**中,点击 `ks-installer`右侧的按钮,选择**编辑 YAML。** +2. 在该 YAML 文件中,搜索 `devops`,将 `enabled`的 `false`改为 `true`。完成后,点击右下角的**确定**,保存配置。 + +```powershell +devops: + enabled: true # 将“false”更改为“true”。 +``` + +1. 在 kubectl 中执行以下命令检查安装过程: + +```powershell +kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f +``` + +### 验证组件的安装 + +- 在仪表盘中验证:进入**系统组件**,检查是否 **DevOps**标签页中的所有组件都处于**健康**状态。如果是,组件安装成功。 +- 通过`kubectl`验证: + +通过以下命令来验证状态: + +```powershell +kubectl get pod -n kubesphere-devops-system +``` + +如果组件运行成功,输出结果如下: + +```powershell +NAME READY STATUS RESTARTS AGE +devops-jenkins-5cbbfbb975-hjnll 1/1 Running 0 40m +s2ioperator-0 1/1 Running 0 41m +``` + +### 启用应用商店 + +于DEMO中演示。 + +# 应用部署 + +### 以部署RabbitMQ为例 + +于DEMO中演示。 \ No newline at end of file -- Gitee From 01c414f80c6b9676c0f2f2d11ba1618f9e9ed320 Mon Sep 17 00:00:00 2001 From: Rain Wen Date: Fri, 6 May 2022 16:10:55 +0000 Subject: [PATCH 04/19] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20In?= =?UTF-8?q?stall-KubeSphere/.keep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Install-KubeSphere/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Install-KubeSphere/.keep diff --git a/Install-KubeSphere/.keep b/Install-KubeSphere/.keep deleted file mode 100644 index e69de29..0000000 -- Gitee From 92ab04bf131b04722625992f86df40af36ee8557 Mon Sep 17 00:00:00 2001 From: Rain Wen Date: Fri, 6 May 2022 16:13:00 +0000 Subject: [PATCH 05/19] update Install-KubeSphere/README.md. --- Install-KubeSphere/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Install-KubeSphere/README.md b/Install-KubeSphere/README.md index 957293d..df3e6df 100644 --- a/Install-KubeSphere/README.md +++ b/Install-KubeSphere/README.md @@ -213,6 +213,6 @@ s2ioperator-0 1/1 Running 0 41m # 应用部署 -### 以部署RabbitMQ为例 +### 部署RabbitMQ为例 于DEMO中演示。 \ No newline at end of file -- Gitee From d9621c7e5ad79be62756cc93cf3c553c57b04c9e Mon Sep 17 00:00:00 2001 From: Rain Wen Date: Fri, 6 May 2022 16:14:12 +0000 Subject: [PATCH 06/19] update Install-KubeSphere/README.md. --- Install-KubeSphere/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Install-KubeSphere/README.md b/Install-KubeSphere/README.md index df3e6df..899c73c 100644 --- a/Install-KubeSphere/README.md +++ b/Install-KubeSphere/README.md @@ -1,4 +1,4 @@ -# KubeSphere安装及应用部署 +# 以KubeSphere安装Kubernetes及应用部署 # 一、**环境介绍** -- Gitee From 0ce1f0097ece6012c55a57edb6d012df030de99a Mon Sep 17 00:00:00 2001 From: Rain Wen Date: Fri, 6 May 2022 16:15:28 +0000 Subject: [PATCH 07/19] update Install-KubeSphere/README.md. --- Install-KubeSphere/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Install-KubeSphere/README.md b/Install-KubeSphere/README.md index 899c73c..056dafe 100644 --- a/Install-KubeSphere/README.md +++ b/Install-KubeSphere/README.md @@ -1,4 +1,4 @@ -# 以KubeSphere安装Kubernetes及应用部署 +# KubeSphere安装Kubernetes及应用部署指北 # 一、**环境介绍** -- Gitee From 0178ba659423b1b72e1555a3765aad198bcd84e1 Mon Sep 17 00:00:00 2001 From: Rain Wen Date: Wed, 11 May 2022 08:59:47 +0000 Subject: [PATCH 08/19] update Install-KubeSphere/README.md. --- Install-KubeSphere/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Install-KubeSphere/README.md b/Install-KubeSphere/README.md index 056dafe..2d093ee 100644 --- a/Install-KubeSphere/README.md +++ b/Install-KubeSphere/README.md @@ -24,7 +24,7 @@ ### 容器运行时 -集群中必须有一个可用的容器运行时,如果使用自动化搭建集群,K**ubeKey** 会默认安装最新版本的Docker,或是,在创建集群前手动安装Docker的选定版本或其他容器运行时。 +集群中必须有一个可用的容器运行时,如果使用自动化搭建集群,**KubeKey** 会默认安装最新版本的Docker,或是,在创建集群前手动安装Docker的选定版本或其他容器运行时。 | 支持的容器运行时 | 版本 | | --- | --- | -- Gitee From 5900b9c29f3265b8d3069d603132fa275cb15207 Mon Sep 17 00:00:00 2001 From: Rain Wen Date: Mon, 16 May 2022 05:45:42 +0000 Subject: [PATCH 09/19] Readme --- ...5\262 a89211cf8ed04cbdb727d694e77a58d0.md" | 715 ++++++++++++++++++ 1 file changed, 715 insertions(+) create mode 100644 "Install-KubeSphere/KubeSphere\345\256\211\350\243\205\345\217\212\345\272\224\347\224\250\351\203\250\347\275\262 a89211cf8ed04cbdb727d694e77a58d0.md" diff --git "a/Install-KubeSphere/KubeSphere\345\256\211\350\243\205\345\217\212\345\272\224\347\224\250\351\203\250\347\275\262 a89211cf8ed04cbdb727d694e77a58d0.md" "b/Install-KubeSphere/KubeSphere\345\256\211\350\243\205\345\217\212\345\272\224\347\224\250\351\203\250\347\275\262 a89211cf8ed04cbdb727d694e77a58d0.md" new file mode 100644 index 0000000..b2b1e73 --- /dev/null +++ "b/Install-KubeSphere/KubeSphere\345\256\211\350\243\205\345\217\212\345\272\224\347\224\250\351\203\250\347\275\262 a89211cf8ed04cbdb727d694e77a58d0.md" @@ -0,0 +1,715 @@ +# KubeSphere安装及应用部署 + +# 一、**环境介绍** + +## 准备Linux机器 + +可以参考以下硬件规格准备一台符合要求的主机节点开始 `All-in-One`模式的安装。 + +### 硬件推荐配置 + +| 操作系统 | 最低配置 | +| --- | --- | +| Ubuntu 16.04, 18.04 | 2 核 CPU,4 GB 内存,40 GB 磁盘空间 | +| CentOS 7.x | 2 核 CPU,4 GB 内存,40 GB 磁盘空间 | +| Red Hat Enterprise Linux 7 | 2 核 CPU,4 GB 内存,40 GB 磁盘空间 | + +> 以上为适用于不启用任何可插拔组件的最小化安装之**最低配置**。 +> + +> 本次实验选择的操作系统为:**CentOS 7.9**,配置为:**4 核 CPU**,**8 GB 内存**,**40 GB 磁盘空间**。 +> + +### 节点要求 + +1. 节点能通过`SSH`连接; +2. 节点上可以使用`sudo/curl/openssl`命令; + +### 容器运行时 + +集群中必须有一个可用的容器运行时,如果使用自动化搭建集群,K**ubeKey** 会默认安装最新版本的Docker,或是,在创建集群前手动安装Docker的选定版本或其他容器运行时。 + +| 支持的容器运行时 | 版本 | +| --- | --- | +| Docker | 19.3.8+ | +| containerd | 最新版 | + +> 如果采用离线部署KubeSphere,需要提前安装好一个容器运行时。 +> + +> KubeKey 是用 Go 语言开发的一款全新的安装工具。KubeKey 提供了灵活的安装选择,可以分别安装 KubeSphere 和 Kubernetes 或二者同时安装。 +> + +### 依赖项要求 + +KubeKey 可以将 Kubernetes 和 KubeSphere 一同安装。针对不同的 Kubernetes 版本,需要安装的依赖项可能有所不同。您可以参考以下列表,查看是否需要提前在节点上安装相关的依赖项。 + +| 依赖项 | Kubernetes 版本 ≥ 1.18 | Kubernetes 版本 < 1.18 | +| --- | --- | --- | +| socat | 必须 | 可选但建议 | +| conntrack | 必须 | 可选但建议 | +| ebtables | 可选但建议 | 可选但建议 | +| ipset | 可选但建议 | 可选但建议 | + +### 网络要求 + +1. 如果网络配置使用防火墙规则或安全组,请务必确保基础设施组件可以通过特定端口相互通信,建议您关闭防火墙。需指出的是,端口号30000 - 32767 务必放行,具体参数见下表。 + +| 服务 | 协议 | 行为 | 起始端口 | 结束端口 | 备注 | +| --- | --- | --- | --- | --- | --- | +| ssh | TCP | allow | 22 | 0 | | +| etcd | TCP | allow | 2379 | 2380 | | +| apiserver | TCP | allow | 6443 | 0 | | +| calico | TCP | allow | 9099 | 9100 | | +| bgp | TCP | allow | 179 | 0 | | +| nodeport | TCP | allow | 30000 | 32767 | | +| master | TCP | allow | 10250 | 10258 | | +| dns | TCP | allow | 53 | 0 | | +| dns | UDP | allow | 53 | 0 | | +| local-registry | TCP | allow | 5000 | 0 | 离线环境需要 | +| local-apt | TCP | allow | 5080 | 0 | 离线环境需要 | +| rpcbind | TCP | allow | 111 | 0 | 使用 NFS 时需要 | +| ipip | IPENCAP / IPIP | allow | 0 | 0 | Calico 需要使用 IPIP 协议 | +| metrics-server | TCP | allow | 8443 | 0 | | + +> 如果需要特别指定使用 Calico 网络插件并且在云平台上使用经典网络运行集群时,您需要对源地址启用 IPENCAP 和 IPIP 协议。 +> +1. 支持的CNI 插件:Calico 和 Flannel 等。 +2. (可选)为Docker配置阿里云等镜像加速器,需要提前安装好Docker。 + +# 二、部署KubeSphere + +## 步骤1:下载KubeKey + +- 鉴于网络环境的原因,在部署前将地域调整至CN + +```powershell +export KKZONE=cn +``` + +- 执行以下命令下载KubeKey + +```powershell +curl -sfL [https://get-kk.kubesphere.io](https://get-kk.kubesphere.io/) | VERSION=v2.0.0 sh - +``` + +> 执行以上命令会下载最新版 KubeKey (v2.0.0),可以修改命令中的版本号下载指定版本。 +> +- 为`kk`添加可执行权限 + +```bash +chmod +x kk +``` + +## 步骤2:开始安装 + +如上所述,本次实验为All-in-one默认最小化安装,只需要执行一个命令即可自动化部署,命令模版如下: + +```powershell +./kk create cluster [--with-kubernetes version] [--with-kubesphere version] +``` + +且本次实验将同时安装 Kubernetes 和 KubeSphere,命令如下: + +```powershell +./kk create cluster --with-kubernetes v1.21.5 --with-kubesphere v3.2.1 +``` + +> 一般对于 All-in-One 安装,无需更改任何配置。 +> + +> 如果在这一步的命令中不添加标志 `-with-kubesphere`,则不会部署 KubeSphere,KubeKey 将只安装 Kubernetes。如果添加标志 `-with-kubesphere` 时不指定 KubeSphere 版本,则会安装最新版本的 KubeSphere。 +> + +执行该命令后,KubeKey 将检查您的安装环境,结果显示在一张表格中。若无问题,输入 `yes`继续安装流程。 + +## 步骤3:验证安装结果 + +当看到以下输出时,表明安装已经完成。 + +```powershell +INFO[20:22:07CST]Installation is complete. + +Please check the result using the command: + + kubectl logs-n kubesphere-system$(kubectl get pod-n kubesphere-system-1app=ks-install-o jsonpath='{.items[0].metadata.name}')-f + +``` + +输入以下命令以检查安装结果: + +```powershell +kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f +``` + +输出信息会显示 Web 控制台的 IP 地址和端口号,默认的 NodePort 是 `30880`。现在可以使用默认的帐户和密码 (`admin/P@88w0rd`) 通过 `:30880`访问控制台。 + +``` +##################################################### +### Welcome to KubeSphere! ### +##################################################### + +Console: http://192.168.0.2: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 20xx-xx-xx xx:xx:xx +##################################################### +``` + +登录至控制台后,您可以在**系统组件**中查看各个组件的状态。如果要使用相关服务,您可能需要等待部分组件启动并运行。 + +也可以在命令行使用 `kubectl get pod --all-namespaces`来检查 KubeSphere 相关组件的运行状况。 + +# 三、创建用户、企业空间、项目 + +> KubeSphere 的多租户系统分**三个**层级,即集群、企业空间和项目。**KubeSphere 中的项目等同于 Kubernetes 的命名空间。** +> + +我们需要创建一个新的企业空间进行操作,而不是使用系统企业空间,系统企业空间中运行着系统资源,绝大部分仅供查看。出于安全考虑,强烈建议给不同的租户授予不同的权限在企业空间中进行协作。 + +### 步骤1:创建用户 + +> 我们使用默认的用户 `admin`,创建一个用户 `user-manager`,然后使用 `user-manager`创建新用户。 +> +1. 使用默认admin账户信息登陆 +2. 点击左上角的**平台管理**,然后选择**访问控制**。在左侧导航栏中,选择**平台角色**。四个内置角色的描述信息如下表所示。 + +| 内置角色 | 描述 | +| --- | --- | +| workspaces-manager | 企业空间管理员,管理平台所有企业空间。 | +| users-manager | 用户管理员,管理平台所有用户。 | +| platform-regular | 平台普通用户,在被邀请加入企业空间或集群之前没有任何资源操作权限。 | +| platform-admin | 平台管理员,可以管理平台内的所有资源。 | +1. 在**用户**中,点击**创建**。在弹出的对话框中,提供所有必要信息(带有*标记),然后在**角色**一栏选择 `users-manager`。完成后,点击**确定**。新创建的帐户将显示在**用户**中的帐户列表中。 +2. 切换帐户使用 `user-manager`重新登录,我们即可以创建不通角色的新账户,如下表所示。 + +| 帐户 | 角色 | 描述 | +| --- | --- | --- | +| ws-manager | workspaces-manager | 创建和管理所有企业空间。 | +| ws-admin | platform-regular | 管理指定企业空间中的所有资源(在此示例中,此帐户用于邀请新成员加入该企业空间)。 | +| project-admin | platform-regular | 创建和管理项目以及 DevOps 项目,并邀请新成员加入项目。 | +| project-regular | platform-regular | project-regular 将由 project-admin 邀请至项目或 DevOps 项目。该帐户将用于在指定项目中创建工作负载、流水线和其他资源。 | + +### 步骤2:创建企业空间 + +1. 以 `ws-manager` 身份登录 KubeSphere,它具有管理平台上所有企业空间的权限。点击左上角的**平台管理**,选择**访问控制**。在**企业空间**中,可以看到仅列出了一个默认企业空间 `system-workspace`,即系统企业空间,其中运行着与系统相关的组件和服务,无法删除该企业空间。 +2. 点击右侧的**创建**,将新企业空间命名为 `demo-workspace`,并将用户 `ws-admin`设置为企业空间管理员。完成后,点击**创建**。 + +### 步骤3:创建项目 + +> KubeSphere 中的项目与 Kubernetes 中的命名空间相同,为资源提供了虚拟隔离。 +> +1. 以 `project-admin` 身份登录 KubeSphere Web 控制台,在**项目**中,点击**创建**。 +2. 输入项目名称(例如 `demo-project`),然后点击**确定**完成,您还可以为项目添加别名和描述。 +3. 在**项目**中,点击刚创建的项目查看其详情页面。 + +# 四、安装后启用可插拔组件 + +### 启用DevOps + +1. 以 `admin` 用户登录控制台,点击左上角的**平台管理**,选择**集群管理**。 +2. 点击 **CRD**,在搜索栏中输入 `clusterconfiguration`,点击搜索结果查看其详细页面。 + +> 定制资源定义(CRD)允许用户在不新增 API 服务器的情况下创建一种新的资源类型,用户可以像使用其他 Kubernetes 原生对象一样使用这些定制资源。 +> +1. 在**自定义资源**中,点击 `ks-installer`右侧的按钮,选择**编辑 YAML。** +2. 在该 YAML 文件中,搜索 `devops`,将 `enabled`的 `false`改为 `true`。完成后,点击右下角的**确定**,保存配置。 + +```powershell +devops: + enabled: true # 将“false”更改为“true”。 +``` + +1. 在 kubectl 中执行以下命令检查安装过程: + +```powershell +kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f +``` + +### 验证组件的安装 + +- 在仪表盘中验证:进入**系统组件**,检查是否 **DevOps** 标签页中的所有组件都处于**健康**状态。如果是,组件安装成功。 +- 通过`kubectl`验证: + +通过以下命令来验证状态: + +```powershell +kubectl get pod -n kubesphere-devops-system +``` + +如果组件运行成功,输出结果如下: + +```powershell +NAME READY STATUS RESTARTS AGE +devops-jenkins-5cbbfbb975-hjnll 1/1 Running 0 40m +s2ioperator-0 1/1 Running 0 41m +``` + +### 启用应用商店 + +1. 使用 `admin` 用户登录控制台,点击左上角的**平台管理**,选择**集群管理**。 +2. 点击 **CRD**,在搜索栏中输入 `clusterconfiguration`,点击结果查看其详细页面。 + +> 定制资源定义(CRD)允许用户在不增加额外 API 服务器的情况下创建一种新的资源类型,用户可以像使用其他 Kubernetes 原生对象一样使用这些定制资源。 +> +1. 在**自定义资源**中,点击 `ks-installer` 右侧的 ,选择**编辑 YAML**。 +2. 在该 YAML 文件中,搜索 `openpitrix`,将 `enabled` 的 `false` 改为 `true`。完成后,点击右下角的**确定**,保存配置。 + +```bash +openpitrix: + store: + enabled: true # 将“false”更改为“true”。 +``` + +1. 在 kubectl 中执行以下命令检查安装过程: + +```bash +kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f +``` + +### ****验证组件的安装**** + +在您登录控制台后,如果您能看到页面左上角的**应用商店**以及其中的应用,则说明安装成功。 + +# 应用部署 + +### 以部署RabbitMQ为例 + +于DEMO中演示。 + +# Bonus + +### 命令行全记录 + +```bash +Continue this installation? [yes/no]: yes +11:01:37 CST success: [LocalHost] +11:01:37 CST [NodeBinariesModule] Download installation binaries +11:01:37 CST message: [localhost] +downloading amd64 kubeadm v1.21.5 ... + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed +100 42.7M 100 42.7M 0 0 922k 0 0:00:47 0:00:47 --:--:-- 348k +11:02:25 CST message: [localhost] +downloading amd64 kubelet v1.21.5 ... + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed +100 112M 100 112M 0 0 1017k 0 0:01:53 0:01:53 --:--:-- 1032k +11:04:19 CST message: [localhost] +downloading amd64 kubectl v1.21.5 ... + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed +100 44.4M 100 44.4M 0 0 1013k 0 0:00:44 0:00:44 --:--:-- 1032k +11:05:05 CST message: [localhost] +downloading amd64 helm v3.6.3 ... + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed +100 43.0M 100 43.0M 0 0 994k 0 0:00:44 0:00:44 --:--:-- 959k +11:05:49 CST message: [localhost] +downloading amd64 kubecni v0.9.1 ... + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed +100 37.9M 100 37.9M 0 0 1011k 0 0:00:38 0:00:38 --:--:-- 1000k +11:06:28 CST message: [localhost] +downloading amd64 docker 20.10.8 ... + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed +100 58.1M 100 58.1M 0 0 1198k 0 0:00:49 0:00:49 --:--:-- 1270k +11:07:18 CST message: [localhost] +downloading amd64 crictl v1.22.0 ... + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed +100 17.8M 100 17.8M 0 0 886k 0 0:00:20 0:00:20 --:--:-- 549k +11:07:38 CST message: [localhost] +downloading amd64 etcd v3.4.13 ... + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed +100 16.5M 100 16.5M 0 0 951k 0 0:00:17 0:00:17 --:--:-- 1020k +11:07:56 CST success: [LocalHost] +11:07:56 CST [ConfigureOSModule] Prepare to init OS +11:07:57 CST success: [localhost.localdomain] +11:07:57 CST [ConfigureOSModule] Generate init os script +11:07:57 CST success: [localhost.localdomain] +11:07:57 CST [ConfigureOSModule] Exec init os script +11:07:59 CST stdout: [localhost.localdomain] +Permissive +net.ipv4.ip_forward = 1 +net.bridge.bridge-nf-call-arptables = 1 +net.bridge.bridge-nf-call-ip6tables = 1 +net.bridge.bridge-nf-call-iptables = 1 +net.ipv4.ip_local_reserved_ports = 30000-32767 +vm.max_map_count = 262144 +vm.swappiness = 1 +fs.inotify.max_user_instances = 524288 +kernel.pid_max = 65535 +no crontab for root +11:07:59 CST success: [localhost.localdomain] +11:07:59 CST [ConfigureOSModule] configure the ntp server for each node +11:07:59 CST skipped: [localhost.localdomain] +11:07:59 CST [KubernetesStatusModule] Get kubernetes cluster status +11:07:59 CST success: [localhost.localdomain] +11:07:59 CST [InstallContainerModule] Sync docker binaries +11:08:02 CST success: [localhost.localdomain] +11:08:02 CST [InstallContainerModule] Generate containerd service +11:08:02 CST success: [localhost.localdomain] +11:08:02 CST [InstallContainerModule] Enable containerd +11:08:03 CST success: [localhost.localdomain] +11:08:03 CST [InstallContainerModule] Generate docker service +11:08:03 CST success: [localhost.localdomain] +11:08:03 CST [InstallContainerModule] Generate docker config +11:08:04 CST success: [localhost.localdomain] +11:08:04 CST [InstallContainerModule] Enable docker +11:08:04 CST success: [localhost.localdomain] +11:08:04 CST [InstallContainerModule] Add auths to container runtime +11:08:04 CST skipped: [localhost.localdomain] +11:08:04 CST [PullModule] Start to pull images on all nodes +11:08:04 CST message: [localhost.localdomain] +downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/pause:3.4.1 +11:08:12 CST message: [localhost.localdomain] +downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/kube-apiserver:v1.21.5 +11:08:22 CST message: [localhost.localdomain] +downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/kube-controller-manager:v1.21.5 +11:08:31 CST message: [localhost.localdomain] +downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/kube-scheduler:v1.21.5 +11:08:36 CST message: [localhost.localdomain] +downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/kube-proxy:v1.21.5 +11:08:48 CST message: [localhost.localdomain] +downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/coredns:1.8.0 +11:08:54 CST message: [localhost.localdomain] +downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/k8s-dns-node-cache:1.15.12 +11:09:06 CST message: [localhost.localdomain] +downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/kube-controllers:v3.20.0 +11:09:26 CST message: [localhost.localdomain] +downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/cni:v3.20.0 +11:09:45 CST message: [localhost.localdomain] +downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/node:v3.20.0 +11:10:31 CST message: [localhost.localdomain] +downloading image: registry.cn-beijing.aliyuncs.com/kubesphereio/pod2daemon-flexvol:v3.20.0 +11:10:42 CST success: [localhost.localdomain] +11:10:42 CST [ETCDPreCheckModule] Get etcd status +11:10:42 CST success: [localhost.localdomain] +11:10:42 CST [CertsModule] Fetcd etcd certs +11:10:42 CST success: [localhost.localdomain] +11:10:42 CST [CertsModule] Generate etcd Certs +[certs] Generating "ca" certificate and key +[certs] admin-localhost.localdomain serving cert is signed for DNS names [etcd etcd.kube-system etcd.kube-system.svc etcd.kube-system.svc.cluster.local lb.kubesphere.local localhost localhost.localdomain] and IPs [127.0.0.1 ::1 10.1.30.128] +[certs] member-localhost.localdomain serving cert is signed for DNS names [etcd etcd.kube-system etcd.kube-system.svc etcd.kube-system.svc.cluster.local lb.kubesphere.local localhost localhost.localdomain] and IPs [127.0.0.1 ::1 10.1.30.128] +[certs] node-localhost.localdomain serving cert is signed for DNS names [etcd etcd.kube-system etcd.kube-system.svc etcd.kube-system.svc.cluster.local lb.kubesphere.local localhost localhost.localdomain] and IPs [127.0.0.1 ::1 10.1.30.128] +11:10:43 CST success: [LocalHost] +11:10:43 CST [CertsModule] Synchronize certs file +11:10:45 CST success: [localhost.localdomain] +11:10:45 CST [CertsModule] Synchronize certs file to master +11:10:45 CST skipped: [localhost.localdomain] +11:10:45 CST [InstallETCDBinaryModule] Install etcd using binary +11:10:46 CST success: [localhost.localdomain] +11:10:46 CST [InstallETCDBinaryModule] Generate etcd service +11:10:46 CST success: [localhost.localdomain] +11:10:46 CST [InstallETCDBinaryModule] Generate access address +11:10:46 CST success: [localhost.localdomain] +11:10:46 CST [ETCDConfigureModule] Health check on exist etcd +11:10:46 CST skipped: [localhost.localdomain] +11:10:46 CST [ETCDConfigureModule] Generate etcd.env config on new etcd +11:10:46 CST success: [localhost.localdomain] +11:10:46 CST [ETCDConfigureModule] Refresh etcd.env config on all etcd +11:10:47 CST success: [localhost.localdomain] +11:10:47 CST [ETCDConfigureModule] Restart etcd +11:10:50 CST stdout: [localhost.localdomain] +Created symlink from /etc/systemd/system/multi-user.target.wants/etcd.service to /etc/systemd/system/etcd.service. +11:10:50 CST success: [localhost.localdomain] +11:10:50 CST [ETCDConfigureModule] Health check on all etcd +11:10:50 CST success: [localhost.localdomain] +11:10:50 CST [ETCDConfigureModule] Refresh etcd.env config to exist mode on all etcd +11:10:51 CST success: [localhost.localdomain] +11:10:51 CST [ETCDConfigureModule] Health check on all etcd +11:10:51 CST success: [localhost.localdomain] +11:10:51 CST [ETCDBackupModule] Backup etcd data regularly +11:10:57 CST success: [localhost.localdomain] +11:10:57 CST [InstallKubeBinariesModule] Synchronize kubernetes binaries +11:11:05 CST success: [localhost.localdomain] +11:11:05 CST [InstallKubeBinariesModule] Synchronize kubelet +11:11:05 CST success: [localhost.localdomain] +11:11:05 CST [InstallKubeBinariesModule] Generate kubelet service +11:11:05 CST success: [localhost.localdomain] +11:11:05 CST [InstallKubeBinariesModule] Enable kubelet service +11:11:06 CST success: [localhost.localdomain] +11:11:06 CST [InstallKubeBinariesModule] Generate kubelet env +11:11:06 CST success: [localhost.localdomain] +11:11:06 CST [InitKubernetesModule] Generate kubeadm config +11:11:06 CST success: [localhost.localdomain] +11:11:06 CST [InitKubernetesModule] Init cluster using kubeadm +11:11:25 CST stdout: [localhost.localdomain] +W0512 11:11:06.955402 13470 utils.go:69] The recommended value for "clusterDNS" in "KubeletConfiguration" is: [10.233.0.10]; the provided value is: [169.254.25.10] +[init] Using Kubernetes version: v1.21.5 +[preflight] Running pre-flight checks + [WARNING FileExisting-socat]: socat not found in system path +[preflight] Pulling images required for setting up a Kubernetes cluster +[preflight] This might take a minute or two, depending on the speed of your internet connection +[preflight] You can also perform this action in beforehand using 'kubeadm config images pull' +[certs] Using certificateDir folder "/etc/kubernetes/pki" +[certs] Generating "ca" certificate and key +[certs] Generating "apiserver" certificate and key +[certs] apiserver serving cert is signed for DNS names [kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local lb.kubesphere.local localhost localhost.localdomain localhost.localdomain.cluster.local] and IPs [10.233.0.1 10.1.30.128 127.0.0.1] +[certs] Generating "apiserver-kubelet-client" certificate and key +[certs] Generating "front-proxy-ca" certificate and key +[certs] Generating "front-proxy-client" certificate and key +[certs] External etcd mode: Skipping etcd/ca certificate authority generation +[certs] External etcd mode: Skipping etcd/server certificate generation +[certs] External etcd mode: Skipping etcd/peer certificate generation +[certs] External etcd mode: Skipping etcd/healthcheck-client certificate generation +[certs] External etcd mode: Skipping apiserver-etcd-client certificate generation +[certs] Generating "sa" key and public key +[kubeconfig] Using kubeconfig folder "/etc/kubernetes" +[kubeconfig] Writing "admin.conf" kubeconfig file +[kubeconfig] Writing "kubelet.conf" kubeconfig file +[kubeconfig] Writing "controller-manager.conf" kubeconfig file +[kubeconfig] Writing "scheduler.conf" kubeconfig file +[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env" +[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml" +[kubelet-start] Starting the kubelet +[control-plane] Using manifest folder "/etc/kubernetes/manifests" +[control-plane] Creating static Pod manifest for "kube-apiserver" +[control-plane] Creating static Pod manifest for "kube-controller-manager" +[control-plane] Creating static Pod manifest for "kube-scheduler" +[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take up to 4m0s +[apiclient] All control plane components are healthy after 15.003878 seconds +[upload-config] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace +[kubelet] Creating a ConfigMap "kubelet-config-1.21" in namespace kube-system with the configuration for the kubelets in the cluster +[upload-certs] Skipping phase. Please see --upload-certs +[mark-control-plane] Marking the node localhost.localdomain as control-plane by adding the labels: [node-role.kubernetes.io/master(deprecated) node-role.kubernetes.io/control-plane node.kubernetes.io/exclude-from-external-load-balancers] +[mark-control-plane] Marking the node localhost.localdomain as control-plane by adding the taints [node-role.kubernetes.io/master:NoSchedule] +[bootstrap-token] Using token: 3w0eui.czt6hzimqozquwup +[bootstrap-token] Configuring bootstrap tokens, cluster-info ConfigMap, RBAC Roles +[bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to get nodes +[bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials +[bootstrap-token] configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token +[bootstrap-token] configured RBAC rules to allow certificate rotation for all node client certificates in the cluster +[bootstrap-token] Creating the "cluster-info" ConfigMap in the "kube-public" namespace +[kubelet-finalize] Updating "/etc/kubernetes/kubelet.conf" to point to a rotatable kubelet client certificate and key +[addons] Applied essential addon: CoreDNS +[addons] Applied essential addon: kube-proxy + +Your Kubernetes control-plane has initialized successfully! + +To start using your cluster, you need to run the following as a regular user: + + mkdir -p $HOME/.kube + sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config + sudo chown $(id -u):$(id -g) $HOME/.kube/config + +Alternatively, if you are the root user, you can run: + + export KUBECONFIG=/etc/kubernetes/admin.conf + +You should now deploy a pod network to the cluster. +Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at: + https://kubernetes.io/docs/concepts/cluster-administration/addons/ + +You can now join any number of control-plane nodes by copying certificate authorities +and service account keys on each node and then running the following as root: + + kubeadm join lb.kubesphere.local:6443 --token 3w0eui.czt6hzimqozquwup \ + --discovery-token-ca-cert-hash sha256:3ca15ed0e2225c9be45e2085dbc8e94e0a0a367ed905f086a27811869cf2de8e \ + --control-plane + +Then you can join any number of worker nodes by running the following on each as root: + +kubeadm join lb.kubesphere.local:6443 --token 3w0eui.czt6hzimqozquwup \ + --discovery-token-ca-cert-hash sha256:3ca15ed0e2225c9be45e2085dbc8e94e0a0a367ed905f086a27811869cf2de8e +11:11:25 CST success: [localhost.localdomain] +11:11:25 CST [InitKubernetesModule] Copy admin.conf to ~/.kube/config +11:11:25 CST success: [localhost.localdomain] +11:11:25 CST [InitKubernetesModule] Remove master taint +11:11:26 CST stdout: [localhost.localdomain] +node/localhost.localdomain untainted +11:11:26 CST success: [localhost.localdomain] +11:11:26 CST [InitKubernetesModule] Add worker label +11:11:26 CST stdout: [localhost.localdomain] +node/localhost.localdomain labeled +11:11:26 CST success: [localhost.localdomain] +11:11:26 CST [ClusterDNSModule] Generate coredns service +11:11:26 CST success: [localhost.localdomain] +11:11:26 CST [ClusterDNSModule] Override coredns service +11:11:27 CST stdout: [localhost.localdomain] +service "kube-dns" deleted +11:11:27 CST stdout: [localhost.localdomain] +service/coredns created +Warning: resource clusterroles/system:coredns is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically. +clusterrole.rbac.authorization.k8s.io/system:coredns configured +11:11:27 CST success: [localhost.localdomain] +11:11:27 CST [ClusterDNSModule] Generate nodelocaldns +11:11:27 CST success: [localhost.localdomain] +11:11:27 CST [ClusterDNSModule] Deploy nodelocaldns +11:11:28 CST stdout: [localhost.localdomain] +serviceaccount/nodelocaldns created +daemonset.apps/nodelocaldns created +11:11:28 CST success: [localhost.localdomain] +11:11:28 CST [ClusterDNSModule] Generate nodelocaldns configmap +11:11:28 CST success: [localhost.localdomain] +11:11:28 CST [ClusterDNSModule] Apply nodelocaldns configmap +11:11:29 CST stdout: [localhost.localdomain] +configmap/nodelocaldns created +11:11:29 CST success: [localhost.localdomain] +11:11:29 CST [KubernetesStatusModule] Get kubernetes cluster status +11:11:29 CST stdout: [localhost.localdomain] +v1.21.5 +11:11:29 CST stdout: [localhost.localdomain] +localhost.localdomain v1.21.5 [map[address:10.1.30.128 type:InternalIP] map[address:localhost.localdomain type:Hostname]] +11:11:38 CST stdout: [localhost.localdomain] +I0512 11:11:31.587815 15539 version.go:254] remote version is much newer: v1.24.0; falling back to: stable-1.21 +[upload-certs] Storing the certificates in Secret "kubeadm-certs" in the "kube-system" Namespace +[upload-certs] Using certificate key: +d4646eec2295c3c39759cbde68a4276eb9a8ddf6138d44bcf4def5715d6e9a97 +11:11:38 CST stdout: [localhost.localdomain] +secret/kubeadm-certs patched +11:11:39 CST stdout: [localhost.localdomain] +secret/kubeadm-certs patched +11:11:39 CST stdout: [localhost.localdomain] +secret/kubeadm-certs patched +11:11:39 CST stdout: [localhost.localdomain] +8uijgh.6olli1mwtjcxxej8 +11:11:39 CST success: [localhost.localdomain] +11:11:39 CST [JoinNodesModule] Generate kubeadm config +11:11:39 CST skipped: [localhost.localdomain] +11:11:39 CST [JoinNodesModule] Join control-plane node +11:11:39 CST skipped: [localhost.localdomain] +11:11:39 CST [JoinNodesModule] Join worker node +11:11:39 CST skipped: [localhost.localdomain] +11:11:39 CST [JoinNodesModule] Copy admin.conf to ~/.kube/config +11:11:39 CST skipped: [localhost.localdomain] +11:11:39 CST [JoinNodesModule] Remove master taint +11:11:39 CST skipped: [localhost.localdomain] +11:11:39 CST [JoinNodesModule] Add worker label to master +11:11:39 CST skipped: [localhost.localdomain] +11:11:39 CST [JoinNodesModule] Synchronize kube config to worker +11:11:39 CST skipped: [localhost.localdomain] +11:11:39 CST [JoinNodesModule] Add worker label to worker +11:11:39 CST skipped: [localhost.localdomain] +11:11:39 CST [DeployNetworkPluginModule] Generate calico +11:11:39 CST success: [localhost.localdomain] +11:11:39 CST [DeployNetworkPluginModule] Deploy calico +11:11:41 CST stdout: [localhost.localdomain] +configmap/calico-config created +customresourcedefinition.apiextensions.k8s.io/bgpconfigurations.crd.projectcalico.org created +customresourcedefinition.apiextensions.k8s.io/bgppeers.crd.projectcalico.org created +customresourcedefinition.apiextensions.k8s.io/blockaffinities.crd.projectcalico.org created +customresourcedefinition.apiextensions.k8s.io/clusterinformations.crd.projectcalico.org created +customresourcedefinition.apiextensions.k8s.io/felixconfigurations.crd.projectcalico.org created +customresourcedefinition.apiextensions.k8s.io/globalnetworkpolicies.crd.projectcalico.org created +customresourcedefinition.apiextensions.k8s.io/globalnetworksets.crd.projectcalico.org created +customresourcedefinition.apiextensions.k8s.io/hostendpoints.crd.projectcalico.org created +customresourcedefinition.apiextensions.k8s.io/ipamblocks.crd.projectcalico.org created +customresourcedefinition.apiextensions.k8s.io/ipamconfigs.crd.projectcalico.org created +customresourcedefinition.apiextensions.k8s.io/ipamhandles.crd.projectcalico.org created +customresourcedefinition.apiextensions.k8s.io/ippools.crd.projectcalico.org created +customresourcedefinition.apiextensions.k8s.io/kubecontrollersconfigurations.crd.projectcalico.org created +customresourcedefinition.apiextensions.k8s.io/networkpolicies.crd.projectcalico.org created +customresourcedefinition.apiextensions.k8s.io/networksets.crd.projectcalico.org created +clusterrole.rbac.authorization.k8s.io/calico-kube-controllers created +clusterrolebinding.rbac.authorization.k8s.io/calico-kube-controllers created +clusterrole.rbac.authorization.k8s.io/calico-node created +clusterrolebinding.rbac.authorization.k8s.io/calico-node created +daemonset.apps/calico-node created +serviceaccount/calico-node created +deployment.apps/calico-kube-controllers created +serviceaccount/calico-kube-controllers created +Warning: policy/v1beta1 PodDisruptionBudget is deprecated in v1.21+, unavailable in v1.25+; use policy/v1 PodDisruptionBudget +poddisruptionbudget.policy/calico-kube-controllers created +11:11:41 CST success: [localhost.localdomain] +11:11:41 CST [ConfigureKubernetesModule] Configure kubernetes +11:11:41 CST success: [localhost.localdomain] +11:11:41 CST [ChownModule] Chown user $HOME/.kube dir +11:11:41 CST success: [localhost.localdomain] +11:11:41 CST [AutoRenewCertsModule] Generate k8s certs renew script +11:11:41 CST success: [localhost.localdomain] +11:11:41 CST [AutoRenewCertsModule] Generate k8s certs renew service +11:11:42 CST success: [localhost.localdomain] +11:11:42 CST [AutoRenewCertsModule] Generate k8s certs renew timer +11:11:43 CST success: [localhost.localdomain] +11:11:43 CST [AutoRenewCertsModule] Enable k8s certs renew service +11:11:43 CST success: [localhost.localdomain] +11:11:43 CST [SaveKubeConfigModule] Save kube config as a configmap +11:11:43 CST success: [LocalHost] +11:11:43 CST [AddonsModule] Install addons +11:11:43 CST success: [LocalHost] +11:11:43 CST [DeployStorageClassModule] Generate OpenEBS manifest +11:11:44 CST success: [localhost.localdomain] +11:11:44 CST [DeployStorageClassModule] Deploy OpenEBS as cluster default StorageClass +11:11:44 CST success: [localhost.localdomain] +11:11:44 CST [DeployKubeSphereModule] Generate KubeSphere ks-installer crd manifests +11:11:45 CST success: [localhost.localdomain] +11:11:45 CST [DeployKubeSphereModule] Apply ks-installer +11:11:45 CST stdout: [localhost.localdomain] +namespace/kubesphere-system created +serviceaccount/ks-installer created +customresourcedefinition.apiextensions.k8s.io/clusterconfigurations.installer.kubesphere.io created +clusterrole.rbac.authorization.k8s.io/ks-installer created +clusterrolebinding.rbac.authorization.k8s.io/ks-installer created +deployment.apps/ks-installer created +11:11:45 CST success: [localhost.localdomain] +11:11:45 CST [DeployKubeSphereModule] Add config to ks-installer manifests +11:11:45 CST success: [localhost.localdomain] +11:11:45 CST [DeployKubeSphereModule] Create the kubesphere namespace +11:11:45 CST success: [localhost.localdomain] +11:11:45 CST [DeployKubeSphereModule] Setup ks-installer config +11:11:46 CST stdout: [localhost.localdomain] +secret/kube-etcd-client-certs created +11:11:46 CST success: [localhost.localdomain] +11:11:46 CST [DeployKubeSphereModule] Apply ks-installer +11:11:48 CST stdout: [localhost.localdomain] +namespace/kubesphere-system unchanged +serviceaccount/ks-installer unchanged +customresourcedefinition.apiextensions.k8s.io/clusterconfigurations.installer.kubesphere.io unchanged +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 +11:11:48 CST success: [localhost.localdomain] +Please wait for the installation to complete: <---<< + +11:11:48 CST stdout: [localhost.localdomain] +namespace/kubesphere-system unchanged +serviceaccount/ks-installer unchanged +customresourcedefinition.apiextensions.k8s.io/clusterconfigurations.installer.kubesphere.io unchanged +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 +11:11:48 CST success: [localhost.localdomain] +##################################################### +### Welcome to KubeSphere! ### +##################################################### + +Console: http://10.1.30.128: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 2022-05-12 11:29:05 +##################################################### +11:29:07 CST success: [localhost.localdomain] +11:29:07 CST Pipeline[CreateClusterPipeline] execute successful +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 + +``` \ No newline at end of file -- Gitee From ab9e1e226a6417ce68e426e8830af07e85faee63 Mon Sep 17 00:00:00 2001 From: Rain Wen Date: Mon, 16 May 2022 05:45:57 +0000 Subject: [PATCH 10/19] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20In?= =?UTF-8?q?stall-KubeSphere/README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Install-KubeSphere/README.md | 218 ----------------------------------- 1 file changed, 218 deletions(-) delete mode 100644 Install-KubeSphere/README.md diff --git a/Install-KubeSphere/README.md b/Install-KubeSphere/README.md deleted file mode 100644 index 2d093ee..0000000 --- a/Install-KubeSphere/README.md +++ /dev/null @@ -1,218 +0,0 @@ -# KubeSphere安装Kubernetes及应用部署指北 - -# 一、**环境介绍** - -## 准备Linux机器 - -可以参考以下硬件规格准备一台符合要求的主机节点开始 `all-in-one`模式的安装。 - -### 硬件推荐配置 - -| 操作系统 | 最低配置 | -| --- | --- | -| Ubuntu 16.04, 18.04 | 2 核 CPU,4 GB 内存,40 GB 磁盘空间 | -| CentOS 7.x | 2 核 CPU,4 GB 内存,40 GB 磁盘空间 | -| Red Hat Enterprise Linux 7 | 2 核 CPU,4 GB 内存,40 GB 磁盘空间 | - -> 本次实验选择的操作系统为:**CentOS 7.9**,配置为:**4 核 CPU**,**8 GB 内存**,**40 GB 磁盘空间**。 -> - -### 节点要求 - -1. 节点能通过`SSH`连接; -2. 节点上可以使用`sudo/curl/openssl`命令; - -### 容器运行时 - -集群中必须有一个可用的容器运行时,如果使用自动化搭建集群,**KubeKey** 会默认安装最新版本的Docker,或是,在创建集群前手动安装Docker的选定版本或其他容器运行时。 - -| 支持的容器运行时 | 版本 | -| --- | --- | -| Docker | 19.3.8+ | -| containerd | 最新版 | - -> 如果采用离线部署KubeSphere,需要提前安装好一个容器运行时。 -> - -> KubeKey 是用 Go 语言开发的一款全新的安装工具。KubeKey 提供了灵活的安装选择,可以分别安装 KubeSphere 和 Kubernetes 或二者同时安装。 -> - -### 依赖项要求 - -KubeKey 可以将 Kubernetes 和 KubeSphere 一同安装。针对不同的 Kubernetes 版本,需要安装的依赖项可能有所不同。您可以参考以下列表,查看是否需要提前在节点上安装相关的依赖项。 - -| 依赖项 | Kubernetes 版本 ≥ 1.18 | Kubernetes 版本 < 1.18 | -| --- | --- | --- | -| socat | 必须 | 可选但建议 | -| conntrack | 必须 | 可选但建议 | -| ebtables | 可选但建议 | 可选但建议 | -| ipset | 可选但建议 | 可选但建议 | - -### 网络要求 - -1. 如果网络配置使用防火墙规则或安全组,请务必确保基础设施组件可以通过特定端口相互通信,建议您关闭防火墙。需指出的是,端口号30000 - 32767 务必放行,具体参数见下表。 - -| 服务 | 协议 | 行为 | 起始端口 | 结束端口 | 备注 | -| --- | --- | --- | --- | --- | --- | -| ssh | TCP | allow | 22 | 0 | | -| etcd | TCP | allow | 2379 | 2380 | | -| apiserver | TCP | allow | 6443 | 0 | | -| calico | TCP | allow | 9099 | 9100 | | -| bgp | TCP | allow | 179 | 0 | | -| nodeport | TCP | allow | 30000 | 32767 | | -| master | TCP | allow | 10250 | 10258 | | -| dns | TCP | allow | 53 | 0 | | -| dns | UDP | allow | 53 | 0 | | -| local-registry | TCP | allow | 5000 | 0 | 离线环境需要 | -| local-apt | TCP | allow | 5080 | 0 | 离线环境需要 | -| rpcbind | TCP | allow | 111 | 0 | 使用 NFS 时需要 | -| ipip | IPENCAP / IPIP | allow | 0 | 0 | Calico 需要使用 IPIP 协议 | -| metrics-server | TCP | allow | 8443 | 0 | | - -> 如果需要特别指定使用 Calico 网络插件并且在云平台上使用经典网络运行集群时,您需要对源地址启用 IPENCAP 和 IPIP 协议。 -> -1. 支持的CNI 插件:Calico 和 Flannel 等。 -2. (可选)为Docker配置阿里云等镜像加速器,需要提前安装好Docker。 - -# 二、部署KubeSphere - -## 步骤1:下载KubeKey - -- 鉴于网络环境的原因,在部署前将地域调整至CN - -```powershell -export KKZONE=cn -``` - -- 执行以下命令下载KubeKey - -```powershell -curl -sfL [https://get-kk.kubesphere.io](https://get-kk.kubesphere.io/) | VERSION=v2.0.0 sh - -``` - -- 为`kk`添加可执行权限 - -```bash -chmod +x kk -``` - -## 步骤2:开始安装 - -如上所述,本次实验为All-in-one默认最小化安装,只需要执行一个命令即可自动化部署,命令模版如下: - -```powershell -./kk create cluster [--with-kubernetes version] [--with-kubesphere version] -``` - -且本次实验将同时安装 Kubernetes 和 KubeSphere,命令如下: - -```powershell -./kk create cluster --with-kubernetes v1.21.5 --with-kubesphere v3.2.1 -``` - -> 一般对于 All-in-One 安装,无需更改任何配置。 -> - -> 如果在这一步的命令中不添加标志 `-with-kubesphere`,则不会部署 KubeSphere,KubeKey 将只安装 Kubernetes。如果添加标志 `-with-kubesphere` 时不指定 KubeSphere 版本,则会安装最新版本的 KubeSphere。 -> - -执行该命令后,KubeKey 将检查您的安装环境,结果显示在一张表格中。若无问题,输入 `yes`继续安装流程。 - -## 步骤3:验证安装结果 - -当您看到以下输出时,表明安装已经完成。 - -```powershell -INFO[20:22:07CST]Installation is complete. - -Please check the result using the command: - - kubectl logs-n kubesphere-system$(kubectl get pod-n kubesphere-system-1app=ks-install-o jsonpath='{.items[0].metadata.name}')-f - -``` - -输入以下命令以检查安装结果: - -```powershell -kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f -``` - -输出信息会显示 Web 控制台的 IP 地址和端口号,默认的 NodePort 是 `30880`。现在可以使用默认的帐户和密码 (`admin/P@88w0rd`) 通过 `:30880`访问控制台。 - -```powershell -##################################################### -### Welcome to KubeSphere! ### -##################################################### - -Console: http://192.168.0.2: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 20xx-xx-xx xx:xx:xx -##################################################### -``` - -登录至控制台后,您可以在**系统组件**中查看各个组件的状态。如果要使用相关服务,您可能需要等待部分组件启动并运行。 - -也可以在命令行使用 `kubectl get pod --all-namespaces`来检查 KubeSphere 相关组件的运行状况。 - -# 安装后启用可插拔组件 - -### 启用DevOps - -1. 以 `admin` 用户登录控制台,点击左上角的**平台管理**,选择**集群管理**。 -2. 点击 **CRD**,在搜索栏中输入 `clusterconfiguration`,点击搜索结果查看其详细页面。 - -> 定制资源定义(CRD)允许用户在不新增 API 服务器的情况下创建一种新的资源类型,用户可以像使用其他 Kubernetes 原生对象一样使用这些定制资源。 -> -1. 在**自定义资源**中,点击 `ks-installer`右侧的按钮,选择**编辑 YAML。** -2. 在该 YAML 文件中,搜索 `devops`,将 `enabled`的 `false`改为 `true`。完成后,点击右下角的**确定**,保存配置。 - -```powershell -devops: - enabled: true # 将“false”更改为“true”。 -``` - -1. 在 kubectl 中执行以下命令检查安装过程: - -```powershell -kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f -``` - -### 验证组件的安装 - -- 在仪表盘中验证:进入**系统组件**,检查是否 **DevOps**标签页中的所有组件都处于**健康**状态。如果是,组件安装成功。 -- 通过`kubectl`验证: - -通过以下命令来验证状态: - -```powershell -kubectl get pod -n kubesphere-devops-system -``` - -如果组件运行成功,输出结果如下: - -```powershell -NAME READY STATUS RESTARTS AGE -devops-jenkins-5cbbfbb975-hjnll 1/1 Running 0 40m -s2ioperator-0 1/1 Running 0 41m -``` - -### 启用应用商店 - -于DEMO中演示。 - -# 应用部署 - -### 部署RabbitMQ为例 - -于DEMO中演示。 \ No newline at end of file -- Gitee From 583470640e949d3fa9533ba6c0578b3e28d2f1d2 Mon Sep 17 00:00:00 2001 From: Rain Wen Date: Mon, 16 May 2022 05:46:39 +0000 Subject: [PATCH 11/19] =?UTF-8?q?update=20Install-KubeSphere/KubeSphere?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E5=8F=8A=E5=BA=94=E7=94=A8=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=20a89211cf8ed04cbdb727d694e77a58d0.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...351\203\250\347\275\262 a89211cf8ed04cbdb727d694e77a58d0.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/Install-KubeSphere/KubeSphere\345\256\211\350\243\205\345\217\212\345\272\224\347\224\250\351\203\250\347\275\262 a89211cf8ed04cbdb727d694e77a58d0.md" "b/Install-KubeSphere/KubeSphere\345\256\211\350\243\205\345\217\212\345\272\224\347\224\250\351\203\250\347\275\262 a89211cf8ed04cbdb727d694e77a58d0.md" index b2b1e73..e173b0d 100644 --- "a/Install-KubeSphere/KubeSphere\345\256\211\350\243\205\345\217\212\345\272\224\347\224\250\351\203\250\347\275\262 a89211cf8ed04cbdb727d694e77a58d0.md" +++ "b/Install-KubeSphere/KubeSphere\345\256\211\350\243\205\345\217\212\345\272\224\347\224\250\351\203\250\347\275\262 a89211cf8ed04cbdb727d694e77a58d0.md" @@ -213,7 +213,7 @@ https://kubesphere.io 20xx-xx-xx xx:xx:xx 2. 输入项目名称(例如 `demo-project`),然后点击**确定**完成,您还可以为项目添加别名和描述。 3. 在**项目**中,点击刚创建的项目查看其详情页面。 -# 四、安装后启用可插拔组件 +# 四、启用可插拔组件 ### 启用DevOps -- Gitee From 285e4e98077c01272903424cd63625350cfaed1b Mon Sep 17 00:00:00 2001 From: Rain Wen Date: Mon, 16 May 2022 05:47:31 +0000 Subject: [PATCH 12/19] =?UTF-8?q?update=20Install-KubeSphere/KubeSphere?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E5=8F=8A=E5=BA=94=E7=94=A8=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=20a89211cf8ed04cbdb727d694e77a58d0.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...351\203\250\347\275\262 a89211cf8ed04cbdb727d694e77a58d0.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/Install-KubeSphere/KubeSphere\345\256\211\350\243\205\345\217\212\345\272\224\347\224\250\351\203\250\347\275\262 a89211cf8ed04cbdb727d694e77a58d0.md" "b/Install-KubeSphere/KubeSphere\345\256\211\350\243\205\345\217\212\345\272\224\347\224\250\351\203\250\347\275\262 a89211cf8ed04cbdb727d694e77a58d0.md" index e173b0d..4e12a4e 100644 --- "a/Install-KubeSphere/KubeSphere\345\256\211\350\243\205\345\217\212\345\272\224\347\224\250\351\203\250\347\275\262 a89211cf8ed04cbdb727d694e77a58d0.md" +++ "b/Install-KubeSphere/KubeSphere\345\256\211\350\243\205\345\217\212\345\272\224\347\224\250\351\203\250\347\275\262 a89211cf8ed04cbdb727d694e77a58d0.md" @@ -283,7 +283,7 @@ kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app= # 应用部署 -### 以部署RabbitMQ为例 +### 部署RabbitMQ 于DEMO中演示。 -- Gitee From 908c76da2437b73dcb998ffb1234975bb50850b0 Mon Sep 17 00:00:00 2001 From: Rain Wen Date: Mon, 16 May 2022 05:47:55 +0000 Subject: [PATCH 13/19] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=20Install-Kub?= =?UTF-8?q?eSphere/KubeSphere=E5=AE=89=E8=A3=85=E5=8F=8A=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E9=83=A8=E7=BD=B2=20a89211cf8ed04cbdb727d694e77a58d0.md=20?= =?UTF-8?q?=E4=B8=BA=20Install-KubeSphere/README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "Install-KubeSphere/KubeSphere\345\256\211\350\243\205\345\217\212\345\272\224\347\224\250\351\203\250\347\275\262 a89211cf8ed04cbdb727d694e77a58d0.md" => Install-KubeSphere/README.md (100%) diff --git "a/Install-KubeSphere/KubeSphere\345\256\211\350\243\205\345\217\212\345\272\224\347\224\250\351\203\250\347\275\262 a89211cf8ed04cbdb727d694e77a58d0.md" b/Install-KubeSphere/README.md similarity index 100% rename from "Install-KubeSphere/KubeSphere\345\256\211\350\243\205\345\217\212\345\272\224\347\224\250\351\203\250\347\275\262 a89211cf8ed04cbdb727d694e77a58d0.md" rename to Install-KubeSphere/README.md -- Gitee From 933d50ee9c0c77b2ffe1a217231b90e98368929f Mon Sep 17 00:00:00 2001 From: Rain Wen Date: Mon, 16 May 2022 05:49:05 +0000 Subject: [PATCH 14/19] update Install-KubeSphere/README.md. --- Install-KubeSphere/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Install-KubeSphere/README.md b/Install-KubeSphere/README.md index 4e12a4e..445dd23 100644 --- a/Install-KubeSphere/README.md +++ b/Install-KubeSphere/README.md @@ -27,7 +27,7 @@ ### 容器运行时 -集群中必须有一个可用的容器运行时,如果使用自动化搭建集群,K**ubeKey** 会默认安装最新版本的Docker,或是,在创建集群前手动安装Docker的选定版本或其他容器运行时。 +集群中必须有一个可用的容器运行时,如果使用自动化搭建集群,**KubeKey** 会默认安装最新版本的Docker,或是,在创建集群前手动安装Docker的选定版本或其他容器运行时。 | 支持的容器运行时 | 版本 | | --- | --- | -- Gitee From 465c3033257aea1dbfb582b422bbd47cd54adb8b Mon Sep 17 00:00:00 2001 From: Rain Wen Date: Mon, 16 May 2022 07:58:20 +0000 Subject: [PATCH 15/19] update Install-KubeSphere/README.md. --- Install-KubeSphere/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Install-KubeSphere/README.md b/Install-KubeSphere/README.md index 445dd23..10ed514 100644 --- a/Install-KubeSphere/README.md +++ b/Install-KubeSphere/README.md @@ -281,7 +281,7 @@ kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app= 在您登录控制台后,如果您能看到页面左上角的**应用商店**以及其中的应用,则说明安装成功。 -# 应用部署 +# 五、应用部署 ### 部署RabbitMQ -- Gitee From 36aae65b34f0048396fc82c0c5c2a83fd5473419 Mon Sep 17 00:00:00 2001 From: Rain Wen Date: Mon, 16 May 2022 08:03:23 +0000 Subject: [PATCH 16/19] update Install-KubeSphere/README.md. --- Install-KubeSphere/README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Install-KubeSphere/README.md b/Install-KubeSphere/README.md index 10ed514..4614fbd 100644 --- a/Install-KubeSphere/README.md +++ b/Install-KubeSphere/README.md @@ -190,8 +190,8 @@ https://kubesphere.io 20xx-xx-xx xx:xx:xx | users-manager | 用户管理员,管理平台所有用户。 | | platform-regular | 平台普通用户,在被邀请加入企业空间或集群之前没有任何资源操作权限。 | | platform-admin | 平台管理员,可以管理平台内的所有资源。 | -1. 在**用户**中,点击**创建**。在弹出的对话框中,提供所有必要信息(带有*标记),然后在**角色**一栏选择 `users-manager`。完成后,点击**确定**。新创建的帐户将显示在**用户**中的帐户列表中。 -2. 切换帐户使用 `user-manager`重新登录,我们即可以创建不通角色的新账户,如下表所示。 +3. 在**用户**中,点击**创建**。在弹出的对话框中,提供所有必要信息(带有*标记),然后在**角色**一栏选择 `users-manager`。完成后,点击**确定**。新创建的帐户将显示在**用户**中的帐户列表中。 +4. 切换帐户使用 `user-manager`重新登录,我们即可以创建不通角色的新账户,如下表所示。 | 帐户 | 角色 | 描述 | | --- | --- | --- | @@ -222,15 +222,15 @@ https://kubesphere.io 20xx-xx-xx xx:xx:xx > 定制资源定义(CRD)允许用户在不新增 API 服务器的情况下创建一种新的资源类型,用户可以像使用其他 Kubernetes 原生对象一样使用这些定制资源。 > -1. 在**自定义资源**中,点击 `ks-installer`右侧的按钮,选择**编辑 YAML。** -2. 在该 YAML 文件中,搜索 `devops`,将 `enabled`的 `false`改为 `true`。完成后,点击右下角的**确定**,保存配置。 +3. 在**自定义资源**中,点击 `ks-installer`右侧的按钮,选择**编辑 YAML。** +4. 在该 YAML 文件中,搜索 `devops`,将 `enabled`的 `false`改为 `true`。完成后,点击右下角的**确定**,保存配置。 ```powershell devops: enabled: true # 将“false”更改为“true”。 ``` -1. 在 kubectl 中执行以下命令检查安装过程: +5. 在 kubectl 中执行以下命令检查安装过程: ```powershell kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f @@ -262,8 +262,8 @@ s2ioperator-0 1/1 Running 0 41m > 定制资源定义(CRD)允许用户在不增加额外 API 服务器的情况下创建一种新的资源类型,用户可以像使用其他 Kubernetes 原生对象一样使用这些定制资源。 > -1. 在**自定义资源**中,点击 `ks-installer` 右侧的 ,选择**编辑 YAML**。 -2. 在该 YAML 文件中,搜索 `openpitrix`,将 `enabled` 的 `false` 改为 `true`。完成后,点击右下角的**确定**,保存配置。 +3. 在**自定义资源**中,点击 `ks-installer` 右侧的 ,选择**编辑 YAML**。 +4. 在该 YAML 文件中,搜索 `openpitrix`,将 `enabled` 的 `false` 改为 `true`。完成后,点击右下角的**确定**,保存配置。 ```bash openpitrix: @@ -271,7 +271,7 @@ openpitrix: enabled: true # 将“false”更改为“true”。 ``` -1. 在 kubectl 中执行以下命令检查安装过程: +5. 在 kubectl 中执行以下命令检查安装过程: ```bash kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f -- Gitee From fdddc63814fe3de9ada901fc3e5fccfc231c88ce Mon Sep 17 00:00:00 2001 From: Rain Wen Date: Mon, 16 May 2022 08:04:11 +0000 Subject: [PATCH 17/19] update Install-KubeSphere/README.md. --- Install-KubeSphere/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Install-KubeSphere/README.md b/Install-KubeSphere/README.md index 4614fbd..dd65bce 100644 --- a/Install-KubeSphere/README.md +++ b/Install-KubeSphere/README.md @@ -74,8 +74,8 @@ KubeKey 可以将 Kubernetes 和 KubeSphere 一同安装。针对不同的 Kuber > 如果需要特别指定使用 Calico 网络插件并且在云平台上使用经典网络运行集群时,您需要对源地址启用 IPENCAP 和 IPIP 协议。 > -1. 支持的CNI 插件:Calico 和 Flannel 等。 -2. (可选)为Docker配置阿里云等镜像加速器,需要提前安装好Docker。 +2. 支持的CNI 插件:Calico 和 Flannel 等。 +3. (可选)为Docker配置阿里云等镜像加速器,需要提前安装好Docker。 # 二、部署KubeSphere -- Gitee From b48308257bddb2d2401a6ffe7de78114c6cc6339 Mon Sep 17 00:00:00 2001 From: Rain Wen Date: Mon, 16 May 2022 08:06:48 +0000 Subject: [PATCH 18/19] update Install-KubeSphere/README.md. --- Install-KubeSphere/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Install-KubeSphere/README.md b/Install-KubeSphere/README.md index dd65bce..0ba6878 100644 --- a/Install-KubeSphere/README.md +++ b/Install-KubeSphere/README.md @@ -42,7 +42,7 @@ ### 依赖项要求 -KubeKey 可以将 Kubernetes 和 KubeSphere 一同安装。针对不同的 Kubernetes 版本,需要安装的依赖项可能有所不同。您可以参考以下列表,查看是否需要提前在节点上安装相关的依赖项。 +KubeKey 可以将 Kubernetes 和 KubeSphere 一同安装。针对不同的 Kubernetes 版本,需要安装的依赖项可能有所不同。可以参考以下列表,查看是否需要提前在节点上安装相关的依赖项。 | 依赖项 | Kubernetes 版本 ≥ 1.18 | Kubernetes 版本 < 1.18 | | --- | --- | --- | @@ -72,7 +72,7 @@ KubeKey 可以将 Kubernetes 和 KubeSphere 一同安装。针对不同的 Kuber | ipip | IPENCAP / IPIP | allow | 0 | 0 | Calico 需要使用 IPIP 协议 | | metrics-server | TCP | allow | 8443 | 0 | | -> 如果需要特别指定使用 Calico 网络插件并且在云平台上使用经典网络运行集群时,您需要对源地址启用 IPENCAP 和 IPIP 协议。 +> 如果需要特别指定使用 Calico 网络插件并且在云平台上使用经典网络运行集群时,需要对源地址启用 IPENCAP 和 IPIP 协议。 > 2. 支持的CNI 插件:Calico 和 Flannel 等。 3. (可选)为Docker配置阿里云等镜像加速器,需要提前安装好Docker。 @@ -121,7 +121,7 @@ chmod +x kk > 如果在这一步的命令中不添加标志 `-with-kubesphere`,则不会部署 KubeSphere,KubeKey 将只安装 Kubernetes。如果添加标志 `-with-kubesphere` 时不指定 KubeSphere 版本,则会安装最新版本的 KubeSphere。 > -执行该命令后,KubeKey 将检查您的安装环境,结果显示在一张表格中。若无问题,输入 `yes`继续安装流程。 +执行该命令后,KubeKey 将检查安装环境,结果显示在一张表格中。若无问题,输入 `yes`继续安装流程。 ## 步骤3:验证安装结果 @@ -166,7 +166,7 @@ https://kubesphere.io 20xx-xx-xx xx:xx:xx ##################################################### ``` -登录至控制台后,您可以在**系统组件**中查看各个组件的状态。如果要使用相关服务,您可能需要等待部分组件启动并运行。 +登录至控制台后,可以在**系统组件**中查看各个组件的状态。如果要使用相关服务,可能需要等待部分组件启动并运行。 也可以在命令行使用 `kubectl get pod --all-namespaces`来检查 KubeSphere 相关组件的运行状况。 @@ -279,7 +279,7 @@ kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app= ### ****验证组件的安装**** -在您登录控制台后,如果您能看到页面左上角的**应用商店**以及其中的应用,则说明安装成功。 +在登录控制台后,如果能看到页面左上角的**应用商店**以及其中的应用,则说明安装成功。 # 五、应用部署 -- Gitee From d8c18898e166d88bd0395d2229097fac2962fd37 Mon Sep 17 00:00:00 2001 From: Rain Wen Date: Mon, 16 May 2022 08:07:47 +0000 Subject: [PATCH 19/19] update Install-KubeSphere/README.md. --- Install-KubeSphere/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Install-KubeSphere/README.md b/Install-KubeSphere/README.md index 0ba6878..4add685 100644 --- a/Install-KubeSphere/README.md +++ b/Install-KubeSphere/README.md @@ -53,7 +53,7 @@ KubeKey 可以将 Kubernetes 和 KubeSphere 一同安装。针对不同的 Kuber ### 网络要求 -1. 如果网络配置使用防火墙规则或安全组,请务必确保基础设施组件可以通过特定端口相互通信,建议您关闭防火墙。需指出的是,端口号30000 - 32767 务必放行,具体参数见下表。 +1. 如果网络配置使用防火墙规则或安全组,请务必确保基础设施组件可以通过特定端口相互通信,建议关闭防火墙(实验环境中)。需指出的是,端口号30000 - 32767 务必放行,具体参数见下表。 | 服务 | 协议 | 行为 | 起始端口 | 结束端口 | 备注 | | --- | --- | --- | --- | --- | --- | -- Gitee