Manually Delete Namespace Resources
We have a script which will delete all of the AWS resources belonging to a given namespace, by running
terraform apply with an empty
main.tf file, and then running
kubectl delete namespace.
The script will not do anything if:
a) the namespace folder exists in your local working copy of the environments repository, or
b) the namespace has
NB: You need
ruby installed, in order to use this tool.
To run the script:
populate the environment variables listed in the comment at the top of the script
cd to the root of a working copy of the environments repository
Run the script, supplying the namespace name as the only argument, e.g.
If you need to delete a production namespace, you will have to comment out the code which prevents that from happening.
That’s the code block here
If the script fails partway through, it may leave a new file in your local working copy:
If this happens, just delete the whole
namespaces/live-1.cloud-platform.service.justice.gov.uk/[namespace name]folder and re-run the script.