Add the 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, adding a Kubernetes cluster will fail for the endpoint that is displayed on the Rancher console. Only a Kubernetes API server endpoint is supported for adding a Kubernetes cluster. The Kubernetes API server endpoint can be found in the Rancher API section.
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 viewcommand.
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, click Configure access node.