Skip to main content
Version: v0.32 Stable

Deletion

Enterprise
Available in these plansFreeDevProdScale
Auto Sleep
Enterprise-Only Feature

This feature is an Enterprise feature. See our pricing plans or contact our sales team for more information.

Accidental deletion of virtual clusters is something that can not be reverted. In order to prevent deletion of virtual clusters you can either set deletion.prevent or the loft.sh/non-deletable annotation to true.

note

If you want to delete this virtual 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 virtual cluster as usual.

There are scenarios where it is desirable that virtual 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.

important

In order for auto deletion to work it requires an agent to be installed on the host cluster of the virtual cluster.

Configure​

Prevent deletion​

To prevent a virtual cluster from being deleted, add the following configuration to your vcluster.yaml:

Prevent Deletion
deletion:
prevent: true

Deletion after inactivity​

To enable automatic deletion after a certain inactivity duration, add the following configuration to your vcluster.yaml:

Automatic Deletion
deletion:
auto:
afterInactivity: 1m # Uses Go duration format

Config reference​

deletion required object ​

Deletion holds configuration for automatic vCluster deletion.

prevent required boolean ​

Prevent prevents the vCluster from being deleted

auto required object ​

Auto holds automatic deletion configuration

afterInactivity required string ​

AfterInactivity specifies after how long of inactivity the virtual cluster will be deleted. Uses Go duration format (e.g., "720h" for 30 days).