Skip to main content

Removing an unneeded namespace

When you have finished with a namespace, please clean it up (i.e. remove it).

This helps to keep the cloud platform repositories well-organised, and speeds up deployments and changes to the cluster (because the build process doesn’t have to spend time managing unnecessary resources). It also deletes the associated AWS resources, and helps to keep our hosting costs down.

To delete a namespace and all its associated AWS resources, simply raise a PR which deletes the associated folder from the cloud-platform-environments.

So, if your namespace is called mynamespace, then you need to raise a PR deleting the folder:

 namespaces/live.cloud-platform.service.justice.gov.uk/mynamespace

…and all its contents, from the cloud-platform-environments repository.

Merging this PR will trigger the destroy-deleted-namespaces Pipeline, which will delete all of your non production (with namespace annotation “cloud-platform.justice.gov.uk/is-production = false”) namespace’s AWS resources, followed by the namespace itself, for production namespaces cloud-platform team will get an alert to manually delete the namespace.

NB: If you have set up a CI/CD pipeline, which deploys into your namespace, then this should be deleted first, so that anything you delete later is not immediately recreated by your build pipeline.

This page was last reviewed on 1 March 2023. It needs to be reviewed again on 1 June 2023 .
This page was set to be reviewed before 1 June 2023. This might mean the content is out of date.