Skip to content

Commit 0c311fa

Browse files
committed
Add notes on deleting an operator CR
This commit introduces documentation detailing how to delete an operator CR. Signed-off-by: Alexander Greene <[email protected]>
1 parent 50cf7e0 commit 0c311fa

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

content/en/docs/Tasks/uninstall-operator.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,17 @@ kubectl delete csv $CSV -n <namespace>
6767
## Step 4: Deciding whether or not to delete the CRDs and APIServices
6868

6969
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.
70+
71+
## Step 5: Deleting the Operator CR
72+
73+
OLM recently introduced the view-only [operator CRD](https://github.com/operator-framework/api/blob/7339a22050af53df7b6f97a652b8e2d73698765a/crds/operators.coreos.com_operators.yaml) which communicates the list of resources associated with an operator installed by OLM. When installing an operator, OLM will create an `operator` CR named:
74+
- `<packageName>` if the operator is All Namespaced scoped.
75+
- `<packageName>.<Namespace>` if the operator is not All Namespaced scoped.
76+
77+
OLM will then the update the `operator CR's status.Components` array to include any resources associated with the operator. Let's consider OLM's behavior after creating the `operator` CR named `foo`:
78+
- All resources associated with the `foo operator` CR will have the `operators.coreos.com/foo` label applied to it.
79+
- OLM will create or recreate the `foo operator` CR if any resources exist with the `operators.coreos.com/foo` label.
80+
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, an `operator` CR can be deleted after completing steps 1 through 4 above. However, if a user is still unable to delete an operator, they should:
82+
- Delete each resource found in the `operator CR's status.Components` array. Alternatively, if you have deleted the operator's CSV and Subscription you may remove the `operators.coreos.com/foo` label from any resources you do not wish to delete.
83+
- Delete the `ofoo perator` CR.

0 commit comments

Comments
 (0)