Uninstall vCluster Platform
This guide provides instructions on how to uninstall the platform from your Kubernetes cluster.
This action is performed against the cluster the kube-context is pointing to, not the platform instance that is logged in. It does not require logging in to the platform.
Prerequisites​
-
Administrator access to a Kubernetes cluster: See Accessing Clusters with kubectl for more information. Your current kube-context must have administrative privileges, which you can verify with
kubectl auth can-i create clusterrole -A
infoTo obtain a kube-context with admin access, ensure you have the necessary credentials and permissions for your Kubernetes cluster. This typically involves using
kubectl config
commands or authenticating through your cloud provider's CLI tools. -
helm
installed: Helm v3.10 is required for deploying the platform. Refer to the Helm Installation Guide if you need to install it. -
kubectl
installed: Kubernetes command-line tool for interacting with the cluster. See Install and Set Up kubectl for installation instructions.
Uninstall​
There are two ways to uninstall the platform.
- Using vCluster CLI
- Using Helm
Delete the platform​
Note that the VirtualClusterInstances CRDs managed with driver Helm are deleted, but the underlying virtual clusters are not uninstalled.
On the Kubernetes cluster where the platform is installed, and all connected clusters, run:
vcluster platform destroy
The command does the following:
- Uninstalls Helm releases related to Loft.
- Deletes CustomResourceDefinitions (CRDs) created by the platform.
- Optionally deletes the namespace where the platform is installed when the
--delete-namespace
flag is provided. - Removes cluster roles and cluster role bindings created by the platform.
In order to force delete all the platform resources, you can use the flag --force-remove-finalizers
. This will remove the
finalizers from the resources, forcing the platform resources to be deleted immediately.
vcluster platform destroy --force-remove-finalizers
Removing finalizers may cause unintended behaviours like leaving some resources behind, but will ensure the platform is uninstalled.
Delete Helm release​
helm delete -n vcluster-platform loft
Delete namespace (optional)​
Deleting the namespace ensures that all resources associated with the platform are removed. If you have deleted the namespace without deleting the vcluster-platform and loft-agent Helm releases beforehand, ensure the api-services and webhooks are deleted correctly:
kubectl delete apiservice v1.cluster.loft.sh
kubectl delete validatingwebhookconfiguration loft-agent
Delete CRDs (optional)​
kubectl api-resources --api-group='storage.loft.sh' -o name | xargs kubectl delete crd
Deleting the platform CRDs will also remove all platform objects inside your cluster, such as Cluster, Team, and User. This action cannot be undone.
Troubleshooting​
If a resource is stuck or encounters an error during deletion, refer to the troubleshooting section for assistance.