Configure automatic deletion
This feature is an Enterprise feature. See our pricing plans or contact our sales team for more information.
Tenant clusterTenant clusterA fully isolated Kubernetes environment provisioned for a single tenant. Each tenant cluster has its own API server, controller manager, and resource namespace, backed by a virtualized control plane hosted on a control plane cluster. From the tenant's perspective it behaves exactly like a standard Kubernetes cluster. deletion can't be undone. To prevent deletion, set
deletion.prevent or the loft.sh/non-deletable annotation to true.
To delete this tenant cluster later, reverse whichever setting you used: set
deletion.prevent to false, or remove the loft.sh/non-deletable annotation.
Then delete the cluster as usual.
Configure deletion.auto to automatically delete a tenant cluster after a
period of inactivity. This is useful for cleanup after single-shot batch jobs,
so you don't have to delete the cluster manually.
Automatic deletion requires an agent installed on the control plane clusterControl plane clusterThe Kubernetes cluster that hosts the virtualized control planes for tenant clusters. The control plane cluster is operated by the platform provider and is completely invisible to tenants. There are no shared control plane nodes, no in-cluster agent pods, and no lateral path between tenant environments. With shared nodes, this cluster also runs tenant workloads alongside the control plane pods — the same node pool is used for both..
Configure deletion​
- vcluster.yaml
- Platform UI
- Custom Resource
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
- Select the project that contains the tenant cluster.
- Click Tenant Clusters in the sidebar.
- Click Edit for the tenant cluster.
- Expand Auto-Sleep and Auto-Delete.
- Enable Prevent Deletion, or set Delete after inactivity to configure automatic deletion.
- Click Save.
For a tenant cluster created from a template, edit the template instead of the instance.
You can prevent tenant cluster deletion by setting the annotation loft.sh/non-deletable: "true" on the tenant cluster instance's YAML manifest.
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