Prevent Deletion
One can prevent space deletion by following one of the two methods:
- Within the UI
- Within the YAML manifest
You can prevent space 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: VirtualClusterInstance
metadata:
name: my-vcluster
annotations:
loft.sh/non-deletable: "true"
spec:
templateRef:
name: isolated-vcluster
clusterRef:
cluster: loft-cluster
- Navigate to the Projects section using the menu on the left.
- Select the project and then the vCluster you want to prevent deletion for.
- Either click on the button or select the dropdown next to an existing virtual cluster and select the Edit option.
- Navigate to the Advanced Options 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 virtual cluster.
note
If you want to delete this virtual cluster 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 virtual cluster as usual.