Delete vclusters
- vcluster
- helm
- kubectl
# switch the kube context back
vcluster disconnect
# OR: switch context back and delete vcluster
vcluster delete my-vcluster
helm delete my-vcluster -n vcluster-my-vcluster --repository-config=''
The easiest option to delete a virtual cluster using kubectl
is to delete the host namespace:
kubectl delete namespace vcluster-my-vcluster
In case you have multiple vclusters or any other resources in this namespace, you can also just delete the vcluster-related resources:
kubectl delete -n vcluster-my-vcluster serviceaccount vcluster-1
kubectl delete -n vcluster-my-vcluster role vcluster-1
kubectl delete -n vcluster-my-vcluster rolebinding vcluster-1
kubectl delete -n vcluster-my-vcluster service vcluster-1
kubectl delete -n vcluster-my-vcluster service vcluster-1-headless
kubectl delete -n vcluster-my-vcluster statefulset vcluster-1
Resources inside vclusters
Deleting a vcluster will also delete all objects within and all state related to the vcluster.