Kubectl
You can access your Kubernetes cluster by using the kubectl CLI. Palette automatically generates a kubeconfig file for your cluster that you can download and use to connect with your host cluster.
Access Cluster with CLI
Use the following steps to connect to your host cluster with the kubectl CLI.
If you are using Palette Virtual Machine (VM) Management, you can find steps on how to connect to your virtual machines with the virtctl CLI in the Access VM Cluster with virtctl guide. The virtctl CLI facilitates some of the VM operations you will perform, such as copying, pasting, or transferring files to and from a virtual machine using Secure Copy Protocol (SCP).
Prerequisites
-
Kubectl installed locally. Use the Kubernetes Install Tools for additional guidance.
-
A host cluster that is either publicly accessible OR a private host cluster that has the Spectro Proxy installed.
Set up Kubectl
-
Log in to Palette.
-
Navigate to the left Main Menu and select Clusters.
-
Select the host cluster you want to access.
-
From the cluster overview page, navigate to the middle column containing cluster details and locate the Kubernetes Config File row.
-
Click on the kubeconfig link to download the file.
- Open a terminal window and set the
KUBECONFIG
environment variable to the file path of the kubeconfig file.
Example:
export KUBECONFIG=~/Downloads/dev-cluster.kubeconfig
You can now issue kubectl commands against your host cluster.
Validate
Verify you have access to your host cluster by issuing kubectl commands against it.