Skip to content

Commit

Permalink
feat: platform uninstall command
Browse files Browse the repository at this point in the history
- adding the new platform destroy command
- reorganizing and improving the section
- helm uninstall method is left the same

Signed-off-by: Piotr Zaniewski <[email protected]>
  • Loading branch information
Piotr1215 committed Dec 16, 2024
1 parent d315f22 commit d545b07
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .github/styles/config/vocabularies/Loft/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ AWS
[Ee][Kk][Ss]
GKE
GCP
AKS
AKS
CRD
87 changes: 71 additions & 16 deletions platform/how-to/uninstall.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,95 @@
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

<Prerequisites />

## Uninstall

There are two ways to uninstall the platform.

<Tabs>
<TabItem value="Using vCluster CLI">
<VersionBadge version="v4.3" />

### Delete the platform

Note that the
[VirtualClusterInstances](/platform/api/resources/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:
:::info
The command does the following:
- Uninstalls Helm releases related to Loft.
- Deletes CustomResourceDefinitions (CRDs).
- Optionally deletes when the `--delete-namespace` flag is provided.
- Removes default cluster roles and cluster role bindings.
:::

```bash
helm delete -n vcluster-platform loft-agent
</TabItem>
<TabItem value="Using Helm">

### 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)

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
# vCluster Platform agent api service and webhook
```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.
:::

</TabItem>

</Tabs>

## Troubleshooting

If a resource is stuck or encounters an error during deletion, refer to the
[troubleshooting](/platform/use-platform/troubleshooting)
section for assistance.

0 comments on commit d545b07

Please sign in to comment.