- /rancher/v2.x/en/tasks/clusters/import-cluster/
You can import an existing Kubernetes cluster and then manage it using Rancher.
Prerequisites:
- If your existing Kubernetes cluster already has a
cluster-adminrole defined, you must have thiscluster-adminprivilege to import the cluster into Rancher. In order to apply the privilege, you need to runkubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user [USER_ACCOUNT]before running thekubectlcommand to import the cluster.- By default, GKE users are not given this privilege, so you will need to run the command before importing GKE clusters. To learn more about GKE RBAC, please click here.
-
From the Clusters page, click Add Cluster.
-
Choose Import.
-
Enter a Cluster Name.
-
{{< step_create-cluster_member-roles >}}
-
Click Create.
-
Copy the first command displayed to your clipboard.
-
Log into one of your cluster nodes using your preferred shell, such as PuTTy or a remote Terminal connection. Run the command copied to your clipboard.
-
If you receive a message of
certificate signed by unknown authority, copy the second command displayed in {{< product >}} to your clipboard. Then run the command on your cluster node. -
When you finish running the command(s) on your Linux host(s), click Done.
{{< result_create-cluster >}}
Note: You can not re-import a cluster that is currently active in a Rancher setup.