Skip to content

Commit a5a8849

Browse files
authored
Merge pull request #29902 from adellape/cleanup_stg
2 parents 5ba171d + 24d9468 commit a5a8849

File tree

3 files changed

+111
-0
lines changed

3 files changed

+111
-0
lines changed

modules/olm-refresh-subs.adoc

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * support/troubleshooting/troubleshooting-operator-issues.adoc
4+
5+
[id="olm-refresh-subs_{context}"]
6+
= Refreshing failing subscriptions
7+
8+
In Operator Lifecycle Manager (OLM), if you subscribe to an Operator that references images that are not accessible on your network, you can find jobs in the `openshift-marketplace` namespace that are failing with the following errors:
9+
10+
.Example output
11+
[source,terminal]
12+
----
13+
ImagePullBackOff for
14+
Back-off pulling image "example.com/openshift4/ose-elasticsearch-operator-bundle@sha256:6d2587129c846ec28d384540322b40b05833e7e00b25cca584e004af9a1d292e"
15+
----
16+
17+
.Example output
18+
[source,terminal]
19+
----
20+
rpc error: code = Unknown desc = error pinging docker registry example.com: Get "https://example.com/v2/": dial tcp: lookup example.com on 10.0.0.1:53: no such host
21+
----
22+
23+
As a result, the subscription is stuck in this failing state and the Operator is unable to install or upgrade.
24+
25+
You can refresh a failing subscription by deleting the subscription, cluster service version (CSV), and other related objects. After recreating the subscription, OLM then reinstalls the correct version of the Operator.
26+
27+
.Prerequisites
28+
29+
* You have a failing subscription that is unable to pull an inaccessible bundle image.
30+
* You have confirmed that the correct bundle image is accessible.
31+
32+
.Procedure
33+
34+
. Get the names of the `Subscription` and `ClusterServiceVersion` objects from the namespace where the Operator is installed:
35+
+
36+
[source,terminal]
37+
----
38+
$ oc get sub,csv -n <namespace>
39+
----
40+
+
41+
.Example output
42+
[source,terminal]
43+
----
44+
NAME PACKAGE SOURCE CHANNEL
45+
subscription.operators.coreos.com/elasticsearch-operator elasticsearch-operator redhat-operators 5.0
46+
47+
NAME DISPLAY VERSION REPLACES PHASE
48+
clusterserviceversion.operators.coreos.com/elasticsearch-operator.5.0.0-65 OpenShift Elasticsearch Operator 5.0.0-65 Succeeded
49+
----
50+
51+
. Delete the subscription:
52+
+
53+
[source,terminal]
54+
----
55+
$ oc delete subscription <subscription_name> -n <namespace>
56+
----
57+
58+
. Delete the cluster service version:
59+
+
60+
[source,terminal]
61+
----
62+
$ oc delete csv <csv_name> -n <namespace>
63+
----
64+
65+
. Get the names of any failing jobs and related config maps in the `openshift-marketplace` namespace:
66+
+
67+
[source,terminal]
68+
----
69+
$ oc get job,configmap -n openshift-marketplace
70+
----
71+
+
72+
.Example output
73+
[source,terminal]
74+
----
75+
NAME COMPLETIONS DURATION AGE
76+
job.batch/1de9443b6324e629ddf31fed0a853a121275806170e34c926d69e53a7fcbccb 1/1 26s 9m30s
77+
78+
NAME DATA AGE
79+
configmap/1de9443b6324e629ddf31fed0a853a121275806170e34c926d69e53a7fcbccb 3 9m30s
80+
----
81+
82+
. Delete the job:
83+
+
84+
[source,terminal]
85+
----
86+
$ oc delete job <job_name> -n openshift-marketplace
87+
----
88+
+
89+
This ensures pods that try to pull the inaccessible image are not recreated.
90+
91+
. Delete the config map:
92+
+
93+
[source,terminal]
94+
----
95+
$ oc delete configmap <configmap_name> -n openshift-marketplace
96+
----
97+
98+
. Reinstall the Operator using OperatorHub in the web console.
99+
100+
.Verification
101+
102+
* Check that the Operator has been reinstalled successfully:
103+
+
104+
[source,terminal]
105+
----
106+
$ oc get sub,csv,installplan -n <namespace>
107+
----

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ The following describes how to delete Operators that were previously installed u
99

1010
include::modules/olm-deleting-operators-from-a-cluster-using-web-console.adoc[leveloffset=+1]
1111
include::modules/olm-deleting-operators-from-a-cluster-using-cli.adoc[leveloffset=+1]
12+
include::modules/olm-refresh-subs.adoc[leveloffset=+1]

support/troubleshooting/troubleshooting-operator-issues.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ include::modules/gathering-operator-logs.adoc[leveloffset=+1]
2727

2828
// Disabling Machine Config Operator from autorebooting
2929
include::modules/troubleshooting-disabling-autoreboot-mco.adoc[leveloffset=+1]
30+
31+
// Refreshing failing subscriptions
32+
include::modules/olm-refresh-subs.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)