Clean up regionΒΆ
Make sure that there are no more resources running in the Kubernetes cluster. The fastest way to check is by either querying
core.projectson the database or by usingcroud projects list --region {region} --sudo.SELECT * FROM core.projects WHERE region = '{region}' AND is_deleted = FALSE;
Warning
If there are still projects, make sure they are deleted using
croudfirst! This will ensure that there are no dangling resources in the database thereafter.Remove all available products of the specific region by connecting to Brain and running the
DELETEstatement:DELETE FROM core.product_availability WHERE region = '{region}';
Remove the region by connecting to Brain and running the
DELETEstatement after making sure that there are no more projects in this region:DELETE FROM core.regions WHERE name = '{region}';
In case the region (Kubernetes cluster) is part of the Crate.io infrastructure, tear it down.
Remove related secrets from Vault:
$ REGION="{region}" $ CUSTOMER_ID="{customer}" $ ENV="ext" $ vault kv get "crate/infra/pillar/application/cloud_app/$ENV/service-principals/$REGION" $ vault kv delete "crate/infra/pillar/application/cloud_app/$ENV/service-principals/$REGION" $ vault kv get "/crate/apps/$ENV/cloud-agent/basicauth/$REGION" $ vault kv delete "/crate/apps/$ENV/cloud-agent/basicauth/$REGION" $ vault kv get "/crate/infra/pillar/application/cratedb/$ENV/external-dns/$REGION" $ vault kv delete "/crate/infra/pillar/application/cratedb/$ENV/external-dns/$REGION" $ vault kv get "/crate/infra/pillar/common/docker/registries/cr8cloud/$REGION" $ vault kv delete "/crate/infra/pillar/common/docker/registries/cr8cloud/$REGION" $ vault kv get "/crate/infra/pillar/customer/$CUSTOMER_ID/$REGION" $ vault kv delete "/crate/infra/pillar/customer/$CUSTOMER_ID/$REGION" $ vault kv get "/crate/infra/pillar/application/cratedb/$ENV/keystore/$REGION" $ vault kv delete "/crate/infra/pillar/application/cratedb/$ENV/keystore/$REGION"
Remove related keys from Vault:
Path: /crate/infra/pillar/cr8/spn Key:
docker-cloud-$ENV-${REGION//./-}Go to AWS Route53 and delete all
AandTXTrecords created by K8s servicesDestroy the Terraform state of the region in the crate/salt repo and remove the module from
regions.tfandoutputs.tf.$ cd terraform/cratedb-cloud/ $ terraform destroy -target module.{region} $ vim regions.tf # remove region $ vim outputs.tf # remove outputs