diff --git a/content/en/docs/multicluster-management/enable-multicluster/_index.md b/content/en/docs/multicluster-management/enable-multicluster/_index.md index acee14540..d3e75b190 100644 --- a/content/en/docs/multicluster-management/enable-multicluster/_index.md +++ b/content/en/docs/multicluster-management/enable-multicluster/_index.md @@ -1,5 +1,5 @@ --- -linkTitle: "Enable Multi-cluster in KubeSphere" +linkTitle: "Enable Multi-Cluster Management in KubeSphere" weight: 5200 _build: diff --git a/content/en/docs/multicluster-management/enable-multicluster/agent-connection.md b/content/en/docs/multicluster-management/enable-multicluster/agent-connection.md index 886c728db..d07f14dd1 100644 --- a/content/en/docs/multicluster-management/enable-multicluster/agent-connection.md +++ b/content/en/docs/multicluster-management/enable-multicluster/agent-connection.md @@ -1,34 +1,28 @@ --- title: "Agent Connection" keywords: 'Kubernetes, KubeSphere, multicluster, agent-connection' -description: 'Overview' - +description: 'How to manage multiple clusters using an agent.' +titleLink: "Agent Connection" weight: 5220 --- -## Prerequisites +The component [Tower](https://github.com/kubesphere/tower) of KubeSphere is used for agent connection. Tower is a tool for network connection between clusters through the agent. If the Host Cluster (H Cluster) cannot access the Member Cluster (M Cluster) directly, you can expose the proxy service address of the H cluster. This enables the M Cluster to connect to the H Cluster through the agent. This method is applicable when the M Cluster is in a private environment (e.g. IDC) and the H Cluster is able to expose the proxy service. The agent connection is also applicable when your clusters are distributed across different cloud providers. -You have already installed at least two KubeSphere clusters. Please refer to [Installing on Linux](../../../installing-on-linux) or [Installing on Kubernetes](../../../installing-on-kubernetes) if they are not ready yet. You can also set up the role of the cluster in advance when installing KubeSphere as instructed in the tab `KubeSphere has not been installed` of [Prepare a Host Cluster](#prepare-a-host-cluster) and [Prepare a Member Cluster](#prepare-a-member-cluster) below. +To use the multi-cluster feature using an agent, 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). -{{< notice note >}} -Multi-cluster management requires Kubesphere to be installed on the target clusters. If you have an existing cluster, you can deploy KubeSphere on it with a minimal installation so that it can be imported. See [Minimal KubeSphere on Kubernetes](../../../quick-start/minimal-kubesphere-on-k8s/) for details. -{{}} +## Prepare a Host Cluster -## Agent Connection - -The component [Tower](https://github.com/kubesphere/tower) of KubeSphere is used for agent connection. Tower is a tool for network connection between clusters through the agent. If the Host Cluster (hereafter referred to as **H** Cluster) cannot access the Member Cluster (hereafter referred to as **M** Cluster) directly, you can expose the proxy service address of the H cluster. This enables the M Cluster to connect to the H cluster through the agent. This method is applicable when the M Cluster is in a private environment (e.g. IDC) and the H Cluster is able to expose the proxy service. The agent connection is also applicable when your clusters are distributed across different cloud providers. - -### Prepare a Host Cluster +A host cluster provides you with the central control plane and you can only define one host cluster. {{< tabs >}} {{< tab "KubeSphere has been installed" >}} -If you already have a standalone KubeSphere installed, you can set the value of `clusterRole` to `host` by editing the cluster configuration. You need to **wait for a while** so that the change can take effect. +If you already have a standalone KubeSphere cluster installed, you can set the value of `clusterRole` to `host` by editing the cluster configuration. -- Option A - Use Web Console: +- Option A - Use the web console: - Use `admin` account to log in the console and go to **CRDs** on the **Cluster Management** page. Enter the keyword `ClusterConfiguration` and go to its detail page. Edit the YAML of `ks-installer`, which is similar to [Enable Pluggable Components](../../../pluggable-components/). + Use the `admin` account to log in the console and go to **CRDs** on the **Cluster Management** page. Enter the keyword `ClusterConfiguration` and go to its detail page. Edit the YAML of `ks-installer`, which is similar to [Enable Pluggable Components](../../../pluggable-components/). - Option B - Use Kubectl: @@ -36,24 +30,32 @@ If you already have a standalone KubeSphere installed, you can set the value of kubectl edit cc ks-installer -n kubesphere-system ``` -Scroll down and 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 **Update** (if you use the web console) to make it effective: ```yaml multicluster: clusterRole: host ``` +You need to **wait for a while** so that the change can take effect. + {{}} {{< tab "KubeSphere has not been installed" >}} -There is no big difference than installing a standalone KubeSphere if you define a host cluster before installation. Please note that the `clusterRole` in `config-sample.yaml` or `cluster-configuration.yaml` has to be set as follows: +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 a `cluster-configuration.yaml` file. To set a host cluster, change the value of `clusterRole` to `host` in the YAML file before you install KubeSphere. ```yaml multicluster: clusterRole: host ``` +{{< notice note >}} + +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. + +{{}} + {{}} {{}} @@ -64,15 +66,15 @@ You can use **kubectl** to retrieve the installation logs to verify the status b kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f ``` -### Set Proxy Service Address +## Set the Proxy Service Address -After the installation of the Host Cluster, a proxy service called tower will be created in `kubesphere-system`, whose type is `LoadBalancer`. +After the installation of the host cluster, a proxy service called `tower` will be created in `kubesphere-system`, whose type is `LoadBalancer`. {{< tabs >}} {{< tab "A LoadBalancer available in your cluster" >}} -If a LoadBalancer plugin is available for the cluster, you can see a corresponding address for `EXTERNAL-IP` of the tower service, which will be acquired by KubeSphere and set the proxy service automatically. That means you can skip the step to set the proxy. Execute the following command to confirm you have a LoadBalancer. +If a LoadBalancer plugin is available for the cluster, you can see a corresponding address for `EXTERNAL-IP` of tower, which will be acquired by KubeSphere. In this case, the proxy service is set automatically. That means you can skip the step to set the proxy. Execute the following command to verify if you have a LoadBalancer. ```bash kubectl -n kubesphere-system get svc @@ -95,7 +97,7 @@ Generally, there is always a LoadBalancer solution in the public cloud, and the {{< tab "No LoadBalancer available in your cluster" >}} -1. If you cannot see a corresponding address displayed (the EXTERNAL-IP is pending), you need to manually set the proxy address. For example, you have an available public IP address `139.198.120.120`, and the port `8080` of this IP address has been forwarded to the port `30721` of the cluster. Execute the following command to check the service. +1. If you cannot see a corresponding address displayed (`EXTERNAL-IP` is `pending`), you need to manually set the proxy address. For example, you have an available public IP address `139.198.120.120`, and port `8080` of **this IP address has been forwarded to port** `30721` of the cluster. Execute the following command to check the service. ```shell $ kubectl -n kubesphere-system get svc @@ -103,11 +105,11 @@ Generally, there is always a LoadBalancer solution in the public cloud, and the tower LoadBalancer 10.233.63.191 8080:30721/TCP 16h ``` -2. Add the value of `proxyPublishAddress` to the configuration file of ks-installer and input the public IP address (`139.198.120.120` for this demo) and port number as follows. +2. Add the value of `proxyPublishAddress` to the configuration file of `ks-installer` and input the public IP address (`139.198.120.120` in this tutorial) and port number as follows. - - Option A - Use Web Console: + - Option A - Use the web console: - Use `admin` account to log in the console and go to **CRDs** on the **Cluster Management** page. Enter the keyword `ClusterConfiguration` and go to its detail page. Edit the YAML of `ks-installer`, which is similar to [Enable Pluggable Components](../../../pluggable-components/). + Use the `admin` account to log in the console and go to **CRDs** on the **Cluster Management** page. Enter the keyword `ClusterConfiguration` and go to its detail page. Edit the YAML of `ks-installer`, which is similar to [Enable Pluggable Components](../../../pluggable-components/). - Option B - Use Kubectl: @@ -115,7 +117,7 @@ Generally, there is always a LoadBalancer solution in the public cloud, and the kubectl -n kubesphere-system edit clusterconfiguration ks-installer ``` - Navigate to `multicluster` and add a new line for `proxyPublishAddress` to define the IP address so access tower. + Navigate to `multicluster` and add a new line for `proxyPublishAddress` to define the IP address to access tower. ```yaml multicluster: @@ -133,9 +135,9 @@ Generally, there is always a LoadBalancer solution in the public cloud, and the {{}} -### Prepare a Member Cluster +## Prepare a Member Cluster -In order to manage the member cluster within the **host cluster**, you need to make `jwtSecret` the same between them. Therefore, you need to get it first by excuting the following command on the **host cluster**. +In order to manage the member cluster from the **host cluster**, you need to make `jwtSecret` the same between them. Therefore, get it first by excuting the following command on the **host cluster**. ```bash kubectl -n kubesphere-system get cm kubesphere-config -o yaml | grep -v "apiVersion" | grep jwtSecret @@ -151,11 +153,11 @@ jwtSecret: "gfIwilcc0WjNGKJ5DLeksf2JKfcLgTZU" {{< tab "KubeSphere has been installed" >}} -If you already have a standalone KubeSphere installed, you can set the value of `clusterRole` to `member` by editing the cluster configuration. You need to **wait for a while** so that the change can take effect. +If you already have a standalone KubeSphere cluster installed, you can set the value of `clusterRole` to `member` by editing the cluster configuration. -- Option A - Use Web Console: +- Option A - Use the web console: - Use `admin` account to log in the console and go to **CRDs** on the **Cluster Management** page. Enter the keyword `ClusterConfiguration` and go to its detail page. Edit the YAML of `ks-installer`, which is similar to [Enable Pluggable Components](../../../pluggable-components/). + Use the `admin` account to log in the console and go to **CRDs** on the **Cluster Management** page. Enter the keyword `ClusterConfiguration` and go to its detail page. Edit the YAML of `ks-installer`, which is similar to [Enable Pluggable Components](../../../pluggable-components/). - Option B - Use Kubectl: @@ -163,7 +165,7 @@ If you already have a standalone KubeSphere installed, you can set the value of kubectl edit cc ks-installer -n kubesphere-system ``` -Input the corresponding `jwtSecret` shown above: +In the YAML file of `ks-installer`, input the corresponding `jwtSecret` shown above: ```yaml authentication: @@ -177,40 +179,56 @@ multicluster: clusterRole: member ``` +You need to **wait for a while** so that the change can take effect. + {{}} {{< tab "KubeSphere has not been installed" >}} -There is no big difference than installing a standalone KubeSphere if you define a member cluster before installation. Please note that the `clusterRole` in `config-sample.yaml` or `cluster-configuration.yaml` has to be set as follows: +You can define a member 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 a `cluster-configuration.yaml` file. To set a member cluster, input the value of `jwtSecret` shown above and change the value of `clusterRole` to `member` before you install KubeSphere. ```yaml authentication: jwtSecret: gfIwilcc0WjNGKJ5DLeksf2JKfcLgTZU ``` -Scroll down and set the value of `clusterRole` to `member`: - ```yaml multicluster: clusterRole: member ``` +{{< notice note >}} + +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 member cluster after KubeSphere is installed. + +{{}} + {{}} {{}} -### Import Cluster +You can use **kubectl** to retrieve the installation logs to verify the status by running the following command. Wait for a while, and you will be able to see the successful log return if the member cluster is ready. -1. Open the H Cluster dashboard and click **Add Cluster**. - ![Add Cluster](https://ap3.qingstor.com/kubesphere-website/docs/20200827231611.png) +```bash +kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f +``` + +## Import a Member Cluster + +1. Log in the KubeSphere console as `admin` and click **Add Cluster** on the **Clusters Management** page. + + ![add-cluster](/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/agent-connection/add-cluster.png) 2. Enter the basic information of the cluster to be imported and click **Next**. - ![Import Cluster](https://ap3.qingstor.com/kubesphere-website/docs/20200827211842.png) + + ![cluster-info](/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/agent-connection/cluster-info.png) 3. In **Connection Method**, select **Cluster connection agent** and click **Import**. It will show the agent deployment generated by the H Cluster in the console. - ![agent-en](/images/docs/agent-en.png) -4. Create an `agent.yaml` file in 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. + ![agent-en](/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/agent-connection/agent-en.png) + +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. 5. You can see the cluster you have imported in the H Cluster when the cluster agent is up and running. - ![Azure AKS](https://ap3.qingstor.com/kubesphere-website/docs/20200827231650.png) + + ![cluster-imported](/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/agent-connection/cluster-imported.png) diff --git a/content/en/docs/multicluster-management/enable-multicluster/direct-connection.md b/content/en/docs/multicluster-management/enable-multicluster/direct-connection.md index b81f861e4..a47b71f7c 100644 --- a/content/en/docs/multicluster-management/enable-multicluster/direct-connection.md +++ b/content/en/docs/multicluster-management/enable-multicluster/direct-connection.md @@ -1,34 +1,28 @@ --- title: "Direct Connection" keywords: 'Kubernetes, KubeSphere, multicluster, hybrid-cloud, direct-connection' -description: 'Overview' - +description: 'How to manage multiple clusters using direct connection.' +titleLink: "Direct Connection" weight: 5210 --- -## Prerequisites +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. -You have already installed at least two KubeSphere clusters. Please refer to [Installing on Linux](../../../installing-on-linux) or [Installing on Kubernetes](../../../installing-on-kubernetes) if they are not ready yet. +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). -{{< notice note >}} -Multi-cluster management requires Kubesphere to be installed on the target clusters. If you have an existing cluster, you can deploy KubeSphere on it with a minimal installation so that it can be imported. See [Minimal KubeSphere on Kubernetes](../../../quick-start/minimal-kubesphere-on-k8s/) for details. -{{}} +## Prepare a Host Cluster -## Direct Connection - -If the kube-apiserver address of Member Cluster (hereafter referred to as **M** Cluster) is accessible on any node of the Host Cluster (hereafter referred to as **H** Cluster), you can adopt **Direction Connection**. This method is applicable when the kube-apiserver address of M Cluster can be exposed or H Cluster and M Cluster are in the same private network or subnet. - -### Prepare a Host Cluster +A host cluster provides you with the central control plane and you can only define one host cluster. {{< tabs >}} {{< tab "KubeSphere has been installed" >}} -If you already have a standalone KubeSphere installed, you can set the value of `clusterRole` to `host` by editing the cluster configuration. You need to **wait for a while** so that the change can take effect. +If you already have a standalone KubeSphere cluster installed, you can set the value of `clusterRole` to `host` by editing the cluster configuration. -- Option A - Use Web Console: +- Option A - Use the web console: - Use `admin` account to log in the console and go to **CRDs** on the **Cluster Management** page. Enter the keyword `ClusterConfiguration` and go to its detail page. Edit the YAML of `ks-installer`, which is similar to [Enable Pluggable Components](../../../pluggable-components/). + Use the `admin` account to log in the console and go to **CRDs** on the **Cluster Management** page. Enter the keyword `ClusterConfiguration` and go to its detail page. Edit the YAML of `ks-installer`, which is similar to [Enable Pluggable Components](../../../pluggable-components/). - Option B - Use Kubectl: @@ -36,24 +30,32 @@ If you already have a standalone KubeSphere installed, you can set the value of kubectl edit cc ks-installer -n kubesphere-system ``` -Scroll down and 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 **Update** (if you use the web console) to make it effective: ```yaml multicluster: clusterRole: host ``` +You need to **wait for a while** so that the change can take effect. + {{}} {{< tab "KubeSphere has not been installed" >}} -There is no big difference than installing a standalone KubeSphere if you define a host cluster before installation. Please note that the `clusterRole` in `config-sample.yaml` or `cluster-configuration.yaml` has to be set as follows: +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 a `cluster-configuration.yaml` file. To set a host cluster, change the value of `clusterRole` to `host` in the YAML file before you install KubeSphere. ```yaml multicluster: clusterRole: host ``` +{{< notice note >}} + +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. + +{{}} + {{}} {{}} @@ -64,9 +66,9 @@ You can use **kubectl** to retrieve the installation logs to verify the status b kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f ``` -### Prepare a Member Cluster - -In order to manage the member cluster within the **host cluster**, you need to make `jwtSecret` the same between them. Therefore, you need to get it first by excuting the following command on the **host cluster** . +## Prepare a Member Cluster + +In order to manage the member cluster from the **host cluster**, you need to make `jwtSecret` the same between them. Therefore, get it first by excuting the following command on the **host cluster**. ```bash kubectl -n kubesphere-system get cm kubesphere-config -o yaml | grep -v "apiVersion" | grep jwtSecret @@ -82,11 +84,11 @@ jwtSecret: "gfIwilcc0WjNGKJ5DLeksf2JKfcLgTZU" {{< tab "KubeSphere has been installed" >}} -If you already have a standalone KubeSphere installed, you can set the value of `clusterRole` to `member` by editing the cluster configuration. You need to **wait for a while** so that the change can take effect. +If you already have a standalone KubeSphere cluster installed, you can set the value of `clusterRole` to `member` by editing the cluster configuration. -- Option A - Use Web Console: +- Option A - Use the web console: - Use `admin` account to log in the console and go to **CRDs** on the **Cluster Management** page. Enter the keyword `ClusterConfiguration` and go to its detail page. Edit the YAML of `ks-installer`, which is similar to [Enable Pluggable Components](../../../pluggable-components/). + Use the `admin` account to log in the console and go to **CRDs** on the **Cluster Management** page. Enter the keyword `ClusterConfiguration` and go to its detail page. Edit the YAML of `ks-installer`, which is similar to [Enable Pluggable Components](../../../pluggable-components/). - Option B - Use Kubectl: @@ -94,7 +96,7 @@ If you already have a standalone KubeSphere installed, you can set the value of kubectl edit cc ks-installer -n kubesphere-system ``` -Input the corresponding `jwtSecret` shown above: +In the YAML file of `ks-installer`, input the corresponding `jwtSecret` shown above: ```yaml authentication: @@ -108,24 +110,30 @@ multicluster: clusterRole: member ``` +You need to **wait for a while** so that the change can take effect. + {{}} {{< tab "KubeSphere has not been installed" >}} -There is no big difference than installing a standalone KubeSphere if you define a member cluster before installation. Please note that the `clusterRole` in `config-sample.yaml` or `cluster-configuration.yaml` has to be set as follows: +You can define a member 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 a `cluster-configuration.yaml` file. To set a member cluster, input the value of `jwtSecret` shown above and change the value of `clusterRole` to `member` before you install KubeSphere. ```yaml authentication: jwtSecret: gfIwilcc0WjNGKJ5DLeksf2JKfcLgTZU ``` -Scroll down and set the value of `clusterRole` to `member`: - ```yaml multicluster: clusterRole: member ``` +{{< notice note >}} + +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 member cluster after KubeSphere is installed. + +{{}} + {{}} {{}} @@ -136,21 +144,26 @@ You can use **kubectl** to retrieve the installation logs to verify the status b kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f ``` -### Import Cluster +## Import a Member Cluster -1. Open the H Cluster dashboard and click **Add Cluster**. - ![Add Cluster](https://ap3.qingstor.com/kubesphere-website/docs/20200827231611.png) +1. Log in the KubeSphere console as `admin` and click **Add Cluster** on the **Clusters Management** page. + + ![add-cluster](/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/direct-connection/add-cluster.png) 2. Enter the basic information of the cluster to be imported and click **Next**. - ![Import Cluster](https://ap3.qingstor.com/kubesphere-website/docs/20200827211842.png) -3. In **Connection Method**, select **Direct Connection to Kubernetes cluster**. + ![cluster-info](/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/direct-connection/cluster-info.png) -4. [Retrieve the KubeConfig](../retrieve-kubeconfig), copy the KubeConfig of the Member Cluster and paste it into the box. - {{< notice tip >}} - Please make sure the `server` address in KubeConfig is accessible on any node of the H Cluster. - {{}} - ![import a cluster - direct connection](/images/docs/direct_import_en.png) +3. In **Connection Method**, select **Direct Connection to Kubernetes cluster**, copy the KubeConfig of the member cluster and paste it into the box. -5. Click **Import** and wait for cluster initialization to finish. - ![Azure AKS](https://ap3.qingstor.com/kubesphere-website/docs/20200827231650.png) + {{< notice note >}} + +Make sure the `server` address in KubeConfig is accessible on any node of the host cluster. + + {{}} + + ![kubeconfig](/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/direct-connection/kubeconfig.jpg) + +4. Click **Import** and wait for cluster initialization to finish. + + ![cluster-imported](/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/direct-connection/cluster-imported.png) diff --git a/content/en/docs/multicluster-management/enable-multicluster/retrieve-kubeconfig.md b/content/en/docs/multicluster-management/enable-multicluster/retrieve-kubeconfig.md index e16392854..75c9beaba 100644 --- a/content/en/docs/multicluster-management/enable-multicluster/retrieve-kubeconfig.md +++ b/content/en/docs/multicluster-management/enable-multicluster/retrieve-kubeconfig.md @@ -1,18 +1,20 @@ --- title: "Retrieve KubeConfig" keywords: 'Kubernetes, KubeSphere, multicluster, hybrid-cloud, kubeconfig' -description: 'Describe how to retrieve kubeconfig from a Kuberenetes cluster' - +description: 'How to retrieve kubeconfig from a Kuberenetes cluster.' +titleLink: "Retrieve KubeConfig" weight: 5230 --- +You need to provide the kubeconfig of a member cluster if you import it using [direct connection](../direct-connection/). + ## Prerequisites You have a Kubernetes cluster. -## Explore KubeConfig File +## Get KubeConfig -Go to `$HOME/.kube`, and check the file in the directory where, normally, a file named **config** exists. Use the following command to retrieve the KubeConfig file: +Go to `$HOME/.kube`, and check the file in the directory where, normally, a file named `config` exists. Use the following command to retrieve the KubeConfig file: ```bash cat $HOME/.kube/config diff --git a/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/agent-connection/add-cluster.png b/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/agent-connection/add-cluster.png new file mode 100644 index 000000000..059f01537 Binary files /dev/null and b/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/agent-connection/add-cluster.png differ diff --git a/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/agent-connection/agent-en.png b/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/agent-connection/agent-en.png new file mode 100644 index 000000000..d81124ef2 Binary files /dev/null and b/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/agent-connection/agent-en.png differ diff --git a/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/agent-connection/cluster-imported.png b/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/agent-connection/cluster-imported.png new file mode 100644 index 000000000..b17d0575b Binary files /dev/null and b/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/agent-connection/cluster-imported.png differ diff --git a/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/agent-connection/cluster-info.png b/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/agent-connection/cluster-info.png new file mode 100644 index 000000000..ef37f3e02 Binary files /dev/null and b/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/agent-connection/cluster-info.png differ diff --git a/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/direct-connection/add-cluster.png b/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/direct-connection/add-cluster.png new file mode 100644 index 000000000..059f01537 Binary files /dev/null and b/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/direct-connection/add-cluster.png differ diff --git a/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/direct-connection/cluster-imported.png b/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/direct-connection/cluster-imported.png new file mode 100644 index 000000000..b17d0575b Binary files /dev/null and b/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/direct-connection/cluster-imported.png differ diff --git a/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/direct-connection/cluster-info.png b/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/direct-connection/cluster-info.png new file mode 100644 index 000000000..ef37f3e02 Binary files /dev/null and b/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/direct-connection/cluster-info.png differ diff --git a/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/direct-connection/kubeconfig.jpg b/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/direct-connection/kubeconfig.jpg new file mode 100644 index 000000000..188139868 Binary files /dev/null and b/static/images/docs/multicluster-management/enable-multicluster-management-in-kubesphere/direct-connection/kubeconfig.jpg differ