The Kubernetes command-line tool, *kubectl*, lets you call the underlying
Kubernetes Resource Model (KRM) APIs provided by Google Distributed Cloud (GDC) air-gapped.
You can deploy Kubernetes custom resource definitions with the kubectl CLI to
create and manage GDC service resources.

This document is for all audience groups that work on
GDC that must make API calls to manage their
air-gapped hardware and software workflows. For more information, see
[Audiences for GDC air-gapped documentation](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/resources/audiences.md.txt).

## Before you begin

Before you install the kubectl CLI, you must install and configure the
gdcloud CLI. For more information, see
[Use the gdcloud CLI](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/get-started/gdcloud.md.txt).

## Install the kubectl CLI

Complete the following steps to install the kubectl CLI in your
GDC environment:

1. Install the `kubectl` component with the gdcloud CLI:

   ```bash
   gdcloud components install kubectl
   ```
2. Verify that the kubectl CLI is installed:

   ```bash
   kubectl version
   ```

   The output is similar to the following:

       Client Version: v1.30.2-gke.1100
       Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
       Server Version: v1.30.12-gke.300

   > [!IMPORTANT]
   > **Important:** The kubectl CLI version bundled with the gdcloud CLI is sometimes not the latest version available. If you prefer a different version of the kubectl CLI, you must connect to the internet and download the version you prefer.

3. Install the `gdcloud-k8s-auth-plugin` component with the
   gdcloud CLI:

   ```bash
   gdcloud components install gdcloud-k8s-auth-plugin
   ```

After the kubectl CLI is installed, you must use the gdcloud CLI to
[generate the kubeconfig file](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/resources/gdcloud-auth.md.txt#get-kubeconfig)
for the cluster or API server that hosts your resources to give you access to
the APIs.

## What's next

- [Access zones with your tools](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/resources/multi-zone/access-zones.md.txt)
- [Sign in to projects](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/application/ao-user/iam/sign-in.md.txt)
- [GDC air-gapped APIs overview](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/apis-overview.md.txt)