You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/Tasks/uninstall-operator.md
+8-7Lines changed: 8 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -6,17 +6,17 @@ description: >
6
6
Uninstall your operator from the cluster
7
7
---
8
8
9
-
When uninstalling an operator managed by OLM, a Cluster Admin must decide whether or not to remove the CustomResourceDefinitions (CRD), APIServices, and resources related to these types owned by the operator. By design, when OLM uninstalls an operator it does not remove any of the operator's owned CRDs, APIServices, or CRs in order to prevent data loss. Instead, it is left to the Cluster Admin to remove any unwanted types and resources from the cluster. This document will discuss the steps a Cluster Admin should take when uninstalling an operator.
9
+
When uninstalling an operator managed by OLM, a Cluster Admin must decide whether or not to remove the `CustomResourceDefinitions (CRD)`, `APIServices`, and resources related to these types owned by the operator. By design, when OLM uninstalls an operator it does not remove any of the operator's owned `CRDs`, `APIServices`, or `CRs` in order to prevent data loss. Instead, it is left to the Cluster Admin to remove any unwanted types and resources from the cluster. This document will discuss the steps a Cluster Admin should take when uninstalling an operator.
10
10
11
11
## Step 1: Identifying Resources to Remove
12
12
13
-
The cluster admin should first understand which types (CRDs and APIServices) are owned by the operator, which is available in the operator's ClusterServiceVersion (CSV) under the `spec.customresourcedefinitions.owned` and `spec.apiservicedefinitions.owned` arrays. It is likely that users have created resources for these types since the operator was installed. The cluster admin should should decide which of these resources to delete on a case-by-case basis. If the resource is not required, delete it. The Cluster Admin should delete all unwanted resources before moving to the next step.
13
+
The cluster admin should first understand which types (`CRDs` and `APIServices`) are owned by the operator, which is available in the operator's `ClusterServiceVersion (CSV)` under the `spec.customresourcedefinitions.owned` and `spec.apiservicedefinitions.owned` arrays. It is likely that users have created resources for these types since the operator was installed. The cluster admin should should decide which of these resources to delete on a case-by-case basis. If the resource is not required, delete it. The Cluster Admin should delete all unwanted resources before moving to the next step.
14
14
15
-
> Note: Although deleting the CRD or APIService removes all resource of the type from the cluster, this action may lead to unintended consequences. Operators often use [finalizers](https://book.kubebuilder.io/reference/using-finalizers.html) to execute application specific cleanup routines before removing the CR. If the API is removed, the operator will be unable to properly remove the resource, and the cluster may appear to be "stuck" as defined in this [Kubernetes issue](https://github.com/kubernetes/kubernetes/issues/60807).
15
+
> Note: Although deleting the `CRD` or `APIService` removes all resource of the type from the cluster, this action may lead to unintended consequences. Operators often use [finalizers](https://book.kubebuilder.io/reference/using-finalizers.html) to execute application specific cleanup routines before removing the `CR`. If the API is removed, the operator will be unable to properly remove the resource, and the cluster may appear to be "stuck" as defined in this [Kubernetes issue](https://github.com/kubernetes/kubernetes/issues/60807).
16
16
17
17
## Step 2: Unsubscribe from the Operator
18
18
19
-
OLM uses the subscription resource to convey a user's intent to subscribe to the latest version of an operator. If the operator was installed with Automatic Updates (spec.InstallPlanApproval: `Automatic`), OLM will reinstall a new version of the operator even if the operator's CSV was deleted earlier. In effect, you must tell OLM that you do not want new versions of the operator to be installed by deleting the subscription associated with the operator.
19
+
OLM uses the `Subscription` resource to convey a user's intent to subscribe to the latest version of an operator. If the operator was installed with Automatic Updates (`spec.InstallPlanApproval: "Automatic"`), OLM will reinstall a new version of the operator even if the operator's `CSV` was deleted earlier. In effect, you must tell OLM that you do not want new versions of the operator to be installed by deleting the `Subscription` associated with the operator. It should be noted that opting out of future upgrades by deleting a `Subscription` does not delete the associated `CSV` as this ensures that a specific version of the operator is available on cluster and is never upgraded.
20
20
21
21
You can list existing `Subscription` in a specific namespace with the following `kubectl` command:
22
22
@@ -27,7 +27,7 @@ NAME PACKAGE SOURCE
27
27
foo-sub foo foo-catalog alpha
28
28
```
29
29
30
-
> Note: The name of the operator installed by the subscription is available under the `Package` column.
30
+
> Note: The name of the operator installed by the `Subscription` is available under the `Package` column.
31
31
32
32
The `Subscription` can be deleted by running this command:
## Step 3: Delete the Operator's ClusterServiceVersion (CSV)
39
39
40
-
The CSV contains all the information that OLM needs to manage an operator, and it effectively represents an operator that is installed on cluster. By deleting a `ClusterServiceVersion`, OLM will delete the resources it created for the operator such as the deployment, RBAC, and any corresponding CSVs that OLM "Copied" into other namespaces watched by the operator.
40
+
The `CSV` contains all the information that OLM needs to manage an operator, and it effectively represents an operator that is installed on cluster. By deleting a `CSV`, OLM will delete the resources it created for the operator such as the `deployment`, `RBAC`, and any corresponding `CSVs` that OLM "Copied" into other namespaces watched by the operator.
41
41
42
42
If you wish to look up a list of `ClusterServiceVersion` in a specific namespace to see which `ClusterServiceVersion` you need to delete, you can use the example `kubectl` command:
## Step 4: Deciding whether or not to delete the CRDs and APIServices
68
68
69
-
The final step consists of deciding whether or not to delete the CRDs and APIServices that were introduced to the cluster by the operator. Assuming you have already deleted all unwanted resources on cluster as enumerated in Step 1, if no resources remain it is safe to remove the CRD or APISerivces. Otherwise, you should not delete the type as the wanted resources will be deleted automatically when the CRD or APISerivce is deleted.
69
+
The fourth step consists of deciding whether or not to delete the `CRDs` and `APIServices` that were introduced to the cluster by the operator. Assuming you have already deleted all unwanted resources on cluster as enumerated in Step 1, if no resources remain it is safe to remove the `CRD` or `APISerivces`. Otherwise, you should not delete the type as the wanted resources will be deleted automatically when the CRD or `APISerivce` is deleted.
70
70
71
71
## Step 5: Deleting the Operator CR
72
72
@@ -81,3 +81,4 @@ OLM will then the update the [operator's status.Components.Refs](https://github.
81
81
This ultimately means that in order to delete the `foo operator` CR, users will need to ensure that no resources are labeled with the `operators.coreos.com/foo` label. Typically, OLM should not attempt to recreate the `foo operator` after a user deletes it if they have completed steps 1 through 4 above. However, if OLM is still recreating the `foo operator`, a user should:
82
82
- Delete each resource found in the `foo operator's status.Components.Refs` array. Alternatively, if you have deleted the `foo operator's CSV` and `Subscription` you may remove the `operators.coreos.com/foo` label from any resources you do not wish to delete.
83
83
- Delete the `foo operator` CR.
84
+
The final step consists of deciding whether or not to delete the `CRDs` and `APIServices` that were introduced to the cluster by the operator. Assuming you have already deleted all unwanted resources on cluster as enumerated in Step 1, if no resources remain it is safe to remove the `CRD` or `APISerivces`. Otherwise, you should not delete the type as the wanted resources will be deleted automatically when the `CRD` or `APISerivce` is deleted.
0 commit comments