Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation around CRD removal #3422

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions docs/hugo/content/guide/uninstalling.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,34 @@ Before you uninstall Azure Service Operator, ensure that all of the resources ma
Use the [detach-on-delete reconcile-policy annotation]( {{< relref "annotations#serviceoperatorazurecomreconcile-policy" >}} )
if you want to delete an ASO resource from Kubernetes but retain it in Azure.

You can check if all ASO resources have been deleted by using: `kubectl api-resources -o name | grep azure.com | paste -sd "," - | xargs kubectl get -A`
You can check if all ASO resources have been deleted:

```
kubectl api-resources -o name | grep azure.com | paste -sd "," - | xargs kubectl get -A
``````

## Uninstalling

We recommend that you uninstall ASO using the same mechanism you used to install it.

### Uninstalling with Helm

> **Warning**: This command will also remove installed ASO CRDs. As mentioned [above](#before-you-uninstall) it is strongly recommended that you
> ensure that there are no remaining ASO resources in the cluster before you run this command.

As mentioned [above](#before-you-uninstall) it is strongly recommended that you
ensure that there are no remaining ASO resources in the cluster before you run this command.

```bash
helm --namespace azureserviceoperator-system delete asov2
kubectl delete namespace azureserviceoperator-system
```

### Uninstalling with kubectl
Note that Helm does not remove CRDs, due to the potential for user data-loss. The Helm documentation reads:

> **Warning**: This command will also remove installed ASO CRDs. As mentioned [above](#before-you-uninstall) it is strongly recommended that you
> ensure that there are no remaining ASO resources in the cluster before you run this command.
> There is no support at this time for upgrading or deleting CRDs using Helm. This was an explicit decision after much community discussion due to the danger for unintentional data loss.

-- Retrieved from [**helm.sh**](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/) on Monday, 16 October 2023
theunrepentantgeek marked this conversation as resolved.
Show resolved Hide resolved

### Uninstalling with kubectl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this, wonder if we should have a ### Uninstalling the CRDs section, which explains that:

  1. Neither of the above commands for Helm or kubectl will uninstall the CRDs, nor automatically delete any Custom Resource instances.
  2. Uninstalling the CRDs is dangerous (risk of data loss), and should only be done on a cluster that has ASO already uninstalled via one of the above methods and no existing instances of the CRDs. This can be verified by running the (somewhat slow to execute): kubectl api-resources -o name | grep azure.com | paste -sd "," - | xargs kubectl get -A
  3. Deleting the CRDs can be accomplished by running kubectl delete -f https://github.com/Azure/azure-service-operator/releases/download/v2.3.0/azureserviceoperator_customresourcedefinitions_v2.3.0.yaml

I don't have a Windows version of the command for kubectl api-resources -o name | grep azure.com | paste -sd "," - | xargs kubectl get -A, and there might be a better command for it... I will play around and see if I can find one... but that one is better than what we have currently so might be worth including.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a warning section; we can add specific commands in a later PR.


```bash
kubectl delete -f https://github.com/Azure/azure-service-operator/releases/download/v2.0.0/azureserviceoperator_v2.0.0.yaml
theunrepentantgeek marked this conversation as resolved.
Show resolved Hide resolved
Expand Down