Prevent Deletion
One can prevent namespace deletion by following one of the two methods:
- Within the UI
- Within the YAML manifest
You can prevent namespace deletion, by setting the annotation "loft.sh/non-deletable" to "true" in the YAML manifest of the space instance.
apiVersion: management.loft.sh/v1
kind: SpaceInstance
metadata:
name: my-namespace
annotations:
loft.sh/non-deletable: "true"
spec:
templateRef:
name: isolated-namespace
clusterRef:
cluster: loft-cluster
Go to Projects.
Select the project and then the namespace you want to prevent deletion for.
Either click the button or click the option for the namespace you want to modify.
Navigate to Advanced section on the left.
Select the expander and enable Prevent Deletion.
Click the button to save the changes, or the button when creating a new namespace.
If you want to delete this namespace in the future, you need to remove the label either in the YAML manifest or through the toggle in the UI. Once you have done this, you can delete the namespace as usual.