Skip to content

Commit 322cc15

Browse files
committed
Add Operator deletion/reinstall guidance & warnings
1 parent 4ed0799 commit 322cc15

File tree

3 files changed

+123
-2
lines changed

3 files changed

+123
-2
lines changed

modules/olm-reinstall.adoc

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * support/troubleshooting/troubleshooting-operator-issues.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="olm-reinstall_{context}"]
7+
= Reinstalling Operators after failed uninstallation
8+
9+
You must successfully and completely uninstall an Operator prior to attempting to reinstall the same Operator. Failure to fully uninstall the Operator properly can leave resources, such as a project or namespace, stuck in a "Terminating" state and cause "error resolving resource" messages. For example:
10+
11+
.Example `Project` resource description
12+
----
13+
...
14+
message: 'Failed to delete all resource types, 1 remaining: Internal error occurred:
15+
error resolving resource'
16+
...
17+
----
18+
19+
These types of issues can prevent an Operator from being reinstalled successfully.
20+
21+
[WARNING]
22+
====
23+
Forced deletion of a namespace is not likely to resolve "Terminating" state issues and can lead to unstable or unpredictable cluster behavior, so it is better to try to find related resources that might be preventing the namespace from being deleted. For more information, see the link:https://access.redhat.com/solutions/4165791[Red Hat Knowledgebase Solution #4165791], paying careful attention to the cautions and warnings.
24+
====
25+
26+
The following procedure shows how to troubleshoot when an Operator cannot be reinstalled because an existing custom resource definition (CRD) from a previous installation of the Operator is preventing a related namespace from deleting successfully.
27+
28+
.Procedure
29+
30+
. Check if there are any namespaces related to the Operator that are stuck in "Terminating" state:
31+
+
32+
[source,terminal]
33+
----
34+
$ oc get namespaces
35+
----
36+
+
37+
.Example output
38+
----
39+
operator-ns-1 Terminating
40+
----
41+
42+
. Check if there are any CRDs related to the Operator that are still present after the failed uninstallation:
43+
+
44+
[source,terminal]
45+
----
46+
$ oc get crds
47+
----
48+
+
49+
[NOTE]
50+
====
51+
CRDs are global cluster definitions; the actual custom resource (CR) instances related to the CRDs could be in other namespaces or be global cluster instances.
52+
====
53+
54+
. If there are any CRDs that you know were provided or managed by the Operator and that should have been deleted after uninstallation, delete the CRD:
55+
+
56+
[source,terminal]
57+
----
58+
$ oc delete crd <crd_name>
59+
----
60+
61+
. Check if there are any remaining CR instances related to the Operator that are still present after uninstallation, and if so, delete the CRs:
62+
63+
.. The type of CRs to search for can be difficult to determine after uninstallation and can require knowing what CRDs the Operator manages. For example, if you are troubleshooting an uninstallation of the etcd Operator, which provides the `EtcdCluster` CRD, you can search for remaining `EtcdCluster` CRs in a namespace:
64+
+
65+
[source,terminal]
66+
----
67+
$ oc get EtcdCluster -n <namespace_name>
68+
----
69+
+
70+
Alternatively, you can search across all namespaces:
71+
+
72+
[source,terminal]
73+
----
74+
$ oc get EtcdCluster --all-namespaces
75+
----
76+
77+
.. If there are any remaining CRs that should be removed, delete the instances:
78+
+
79+
[source,terminal]
80+
----
81+
$ oc delete <cr_name> <cr_instance_name> -n <namespace_name>
82+
----
83+
84+
. Check that the namespace deletion has successfully resolved:
85+
+
86+
[source,terminal]
87+
----
88+
$ oc get namespace <namespace_name>
89+
----
90+
+
91+
[IMPORTANT]
92+
====
93+
If the namespace or other Operator resources are still not uninstalled cleanly, contact Red Hat Support.
94+
====
95+
96+
. Reinstall the Operator using OperatorHub in the web console.
97+
98+
.Verification
99+
100+
* Check that the Operator has been reinstalled successfully:
101+
+
102+
[source,terminal]
103+
----
104+
$ oc get sub,csv,installplan -n <namespace>
105+
----

operators/admin/olm-deleting-operators-from-cluster.adoc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
:_content-type: ASSEMBLY
2-
[id='olm-deleting-operators-from-a-cluster']
2+
[id="olm-deleting-operators-from-a-cluster"]
33
= Deleting Operators from a cluster
44
include::_attributes/common-attributes.adoc[]
55
:context: olm-deleting-operators-from-a-cluster
66

77
toc::[]
88

9-
The following describes how to delete Operators that were previously installed using Operator Lifecycle Manager (OLM) on your {product-title} cluster.
9+
The following describes how to delete, or uninstall, Operators that were previously installed using Operator Lifecycle Manager (OLM) on your {product-title} cluster.
10+
11+
[IMPORTANT]
12+
====
13+
You must successfully and completely uninstall an Operator prior to attempting to reinstall the same Operator. Failure to fully uninstall the Operator properly can leave resources, such as a project or namespace, stuck in a "Terminating" state and cause "error resolving resource" messages to be observed when trying to reinstall the Operator. For more information, see xref:../../support/troubleshooting/troubleshooting-operator-issues.adoc#olm-reinstall_troubleshooting-operator-issues[Reinstalling Operators after failed uninstallation].
14+
====
1015

1116
include::modules/olm-deleting-operators-from-a-cluster-using-web-console.adoc[leveloffset=+1]
1217
include::modules/olm-deleting-operators-from-a-cluster-using-cli.adoc[leveloffset=+1]

support/troubleshooting/troubleshooting-operator-issues.adoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,14 @@ include::modules/troubleshooting-disabling-autoreboot-mco-cli.adoc[leveloffset=+
4343

4444
// Refreshing failing subscriptions
4545
include::modules/olm-refresh-subs.adoc[leveloffset=+1]
46+
47+
// Reinstalling Operators after failed uninstallation
48+
include::modules/olm-reinstall.adoc[leveloffset=+1]
49+
[role="_additional-resources"]
50+
.Additional resources
51+
52+
* xref:../../operators/admin/olm-deleting-operators-from-cluster.adoc#olm-deleting-operators-from-a-cluster[Deleting Operators from a cluster]
53+
* xref:../../operators/admin/olm-adding-operators-to-cluster.adoc#olm-adding-operators-to-a-cluster[Adding Operators to a cluster]
54+
55+
56+

0 commit comments

Comments
 (0)