Access kubectl from terminal after installing Rancher in a container

After following the “Manual Quick Start” which created the local Rancher/Kubernetes cluster, I created a second cluster (cluster01) using step 4 of the same tutorial. Cluster01 has 2 nodes.

I can access kubectl in the browser from the Rancher menu but how do I access kubectl from a terminal connected to one of the cluster nodes. Guessing I have to install kubectl but then how do I configure it to access the cluster directly?

Thanks for any insight from the community!!!

kubectl requires a KUBECONFIG file which contains connection details and credentials for one or more clusters.

You can download a kubeconfig file for your target cluster in Rancher’s Cluster Manager (top right in the cluster dashboard page). This can be applied in a number of ways, best to search to find the best one for your use case.

@RichardC, thank you for the information. That got me going in the right direction.

Looks like it is as simple as downloading kubectl for your version of kubernetes and then creating a config file (which as you said, Rancher provides).

I also found a couple good articles on setting up kubectl.
Rancher: How to Manage Kubernetes With Kubectl
Kubernetes: Install and Set Up kubectl on Linux | Kubernetes