Deletion
| Enterprise | ||||
|---|---|---|---|---|
| Available in these plans | Free | Dev | Prod | Scale |
| Auto Sleep | ||||
This feature is an Enterprise feature. See our pricing plans or contact our sales team for more information.
Accidental deletion of tenant clusters is something that can not be reverted. In order to prevent deletion of tenant clusters you can either set deletion.prevent or the loft.sh/non-deletable annotation to true.
If you want to delete this tenant cluster in the future, you need to either toggle deletion.prevent to false, remove the annotation in the YAML manifest or through the toggle in the UI.
Once you have done this, you can delete the tenant cluster as usual.
There are scenarios where it is desirable that tenant clusters are automatically deleted after a certain inactivity duration. This could be after firing up single-shot batch jobs or more generally not having to remember cleaning things up afterwards.
You can enable automatic deletion by configuring deletion.auto accordingly.
In order for auto deletion to work it requires an agent to be installed on the control plane cluster of the tenant cluster.
Configure​
- vcluster.yaml
- Platform UI
- Platform CRDs
Prevent deletion​
To prevent a tenant cluster from being deleted, add the following configuration to your vcluster.yaml:
deletion:
prevent: true
Deletion after inactivity​
To enable automatic deletion after a certain inactivity duration, add the following configuration to your vcluster.yaml:
deletion:
auto:
afterInactivity: 1m # Uses Go duration format
From the project drop-down menu (top left corner), select the project you'd like to create the tenant cluster in.
Click on Virtual Clusters.
Click on Edit on the tenant cluster that you want to edit.
Select the expander and toggle the Prevent Deletion slider accordingly or configure an inactivity duration (Sleep After Inactivity) for auto deletion.
Click on the button to save the changes.
You can prevent tenant cluster deletion, by setting the annotation loft.sh/non-deletable: "true" in the YAML manifest of the tenant cluster 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-clusterth