From 25f853cb895f325930a10513fd5057da89a38c07 Mon Sep 17 00:00:00 2001 From: Piotr Zaniewski Date: Mon, 16 Dec 2024 11:32:45 +0100 Subject: [PATCH] feat: platform uninstall command - adding the new platform destroy command - reorganizing and improving the section - helm uninstall method is left the same Signed-off-by: Piotr Zaniewski --- .../config/vocabularies/Loft/accept.txt | 3 +- platform/how-to/uninstall.mdx | 79 +++++++++++++++---- 2 files changed, 65 insertions(+), 17 deletions(-) diff --git a/.github/styles/config/vocabularies/Loft/accept.txt b/.github/styles/config/vocabularies/Loft/accept.txt index b8fef75e0..2c59ce0bc 100644 --- a/.github/styles/config/vocabularies/Loft/accept.txt +++ b/.github/styles/config/vocabularies/Loft/accept.txt @@ -11,4 +11,5 @@ AWS [Ee][Kk][Ss] GKE GCP -AKS \ No newline at end of file +AKS +CRD \ No newline at end of file diff --git a/platform/how-to/uninstall.mdx b/platform/how-to/uninstall.mdx index d62b2482a..7608ed543 100644 --- a/platform/how-to/uninstall.mdx +++ b/platform/how-to/uninstall.mdx @@ -2,40 +2,87 @@ title: Uninstall vCluster Platform sidebar_label: Uninstall vCluster Platform sidebar_position: 8 +description: Learn how to uninstall the vCluster Platform from your Kubernetes cluster using the vCluster CLI or Helm. --- -## Delete Helm Release +import VersionBadge from "@site/src/components/VersionBadge"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; -```bash -helm delete -n vcluster-platform loft +import Prerequisites from '../_partials/install/base-prerequisites.mdx'; + + +This guide provides instructions on how to uninstall the platform from your Kubernetes cluster. + +:::warning +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 + + + +## Uninstall + +There are two ways to uninstall the platform. + + + + + +### Delete the platform + +Note that the +[VirtualClusterInstances](/platform/api/resources/virtualclusterinstance/virtualclusterinstance) +CDRs 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: + +```bash title="Delete the platform using vCluster CLI" +vcluster destroy platform ``` -Please make sure you also uninstall kiosk, if you have connected the loft cluster: + + -```bash -helm delete -n vcluster-platform loft-agent +### Delete Helm release + +```bash title="Delete the platform Helm release" +helm delete -n vcluster-platform loft ``` -## Delete Namespace (optional) +Ensure you also uninstall kiosk if you have connected the loft cluster: -```bash -kubectl delete ns vcluster-platform +```bash title="Delete the Kiosk Helm release" +helm delete -n vcluster-platform loft-agent ``` -If you have deleted the namespace **without** deleting the vcluster-platform and loft-agent helm releases beforehand, please make sure the api-services and webhooks are deleted correctly: +### Delete namespace (optional) -```bash -# vCluster Platform agent api service and webhook +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: + +```bash title="Delete API service and webhook" kubectl delete apiservice v1.cluster.loft.sh kubectl delete validatingwebhookconfiguration loft-agent ``` -## Delete CRDs (optional) +### Delete CRDs (optional) -```bash +```bash title="Delete platform CRDs" kubectl api-resources --api-group='storage.loft.sh' -o name | xargs kubectl delete crd ``` -:::warning Data Loss -Deleting the vCluster Platform CRDs will also remove all vCluster Platform objects inside your cluster, e.g. `Cluster`, `Team`, and `User`. This **cannot** be undone. +:::warning +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](/platform/use-platform/troubleshooting/troubleshooting) +section for assistance.