This document explains how to delete a shared Kubernetes cluster from a Google Distributed Cloud (GDC) air-gapped zone. Deleting a shared cluster removes all its workloads, node pools, control plane nodes, and corresponding resources within the cluster. Since a shared cluster can span multiple projects, deleting a shared cluster could affect multiple projects.
This document is for audiences such as IT administrators within the platform administrator group, who are responsible for managing container workloads within their organization. For more information, see Audiences for GDC air-gapped documentation.
Before you begin
To get the permissions needed to delete a shared cluster, ask your Organization
IAM Admin to grant you the User Cluster Admin role (user-cluster-admin). This
role is not bound to a namespace.
Delete a shared cluster and its resources
Complete the following steps to delete a shared cluster and its resources:
Console
Verify that all persistent volume claims (PVC) are deleted from your shared cluster. Due to a known issue, you can't delete a cluster with existing PVCs. For more information, see Delete persistent storage.
In the navigation menu, select Kubernetes Engine > Clusters.
In the cluster list, click the cluster that you want to delete.
Click delete Delete Cluster.
When prompted, type the given confirmation phrase and click Delete to delete the cluster.
The deletion can take up to 60 minutes.
API
Verify that all persistent volume claims (PVC) are deleted from your shared cluster. Due to a known issue, you can't delete a cluster with existing PVCs. For more information, see Delete persistent storage.
Remove the
Clustercustom resource from the GDC zone:kubectl delete clusters.cluster.gdc.goog/SHARED_CLUSTER_NAME \ -n platform \ --kubeconfig MANAGEMENT_API_SERVERReplace the following:
SHARED_CLUSTER_NAME: the name of the cluster to delete.MANAGEMENT_API_SERVER: the zonal API server's kubeconfig path where the Kubernetes cluster is hosted. If you have not yet generated a kubeconfig file for the API server in your targeted zone, see Sign in.
The deletion can take up to 60 minutes. If you want the deletion process to run in the background, append the
--wait=falseparameter to the command.
Terraform
Verify that all persistent volume claims (PVC) are deleted from your shared cluster. Due to a known issue, you can't delete a cluster with existing PVCs. For more information, see Delete persistent storage.
Remove the resource using Terraform:
terraform destroy -target kubernetes_manifest.cluster-create
The deletion can take up to 60 minutes.