Add Descriptions of Multi-cluster New Features in Docs

Signed-off-by: Felixnoo <felixliu@kubesphere.io>
This commit is contained in:
Felixnoo 2021-10-27 17:09:30 +08:00
parent 929457c4c1
commit a1d290c5c3
10 changed files with 168 additions and 24 deletions

View File

@ -34,28 +34,59 @@ If you already have a standalone KubeSphere cluster installed, you can set the v
kubectl edit cc ks-installer -n kubesphere-system
```
In the YAML file of `ks-installer`, navigate to `multicluster`, set the value of `clusterRole` to `host`, then click **Update** (if you use the web console) to make it effective:
In the YAML file of `ks-installer`, navigate to `multicluster`, set the value of `clusterRole` to `host`, then click **OK** (if you use the web console) to make it effective:
```yaml
multicluster:
clusterRole: host
```
To set the host cluster name, add a field `hostClusterName` under `multicluster.clusterRole` in the YAML file of `ks-installer`:
```yaml
multicluster:
clusterRole: host
hostClusterName: <Host cluster name>
```
{{< notice note >}}
- It is recommended that you set the host cluster name while you are preparing your host cluster. When your host cluster is set up and running with resources deployed, it is not recommended that you set the host cluster name.
- The host cluster name can contain only lowercase letters, numbers, hyphens (-), or periods (.), and must start and end with a lowercase letter or number.
{{</ notice >}}
You need to wait for a while so that the change can take effect.
{{</ tab >}}
{{< tab "KubeSphere has not been installed" >}}
You can define a host cluster before you install KubeSphere either on Linux or on an existing Kubernetes cluster. If you want to [install KubeSphere on Linux](../../../installing-on-linux/introduction/multioverview/#1-create-an-example-configuration-file), you use a `config-sample.yaml` file. If you want to [install KubeSphere on an existing Kubernetes cluster](../../../installing-on-kubernetes/introduction/overview/#deploy-kubesphere), you use two YAML files, one of which is `cluster-configuration.yaml`. To set a host cluster, change the value of `clusterRole` to `host` in `config-sample.yaml` or `cluster-configuration.yaml` accordingly before you install KubeSphere.
You can define a host cluster before you install KubeSphere either on Linux or on an existing Kubernetes cluster. If you want to [install KubeSphere on Linux](../../../installing-on-linux/introduction/multioverview/#1-create-an-example-configuration-file), you use a `config-sample.yaml` file. If you want to [install KubeSphere on an existing Kubernetes cluster](../../../installing-on-kubernetes/introduction/overview/#deploy-kubesphere), you use two YAML files, one of which is `cluster-configuration.yaml`.
To set a host cluster, change the value of `clusterRole` to `host` in `config-sample.yaml` or `cluster-configuration.yaml` accordingly before you install KubeSphere.
```yaml
multicluster:
clusterRole: host
```
To set the host cluster name, add a field `hostClusterName` under `multicluster.clusterRole` in `config-sample.yaml` or `cluster-configuration.yaml`:
```yaml
multicluster:
clusterRole: host
hostClusterName: <Host cluster name>
```
{{< notice note >}}
- The host cluster name can contain only lowercase letters, numbers, hyphens (-), or periods (.), and must start and end with a lowercase letter or number.
{{</ notice >}}
{{< notice info >}}
If you install KubeSphere on a single-node cluster ([All-in-One](../../../quick-start/all-in-one-on-linux/)), you do not need to create a `config-sample.yaml` file. In this case, you can set a host cluster after KubeSphere is installed.
{{</ notice >}}
@ -93,7 +124,7 @@ tower LoadBalancer 10.233.63.191 139.198.110.23 8080:30721/TCP
{{< notice note >}}
Generally, there is always a LoadBalancer solution in the public cloud, and the external IP can be allocated by the load balancer automatically. If your clusters are running in an on-premises environment, especially a **bare metal environment**, you can use [PorterLB](https://github.com/kubesphere/porter) as the LB solution.
Generally, there is always a LoadBalancer solution in the public cloud, and the external IP can be allocated by the load balancer automatically. If your clusters are running in an on-premises environment, especially a **bare metal environment**, you can use [OpenELB](https://github.com/kubesphere/porter) as the LB solution.
{{</ notice >}}
@ -180,7 +211,7 @@ authentication:
jwtSecret: gfIwilcc0WjNGKJ5DLeksf2JKfcLgTZU
```
Scroll down and set the value of `clusterRole` to `member`, then click **Update** (if you use the web console) to make it effective:
Scroll down and set the value of `clusterRole` to `member`, then click **OK** (if you use the web console) to make it effective:
```yaml
multicluster:
@ -227,8 +258,8 @@ kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=
2. Enter the basic information of the cluster to be imported on the **Import Cluster** page. You can also click **Edit Mode** in the upper-right corner to view and edit the basic information in YAML format. After you finish editing, click **Next**.
3. In **Connection Method**, select **Agent Connection** and click **Create**. It will show the YAML configuration file for the agent Deployment generated by the H Cluster on the console.
3. In **Connection Method**, select **Agent connection** and click **Create**. It will show the YAML configuration file for the agent Deployment generated by the host cluster on the console.
4. Create an `agent.yaml` file on the M Cluster based on the instruction, then copy and paste the agent deployment to the file. Execute `kubectl create -f agent.yaml` on the node and wait for the agent to be up and running. Please make sure the proxy address is accessible to the M Cluster.
4. Create an `agent.yaml` file on the member cluster based on the instruction, then copy and paste the agent deployment to the file. Execute `kubectl create -f agent.yaml` on the node and wait for the agent to be up and running. Please make sure the proxy address is accessible to the member cluster.
5. You can see the cluster you have imported in the H Cluster when the cluster agent is up and running.
5. You can see the cluster you have imported in the host cluster when the cluster agent is up and running.

View File

@ -6,7 +6,7 @@ titleLink: "Direct Connection"
weight: 5210
---
If the kube-apiserver address of the Member Cluster (M Cluster) is accessible on any node of the Host Cluster (H Cluster), you can adopt **Direction Connection**. This method is applicable when the kube-apiserver address of the M Cluster can be exposed or H Cluster and M Cluster are in the same private network or subnet.
If the kube-apiserver address of the member cluster is accessible on any node of the host cluster, you can adopt **Direction Connection**. This method is applicable when the kube-apiserver address of the M Cluster can be exposed or H Cluster and M Cluster are in the same private network or subnet.
To use the multi-cluster feature using direct connection, you must have at least two clusters serving as the H Cluster and the M Cluster respectively. A cluster can be defined as the H Cluster or the M Cluster either before or after you install KubeSphere. For more information about installing KubeSphere, refer to [Installing on Linux](../../../installing-on-linux/) and [Installing on Kubernetes](../../../installing-on-kubernetes/).
@ -34,28 +34,59 @@ If you already have a standalone KubeSphere cluster installed, you can set the v
kubectl edit cc ks-installer -n kubesphere-system
```
In the YAML file of `ks-installer`, navigate to `multicluster`, set the value of `clusterRole` to `host`, then click **Update** (if you use the web console) to make it effective:
In the YAML file of `ks-installer`, navigate to `multicluster`, set the value of `clusterRole` to `host`, then click **OK** (if you use the web console) to make it effective:
```yaml
multicluster:
clusterRole: host
```
To set the host cluster name, add a field `hostClusterName` under `multicluster.clusterRole` in the YAML file of `ks-installer`:
```yaml
multicluster:
clusterRole: host
hostClusterName: <Host cluster name>
```
{{< notice note >}}
- It is recommended that you set the host cluster name while you are preparing your host cluster. When your host cluster is set up and running with resources deployed, it is not recommended that you set the host cluster name.
- The host cluster name can contain only lowercase letters, numbers, hyphens (-), or periods (.), and must start and end with a lowercase letter or number.
{{</ notice >}}
You need to wait for a while so that the change can take effect.
{{</ tab >}}
{{< tab "KubeSphere has not been installed" >}}
You can define a host cluster before you install KubeSphere either on Linux or on an existing Kubernetes cluster. If you want to [install KubeSphere on Linux](../../../installing-on-linux/introduction/multioverview/#1-create-an-example-configuration-file), you use a `config-sample.yaml` file. If you want to [install KubeSphere on an existing Kubernetes cluster](../../../installing-on-kubernetes/introduction/overview/#deploy-kubesphere), you use two YAML files, one of which is `cluster-configuration.yaml`. To set a host cluster, change the value of `clusterRole` to `host` in `config-sample.yaml` or `cluster-configuration.yaml` accordingly before you install KubeSphere.
You can define a host cluster before you install KubeSphere either on Linux or on an existing Kubernetes cluster. If you want to [install KubeSphere on Linux](../../../installing-on-linux/introduction/multioverview/#1-create-an-example-configuration-file), you use a `config-sample.yaml` file. If you want to [install KubeSphere on an existing Kubernetes cluster](../../../installing-on-kubernetes/introduction/overview/#deploy-kubesphere), you use two YAML files, one of which is `cluster-configuration.yaml`.
To set a host cluster, change the value of `clusterRole` to `host` in `config-sample.yaml` or `cluster-configuration.yaml` accordingly before you install KubeSphere.
```yaml
multicluster:
clusterRole: host
```
To set the host cluster name, add a field `hostClusterName` under `multicluster.clusterRole` in `config-sample.yaml` or `cluster-configuration.yaml`:
```yaml
multicluster:
clusterRole: host
hostClusterName: <Host cluster name>
```
{{< notice note >}}
- The host cluster name can contain only lowercase letters, numbers, hyphens (-), or periods (.), and must start and end with a lowercase letter or number.
{{</ notice >}}
{{< notice info >}}
If you install KubeSphere on a single-node cluster ([All-in-One](../../../quick-start/all-in-one-on-linux/)), you do not need to create a `config-sample.yaml` file. In this case, you can set a host cluster after KubeSphere is installed.
{{</ notice >}}
@ -107,7 +138,7 @@ authentication:
jwtSecret: gfIwilcc0WjNGKJ5DLeksf2JKfcLgTZU
```
Scroll down and set the value of `clusterRole` to `member`, then click **Update** (if you use the web console) to make it effective:
Scroll down and set the value of `clusterRole` to `member`, then click **OK** (if you use the web console) to make it effective:
```yaml
multicluster:
@ -154,7 +185,7 @@ kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=
2. Enter the basic information of the cluster to be imported on the **Import Cluster** page. You can also click **Edit Mode** in the upper-right corner to view and edit the basic information in YAML format. After you finish editing, click **Next**.
3. In **Connection Method**, select **Direct Connection**, and copy the kubeconfig of the Member Cluster and paste it into the box. You can also click **Edit Mode** in the top-right corner to edit the kubeconfig of the Member Cluster in YAML format.
3. In **Connection Method**, select **Direct connection**, and copy the kubeconfig of the Member Cluster and paste it into the box. You can also click **Edit Mode** in the upper-right corner to edit the kubeconfig of the Member Cluster in YAML format.
{{< notice note >}}
@ -162,4 +193,4 @@ Make sure the `server` address in KubeConfig is accessible on any node of the Ho
{{</ notice >}}
1. Click **Create** and wait for cluster initialization to finish.
4. Click **Create** and wait for cluster initialization to finish.

View File

@ -68,8 +68,11 @@ A project cannot be recovered once deleted and resources in the project will be
{{</ notice >}}
2. In the **Create Multi-cluster Project** window that appears, enter a project name and add an alias or description if necessary. Under **Clusters**, select multiple clusters for your project by clicking **Add Cluster**, and then click **OK**.
3. A multi-cluster project created is displayed in the list. Click <img src="/images/docs/common-icons/three-dots.png" width="15" /> on the right of a multi-cluster project to select an operation from the drop-down menu:
3. A multi-cluster project created will display in the list. You can click the project name to go to its **Overview** page.
- **Edit Information**: Edit the basic information of a multi-cluster project.
- **Add Cluster**: Select a cluster from the drop-down list in the displayed dialog box and click **OK** to add a cluster to a multi-cluster project.
- **Delete**: Delete a multi-cluster project.
### Edit a multi-cluster project

View File

@ -20,6 +20,13 @@ You can enable **Edit YAML** in the upper-right corner to see corresponding valu
Set the number of replicated Pods by clicking <img src="/images/docs/project-user-guide/application-workloads/container-image-settings/plus-icon.png" width="20px" /> or <img src="/images/docs/project-user-guide/application-workloads/container-image-settings/minus-icon.png" width="20px" />, indicated by the `.spec.replicas` field in the manifest file. This option is not available for DaemonSets.
If you create Deployments in a multi-cluster project, select a replica scheduling mode under **Replica Scheduling Mode**:
- **Specify Replicas**: select clusters and set the number of Pod replicas in each cluster.
- **Specify Weights**: select clusters, set the total number of Pod replicas in **Total Replicas**, and specify a weight for each cluster. The Pod replicas will be proportionally scheduled to the clusters according to the weights.
If you create StatefulSets in a multi-cluster project, select clusters and set the number of Pod replicas in each cluster under **Pod Replicas**.
### Add Container
Click **Add Container** to add a container.

View File

@ -30,28 +30,59 @@ KubeSphere 的组件 [Tower](https://github.com/kubesphere/tower) 用于代理
kubectl edit cc ks-installer -n kubesphere-system
```
`ks-installer` 的 YAML 文件中,搜寻到 `multicluster`,将 `clusterRole` 的值设置为 `host`,然后点击**更新**(如果使用 Web 控制台)使其生效:
`ks-installer` 的 YAML 文件中,搜寻到 `multicluster`,将 `clusterRole` 的值设置为 `host`,然后点击**确定**(如果使用 Web 控制台)使其生效:
```yaml
multicluster:
clusterRole: host
```
要设置主集群名称,请在 `ks-installer` 的 YAML 文件中的 `multicluster.clusterRole` 下添加 `hostClusterName` 字段:
```yaml
multicluster:
clusterRole: host
hostClusterName: <主集群名称>
```
{{< notice note >}}
- 建议您在准备主集群的同时设置主集群名称。若您的主集群已在运行并且已经部署过资源,不建议您再去设置主集群名称。
- 主集群名称只能包含小写字母、数字、连字符(-)或者半角句号(.),必须以小写字母或数字开头和结尾。
{{</ notice >}}
您需要**稍等片刻**待该更改生效。
{{</ tab >}}
{{< tab "尚未安装 KubeSphere" >}}
在 Linux 上或者在现有 Kubernetes 集群上安装 KubeSphere 之前,您可以定义一个主集群。如果您想[在 Linux 上安装 KubeSphere](../../../installing-on-linux/introduction/multioverview/#1-创建示例配置文件),需要使用 `config-sample.yaml` 文件。如果您想[在现有 Kubernetes 集群上安装 KubeSphere](../../../installing-on-kubernetes/introduction/overview/#部署-kubesphere),需要使用两个 YAML 文件,其中一个是 `cluster-configuration.yaml`。要设置一个主集群,请在安装 KubeSphere 之前,将 `config-sample.yaml``cluster-configuration.yaml` 文件中对应的 `clusterRole` 的值修改为 `host`
在 Linux 上或者在现有 Kubernetes 集群上安装 KubeSphere 之前,您可以定义一个主集群。如果您想[在 Linux 上安装 KubeSphere](../../../installing-on-linux/introduction/multioverview/#1-创建示例配置文件),需要使用 `config-sample.yaml` 文件。如果您想[在现有 Kubernetes 集群上安装 KubeSphere](../../../installing-on-kubernetes/introduction/overview/#部署-kubesphere),需要使用两个 YAML 文件,其中一个是 `cluster-configuration.yaml`
要设置一个主集群,请在安装 KubeSphere 之前,将 `config-sample.yaml``cluster-configuration.yaml` 文件中对应的 `clusterRole` 的值修改为 `host`
```yaml
multicluster:
clusterRole: host
```
要设置主集群名称,请在 `config-sample.yaml``cluster-configuration.yaml` 文件中的 `multicluster.clusterRole` 下添加 `hostClusterName` 字段:
```yaml
multicluster:
clusterRole: host
hostClusterName: <主集群名称>
```
{{< notice note >}}
- 主集群名称只能包含小写字母、数字、连字符(-)或者半角句号(.),必须以小写字母或数字开头和结尾。
{{</ notice >}}
{{< notice info >}}
如果您在单节点集群上安装 KubeSphere ([All-in-One](../../../quick-start/all-in-one-on-linux/)),则不需要创建 `config-sample.yaml` 文件。这种情况下,您可以在安装 KubeSphere 之后设置主集群。
{{</ notice >}}
@ -176,7 +207,7 @@ authentication:
jwtSecret: gfIwilcc0WjNGKJ5DLeksf2JKfcLgTZU
```
向下滚动并将 `clusterRole` 的值设置为 `member`,然后点击**更新**(如果使用 Web 控制台)使其生效:
向下滚动并将 `clusterRole` 的值设置为 `member`,然后点击**确定**(如果使用 Web 控制台)使其生效:
```yaml
multicluster:

View File

@ -30,28 +30,59 @@ weight: 5210
kubectl edit cc ks-installer -n kubesphere-system
```
`ks-installer` 的 YAML 文件中,搜寻到 `multicluster`,将 `clusterRole` 的值设置为 `host`,然后点击**更新**(如果使用 Web 控制台)使其生效:
`ks-installer` 的 YAML 文件中,搜寻到 `multicluster`,将 `clusterRole` 的值设置为 `host`,然后点击**确定**(如果使用 Web 控制台)使其生效:
```yaml
multicluster:
clusterRole: host
```
要设置主集群名称,请在 `ks-installer` 的 YAML 文件中的 `multicluster.clusterRole` 下添加 `hostClusterName` 字段:
```yaml
multicluster:
clusterRole: host
hostClusterName: <主集群名称>
```
{{< notice note >}}
- 建议您在准备主集群的同时设置主集群名称。若您的主集群已在运行并且已经部署过资源,不建议您再去设置主集群名称。
- 主集群名称只能包含小写字母、数字、连字符(-)或者半角句号(.),必须以小写字母或数字开头和结尾。
{{</ notice >}}
您需要**稍等片刻**待该更改生效。
{{</ tab >}}
{{< tab "尚未安装 KubeSphere" >}}
在 Linux 上或者在现有 Kubernetes 集群上安装 KubeSphere 之前,您可以定义一个主集群。如果您想[在 Linux 上安装 KubeSphere](../../../installing-on-linux/introduction/multioverview/#1-创建示例配置文件),需要使用 `config-sample.yaml` 文件。如果您想[在现有 Kubernetes 集群上安装 KubeSphere](../../../installing-on-kubernetes/introduction/overview/#部署-kubesphere),需要使用两个 YAML 文件,其中一个是 `cluster-configuration.yaml`。要设置一个主集群,请在安装 KubeSphere 之前,将 `config-sample.yaml``cluster-configuration.yaml` 文件中对应的 `clusterRole` 的值修改为 `host`
在 Linux 上或者在现有 Kubernetes 集群上安装 KubeSphere 之前,您可以定义一个主集群。如果您想[在 Linux 上安装 KubeSphere](../../../installing-on-linux/introduction/multioverview/#1-创建示例配置文件),需要使用 `config-sample.yaml` 文件。如果您想[在现有 Kubernetes 集群上安装 KubeSphere](../../../installing-on-kubernetes/introduction/overview/#部署-kubesphere),需要使用两个 YAML 文件,其中一个是 `cluster-configuration.yaml`
要设置一个主集群,请在安装 KubeSphere 之前,将 `config-sample.yaml``cluster-configuration.yaml` 文件中对应的 `clusterRole` 的值修改为 `host`
```yaml
multicluster:
clusterRole: host
```
要设置主集群名称,请在 `config-sample.yaml``cluster-configuration.yaml` 文件中的 `multicluster.clusterRole` 下添加 `hostClusterName` 字段:
```yaml
multicluster:
clusterRole: host
hostClusterName: <主集群名称>
```
{{< notice note >}}
- 主集群名称只能包含小写字母、数字、连字符(-)或者半角句号(.),必须以小写字母或数字开头和结尾。
{{</ notice >}}
{{< notice info >}}
如果您在单节点集群上安装 KubeSphere ([All-in-One](../../../quick-start/all-in-one-on-linux/)),则不需要创建 `config-sample.yaml` 文件。这种情况下,您可以在安装 KubeSphere 之后设置主集群。
{{</ notice >}}
@ -103,7 +134,7 @@ authentication:
jwtSecret: gfIwilcc0WjNGKJ5DLeksf2JKfcLgTZU
```
向下滚动并将 `clusterRole` 的值设置为 `member`,然后点击**更新**(如果使用 Web 控制台)使其生效:
向下滚动并将 `clusterRole` 的值设置为 `member`,然后点击**确定**(如果使用 Web 控制台)使其生效:
```yaml
multicluster:
@ -116,7 +147,9 @@ multicluster:
{{< tab "尚未安装 KubeSphere" >}}
在 Linux 上或者在现有 Kubernetes 集群上安装 KubeSphere 之前,您可以定义。如果您想[在 Linux 上安装 KubeSphere](../../../installing-on-linux/introduction/multioverview/#1-创建示例配置文件),需要使用 `config-sample.yaml` 文件。如果您想[在现有 Kubernetes 集群上安装 KubeSphere](../../../installing-on-kubernetes/introduction/overview/#部署-kubesphere),需要使用两个 YAML 文件,其中一个是 `cluster-configuration.yaml`。要设置,请在安装 KubeSphere 之前,在 `config-sample.yaml``cluster-configuration.yaml` 文件中输入上方 `jwtSecret` 所对应的值,并将 `clusterRole` 的值修改为 `member`
在 Linux 上或者在现有 Kubernetes 集群上安装 KubeSphere 之前,您可以定义。如果您想[在 Linux 上安装 KubeSphere](../../../installing-on-linux/introduction/multioverview/#1-创建示例配置文件),需要使用 `config-sample.yaml` 文件。如果您想[在现有 Kubernetes 集群上安装 KubeSphere](../../../installing-on-kubernetes/introduction/overview/#部署-kubesphere),需要使用两个 YAML 文件,其中一个是 `cluster-configuration.yaml`
要设置,请在安装 KubeSphere 之前,在 `config-sample.yaml``cluster-configuration.yaml` 文件中输入上方 `jwtSecret` 所对应的值,并将 `clusterRole` 的值修改为 `member`
```yaml
authentication:

View File

@ -74,10 +74,11 @@ KubeSphere 中的项目即 Kubernetes [命名空间](https://kubernetes.io/zh/do
{{</ notice >}}
2. 在弹出的**创建多集群项目**窗口中输入项目名称,并根据需要添加别名或说明。在**集群设置**下,点击**添加集群**为项目选择多个集群,然后点击**确定**。
3. 创建的多集群项目会显示在列表中。点击多集群项目右侧的 <img src="/images/docs/common-icons/three-dots.png" width="15" />,从下拉菜单中选择一个操作:
3. 创建的多集群项目会显示在下图所示的列表中。您可以点击项目名称打开**概览**页面
![multi-cluster-list](/images/docs/zh-cn/project-administration/project-and-multicluster-project/multi-cluster-list.png)
- **编辑信息**:编辑多集群项目的基本信息
- **添加集群**:在弹出对话框的下拉列表中选择一个集群并点击**确定**,为多集群项目添加一个集群。
- **删除**:删除多集群项目。
### 编辑多集群项目

View File

@ -20,6 +20,13 @@ weight: 10280
点击 <img src="/images/docs/zh-cn/project-user-guide/application-workloads/container-image-settings/plus-icon.png" width="20px" /><img src="/images/docs/zh-cn/project-user-guide/application-workloads/container-image-settings/minus-icon.png" width="20px" /> 图标设置容器组副本数量,该参数显示在清单文件中的 `.spec.replicas` 字段。该选项对守护进程集不可用。
如果您在多集群项目中创建部署,请在**副本调度模式**下选择一个副本调度模式:
- **指定副本数量**:选择集群并设置每个集群的容器组副本数。
- **指定权重**:选择集群,在**副本总数**中设置容器组副本总数,并指定每个集群的权重。容器组副本将根据权重成比例地调度到每个集群。
如果您在多集群项目中创建有状态副本集,请在**容器组副本数量**下选择集群并设置每个集群的容器组副本数。
### 添加容器
点击**添加容器**来添加容器。

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB