CNE GCP Ready: Configuring the Cloud Native Experience

CNE GCP Ready: Cleaning Up the Environment

Remove Cloud Native Experience (CNE) resources when you no longer need an environment to avoid unnecessary Google Cloud Platform (GCP) costs.

Warning

Manage infrastructure created through GitOps and Terraform using those workflows. Avoid modifying or deleting resources directly in the GCP console, as this can cause infrastructure state inconsistencies.

Clean up the environment in this order:

  1. Tear down managed infrastructure
  2. Tear down the CNE platform
  3. Tear down the GKE cluster

Tear Down Managed Infrastructure

Before removing the platform or cluster, delete the managed cloud resources created for your environments.

  1. If your database uses deletion protection, disable it in infrastructure.yaml:

    database:
       deletionProtection: false
    
  2. (Optional) Force-delete Cloud Storage bucket contents during teardown:

    forceDestroy: true
    

    If you do not set this option, manually remove objects from Cloud Storage buckets before deletion.

  3. Commit and push the change to your GitOps repository and allow Argo CD to synchronize the update.

  4. Disable infrastructure for the environment:

    enabled: false
    
  5. Commit and push the change.

  6. Open Argo CD and synchronize the relevant infra applications with Prune enabled.

Cloud Native Experience uses Crossplane to remove the managed infrastructure resources during this process.

Wait until Argo CD shows that all infrastructure resources are deleted.

Note

In some cases, GCP resources can remain after synchronization completes.

Verify remaining resources in the GCP console and remove them manually if necessary.

Common cases include Cloud SQL instances with deletion protection still enabled, Cloud Storage buckets that still contain objects, and KMS keys pending scheduled destruction.

Tear Down the CNE Platform

After all managed infrastructure is deleted, remove the platform resources.

  1. From the CNE project directory, run:

    cd gitops/resources
    terraform destroy --auto-approve
    
  2. After completion, remove the remaining platform components:

    cd gitops/platform
    terraform destroy --auto-approve
    

Tear Down the GKE Cluster

Finally, delete the GKE cluster:

cd gke
terraform destroy --auto-approve

After the command finishes, verify in the GCP console that the GKE cluster and related resources have been removed.