Skip to main content

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.

info

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.

warning

If you are using OIDC with your host cluster, you will need the kubelogin plugin. Refer to the kubelogin GitHub repository README for installation guidance.

Set up Kubectl

  1. Log in to Palette.

  2. Navigate to the left Main Menu and select Clusters.

  3. Select the host cluster you want to access.

  4. From the cluster overview page, navigate to the middle column containing cluster details and locate the Kubernetes Config File row.

  5. Click on the kubeconfig link to download the file.

Arrow pointing to the kubeconfig file

  1. 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.