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
Navigate to the Projects section using the menu on the left.
Select the project and then the namespace you want to prevent deletion for.
Either click on the button or select the dropdown next to an existing namespace and select the Edit option.
Navigate to Advanced section on the left.
Select the
expander and tick the "enable deletion prevention" checkbox.Click on 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.