Import a Google GKE Cluster
- You have a Kubernetes cluster with KubeSphere installed, and prepared this cluster as the Host Cluster. For more information about how to prepare a Host Cluster, refer to Prepare a Host Cluster.
Import a GKE Cluster
You need to deploy KubeSphere on your GKE cluster first. For more information about how to deploy KubeSphere on GKE, refer to Deploy KubeSphere on GKE.
In order to manage the Member Cluster from the Host Cluster, you need to make the same between them. Therefore, get it first by executing the following command on your Host Cluster.
The output is similar to the following:
jwtSecret: "QVguGh7qnURywHn2od9IiOX6X8f8wK8g"
Log in to the KubeSphere console on GKE as
admin
. Click Platform in the upper left corner and then select Cluster Management.Go to CRDs, input
ClusterConfiguration
in the search bar, and then press Enter on your keyboard. Click ClusterConfiguration to go to its detail page.-
In the YAML file of
ks-installer
, change the value ofjwtSecret
to the corresponding value shown above and set the value ofclusterRole
to .multicluster:
Note
Make sure you use the value of your own
jwtSecret
. You need to wait for a while so that the changes can take effect.
Run the following commands on your GKE Cloud Shell Terminal:
Retrieve the new kubeconfig file by running the following command:
Log in to the KubeSphere console on your Host Cluster as
admin
. Click Platform in the upper left corner and then select Cluster Management. On the Cluster Management page, click Add Cluster.Input the basic information based on your needs and click Next.
In Connection Method, select Direct connection to Kubernetes cluster. Fill in the new kubeconfig file of the GKE Member Cluster and then click Import.
-