You can add a Kubernetes cluster. If you want to access the cluster using a different set of credentials, add the cluster again with the different credentials.
In Rancher-managed environments, use the Kubernetes API server endpoint that is mentioned in the Rancher API section.
You can add multiple Kubernetes clusters with the same kube-apiserver endpoint and/or service account, but with different names.
Procedure
-
From the navigation pane, go to Protect > Kubernetes.
The Clusters page appears.
-
Click Add cluster.
The Add cluster page appears.
-
In the API server endpoint box, enter the API server endpoint URL.
Typically, the URL is https://kube-apiserver:kube-apiserver_port_number. If you do not know the URL, you can use the
kubectl config view
command. -
In the Name box, type a name for the cluster.
-
Select the authentication method:
-
Service account: Enter the Kubernetes service account name, and then copy the token into the Service token box.
A Kubernetes service account that is used to access Kubernetes must have the cluster admin role assigned.
-
User name and password: Enter the user name and password.
-
-
From the Access node list, select the access node to use for the cluster.
To configure a new access node for the cluster, see Add Access Nodes.
-
Click Save.