Local Kubectl Setup

Setup kubectl and kubeconfig on your local computer

kubectl is the command-line tool used to interact with Kubernetes clusters. It allows you to deploy applications, inspect and manage cluster resources, and troubleshoot issues directly from your terminal. This setup guide will walk you through installing kubectl on your computer, downloading the kubeconfig file, and configuring kubectl for your environment.

Installing kubectl

Install kubectl on your local computer:

  1. Use these tools to install kubectl locally.

  2. Run these commands to enable kubectl to use the downloaded kubeconfig.

For Linux or macOS

export KUBECONFIG=/home/duplo/duploinfra-INFRASTRUCTURE_NAME.yaml # INFRASTRUCTURE_NAME is your DuploCloud Infrastructure name.

For Windows

setx KUBECONFIG "%USERPROFILE%\Downloads\duploinfra-INFRASTRUCTURE_NAME.yaml" # INFRASTRU

Downloading kubeconfig

The kubeconfig file is a configuration file used by kubectl to connect to a Kubernetes cluster. It contains essential information such as the cluster's API server address, authentication credentials, and context settings that define which cluster and namespace kubectl should interact with. Refer to this article for more information about kubeconfig. Download kubeconfig one of two ways: using duploctl or from within the DuploCloud Portal:

Downloading kubeconfig using duploctl

To download kubeconfig using duploctl, follow these instructions.

Downloading kubeconfig from the DuploCloud Portal

  1. In the DuploCloud Portal, navigate to Administrators -> Infrastructure.

  2. In the NAME column, select the Infrastructure where you want to set up kubectl.

  3. Click the EKS (for AWS), GKE (for GCP), or the AKS (for Azure) tab. The Download Kubeconfig For Plan pane displays.

  4. Click Download Kubeconfig to download the kubeconfig file.

If you don't have Administrator access, you can use duplo-jit to access Kubernetes. When you click Download kubeconfig, the Access to Kubernetes from your Workstation window gives you the option to install duplo-jit to access your Kubernetes cluster without obtaining permanent access keys.

Last updated

Logo

© DuploCloud, Inc. All rights reserved. DuploCloud trademarks used herein are registered trademarks of DuploCloud and affiliates