Skip to content

Uninstall / Teardown

Use this page to decommission a Nexa deployment cleanly and stop the associated cloud billing. Teardown happens in two layers: the workloads (Kubernetes objects delivered through ArgoCD/Kustomize) and the infrastructure (EKS/AKS, the application database, secret store, registry, DNS — provisioned by Terraform in your IaC repo). Remove them in order so ArgoCD doesn’t fight you by re-syncing, and so nothing is orphaned.

Nexa is customer-managed, so you run every step in your own account. DataReadyAI has no access and cannot remove anything for you.

Resource Layer Deleted by teardown? Notes
Nexa service workloads (Deployments, Services, ConfigMaps, HTTPRoutes) Kubernetes Yes Removed when the ArgoCD apps and namespaces are deleted.
ArgoCD Applications & namespaces (web-*, backend-*, databricks-*, agents-*, etc.) Kubernetes Yes Delete the App-of-Apps first to stop re-sync.
Application Postgres database (RDS on AWS / managed Postgres on Azure) Infrastructure Yes, if you destroy it Holds all Nexa metadata. Back up first.
Cloud secret-store entries (AWS Secrets Manager / Azure Key Vault) Infrastructure Yes, if you destroy it Connection creds, tokens. Export any you still need.
Raw-data lake bucket (S3 / equivalent) Infrastructure Yes, if you destroy it Landing/raw files. Preserve if you need the source data.
Container images in your registry (ECR / ACR) Infrastructure Optional Delete repos separately if you want the images gone.
EKS/AKS cluster, node groups, VPC, DNS records, certificates Infrastructure Yes, via terraform destroy This is where most ongoing billing stops.
Snowflake / Databricks warehouse and its data External account No Separate account you own; manage/retain independently.
Terraform state backend (state bucket / lock table) Infrastructure No (keep until last) Needed to run destroy; remove manually afterward if desired.
  1. Back up everything you want to keep — and verify the backups restore. Snapshot the application database, export any secret-store entries you still need, and copy out raw-lake objects you must retain. Use the procedures in the Operations Guide. Do not proceed until a test restore of the database succeeds.

  2. Stop GitOps from re-syncing. Delete the App-of-Apps so ArgoCD stops recreating workloads you are about to remove:

    Terminal window
    kubectl delete -f argocd/bootstrap/app-of-apps-prod.yaml
    # repeat for the other environments you are removing (dev/test)

    Confirm the child Applications are gone:

    Terminal window
    kubectl get applications -n argocd
  3. Delete the service namespaces. Removing each namespace drops that environment’s Deployments, Services, ConfigMaps, Secrets, and routes together:

    Terminal window
    for ns in web-prod backend-prod databricks-prod agents-prod actg-ai-prod; do
    kubectl delete namespace "$ns" --ignore-not-found=true --timeout=180s
    done

    If a namespace hangs in Terminating, a finalizer is usually waiting on an ArgoCD resource — confirm the App-of-Apps deletion in step 2 completed, then retry.

  4. Remove the platform add-ons you installed into the cluster (ArgoCD, ArgoCD Image Updater, cert-manager, the gateway/ingress, secrets-store CSI driver) if you are decommissioning the whole cluster. If you are destroying the cluster with Terraform in step 6, you can skip this — destroying the cluster removes them.

  5. Confirm the cluster is clear of Nexa workloads:

    Terminal window
    kubectl get all -A | grep -E 'nexa|actg' || echo "No Nexa workloads remaining"
  6. Destroy the infrastructure with Terraform from your IaC repo, per environment. This removes the cluster, application database, secret store, DNS, and certificates — and is where ongoing compute/database billing stops:

    Terminal window
    terraform workspace select prod
    terraform plan -destroy # review carefully — this is irreversible
    terraform destroy
  7. Delete the container-registry repositories if you want the images removed (optional; they incur only storage cost):

    Terminal window
    aws ecr delete-repository --repository-name aws-iac-nexa-databricks-api --force --region <region>
    # repeat per service repository
  8. Remove the Terraform state backend last. Once destroy has completed for all environments, delete the state bucket and lock table if you no longer need the history. Keep it until you are certain nothing else references it.

Confirm nothing is left and billing has stopped

Section titled “Confirm nothing is left and billing has stopped”
  1. Kubernetes: the cluster is gone, or kubectl get all -A | grep nexa returns nothing.

  2. Terraform: terraform state list returns empty for each destroyed workspace.

  3. Cloud console: verify no lingering EKS/AKS cluster, node groups, load balancers, database instances, buckets, or DNS records remain — orphaned load balancers and unattached volumes are the usual sources of surprise charges.

  4. Billing: check the cloud billing/cost view after 24 hours; the Nexa-tagged resources should show no new usage. Snowflake/Databricks billing is on your separate warehouse account and stops only when you pause or drop that warehouse.