This document explains how to delete a standard Kubernetes cluster from a
Google Distributed Cloud (GDC) air-gapped zone. Deleting a standard cluster removes all its
workloads, node pools, control plane nodes, and corresponding resources within
the cluster. Since a standard cluster is confined to a single project, the
deletion doesn't affect any other projects.

This document is for audiences such as application developers within the application
operator group, who are responsible for managing container workloads within
their organization. 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

To delete a standard cluster, ask your IAM Project Admin to grant you the
**Standard Cluster Admin** (`standard-cluster-admin`) role. This role is bound
to your project namespace. For more information, see
[Manage access to standard clusters](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/application/ao-user/iam/standard-clusters.md.txt).

## Delete a standard cluster and its resources

Complete the following steps to delete a shared cluster and its resources:

### Console

> [!IMPORTANT]
> **Important:** The GDC console supports standard cluster deletion in GDC air-gapped 1.16.2+.

1. In the [project picker](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/platform/pa-user/manage-projects.md.txt#select-project),
   select your project.

   Standard clusters are project-scoped resources. If you select an
   organization instead, you'll view shared clusters, which are
   organization-scoped. For more information, see the
   [resource hierarchy](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/resources/resource-hierarchy.md.txt#cluster).
2. In the navigation menu, select **Kubernetes Engine \> Clusters**.

3. In the cluster list, click the cluster that you want to delete.

4. Click delete **Delete
   Cluster**.

5. When prompted, type the given confirmation phrase and click **Delete** to
   delete the cluster.

   The deletion can take up to 45 minutes.

### API

1. Verify that all persistent volume claims (PVC) are deleted from your standard
   cluster. For more information, see
   [Delete persistent storage](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/application/ao-user/containers/delete-persistent-storage.md.txt).

2. Remove the `Cluster` custom resource from the GDC
   zone:

   ```bash
   kubectl delete clusters.cluster.gdc.goog/STANDARD_CLUSTER_NAME \
       --namespace PROJECT_NAME \
       --kubeconfig MANAGEMENT_API_SERVER
   ```

   The deletion can take up to 45 minutes. If you want the deletion process
   to run in the background, append the `--wait=false` parameter to the
   command.

   Replace the following:
   - `STANDARD_CLUSTER_NAME`: the name of the cluster to delete.
   - `PROJECT_NAME`: the name of the project that manages the cluster.
   - `MANAGEMENT_API_SERVER`: the zonal API server's kubeconfig path where the cluster is hosted. If you have not yet generated a kubeconfig file for the management API server in your targeted zone, see [Sign in](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/platform/pa-user/iam/sign-in.md.txt#zonal-resources-kubeconfig).

### Terraform

1. Verify that all persistent volume claims (PVC) are deleted from your standard
   cluster. For more information, see
   [Delete persistent storage](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/application/ao-user/containers/delete-persistent-storage.md.txt).

2. Remove the resource using Terraform:

   ```bash
   terraform destroy -target kubernetes_manifest.cluster-create
   ```

   The deletion can take up to 45 minutes.

## What's next

- [Kubernetes cluster overview](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/platform/pa-user/clusters.md.txt)
- [Design access boundaries](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/resources/access-boundaries.md.txt)
- [Design workload separation](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/resources/workload-separation.md.txt)