Authenticate with cluster kubeconfig

Before you authenticate, review cluster access options from the console.

To access the cluster from the console with kubeconfig downloaded from the GUI:

  1. In the cluster GUI, in the upper right corner of the screen, click the arrow next to the user name. Select “Download Kubeconfig” from the drop-down list. The download will start automatically.
Screenshot

clusterconfig

The cluster kubeconfig is downloaded as clustername.conf

  1. After you download cluster kubeconfig, check the files in the ~/.kube folder from the command line.
  • If the folder does not contain a config file, move the downloaded kubeconfig to ~/.kube and rename it to config. Verify the location of the config file.
Command
# Move to ~/.kube and rename clustername.conf
mv /downloads/clustername.conf ~/.kube/config
# Verify the config location
ls ~/.kube/ | grep config

Where /downloads/clustername.conf is the path to clustername.conf downloaded from the GUI.

  • If ~/.kube already contains a config file with kubeconfig from another cluster, use one of the following approaches:

Method 1

Overwrite it with the new cluster kubeconfig.

Method 2

Export the KUBECONFIG variable to point to the new cluster kubeconfig. In this case, the other cluster’s kubeconfig remains in config.

Command to update config data
# Move to ~/.kube and rename clustername.conf
mv /downloads/clustername.conf ~/.kube/config

Where /downloads/clustername.conf is the path to clustername.conf downloaded from the GUI.

Command to export the variable
export KUBECONFIG=/root/.kube/clustername.conf

Replace /root/.kube/clustername.conf with the path to the cluster kubeconfig.

  1. Test cluster access using kubectl commands.
Example
# Test connection to the cluster
kubectl cluster-info
# List cluster nodes
kubectl get nodes

If cluster access fails, see Actions for common access errors.