Skip to content

Commit ea9f253

Browse files
author
Chris Negus
authored
Merge pull request #14156 from chrisnegus/1683024-addop
BZ: 1684446: Added deleting operators to adding operators docs
2 parents 99071d2 + d0b79fc commit ea9f253

9 files changed

+154
-12
lines changed

_topic_map.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ Topics:
8282
- Name: Adding Operators to a cluster
8383
File: olm-adding-operators-to-cluster
8484
Distros: openshift-enterprise,openshift-origin
85+
- Name: Deleting Operators from a cluster
86+
File: olm-deleting-operators-from-cluster
87+
Distros: openshift-enterprise,openshift-origin
8588
- Name: Creating applications from installed Operators
8689
File: olm-creating-apps-from-installed-operators
8790
- Name: Service brokers

applications/operators/olm-adding-operators-to-cluster.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ toc::[]
77

88
This guide outlines the architecture of the Operator Lifecycle Manager (OLM) and
99
OperatorHub and walks cluster administrators through an example of installing
10-
and subscribing a cluster to Operators from the OperatorHub.
10+
Operators to a cluster.
1111

1212
include::modules/olm-operator-lifecycle-manager.adoc[leveloffset=+1]
1313
include::modules/olm-operatorhub.adoc[leveloffset=+1]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[id='olm-deleting-operators-from-a-cluster']
2+
= Deleting Operators from a cluster
3+
include::modules/common-attributes.adoc[]
4+
:context: olm-deleting-operators-from-a-cluster
5+
6+
toc::[]
7+
8+
To delete (uninstall) an Operator from your cluster, you can simply
9+
delete the subscription to remove it from the subscribed namespace.
10+
If you want a clean slate, you can also remove the operator CSV and
11+
deployment, then delete Operator's entry in the CatalogSourceConfig.
12+
The following text describes how to delete Operators from a cluster
13+
using either the web console or the command line.
14+
15+
include::modules/olm-deleting-operators-from-a-cluster-using-web-console.adoc[leveloffset=+2]
16+
include::modules/olm-deleting-operators-from-a-cluster-using-cli.adoc[leveloffset=+2]

images/olm-operator-delete.png

95.8 KB
Loading

images/olm-operatorhub.png

77.8 KB
Loading
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * applications/operators/olm-adding-operators-to-cluster.adoc
4+
5+
[id='olm-deleting-operator-from-a-cluster-using-cli-{context}']
6+
= Deleting operators from a cluster using the CLI
7+
8+
Instead of using the {product-title} web console, you can delete an Operator
9+
from your cluster by using the CLI.
10+
You do this by deleting the Subscription and ClusterServiceVersion
11+
from the `targetNamespace`, then editing the CatalogSourceConfig to remove
12+
the Operator's package name.
13+
14+
.Prerequisites
15+
16+
- Access to an {product-title} cluster using an account with `cluster-admin`
17+
permissions.
18+
19+
- Install the *oc* command on your local system.
20+
21+
.Procedure
22+
23+
In this example, there are two operators (Jaeger and Descheduler) installed in the
24+
`openshift-operators` namespace. The goal is to remove Jaeger without removing Descheduler.
25+
26+
. Delete the Operator's subscription (for example, jaeger):
27+
+
28+
----
29+
$ oc delete subscription jaeger -n openshift-operators
30+
subscription.operators.coreos.com "jaeger" deleted
31+
----
32+
33+
. Check the current version of the subscribed Operator (for example, jaeger):
34+
+
35+
----
36+
$ oc get subscription jaeger -n openshift-operators -o yaml | grep currentCSV
37+
currentCSV: jaeger-operator.v1.8.2
38+
----
39+
40+
. Delete the CSV for the Operator (jaeger) in the `targetNamespace` (`openshift-operators`)
41+
+
42+
----
43+
$ oc delete clusterserviceversion jaeger-operator.v1.8.2 -n openshift-operators
44+
clusterserviceversion.operators.coreos.com "jaeger-operator.v1.8.2" deleted
45+
----
46+
47+
. Display the contents of the `CatalogSourceConfig` resource and review the list
48+
of packages in the `spec` section:
49+
+
50+
----
51+
$ oc get catalogsourceconfig -n openshift-marketplace \
52+
installed-community-openshift-operators -o yaml
53+
----
54+
+
55+
For example, the spec section might appear as follows:
56+
+
57+
.Example of CatalogSourceConfig
58+
[source,yaml]
59+
----
60+
spec:
61+
csDisplayName: Community Operators
62+
csPublisher: Community
63+
packages: jaeger,descheduler
64+
targetNamespace: openshift-operators
65+
----
66+
. Remove the Operator from the CatalogSourceConfig in one of two ways:
67+
68+
** If you have multiple Operators, edit the CatalogSourceConfig resource and remove the Operator's package:
69+
+
70+
----
71+
$ oc edit catalogsourceconfig -n openshift-marketplace \
72+
installed-community-openshift-operators
73+
----
74+
Remove the package from the `packages` line, as shown:
75+
+
76+
.Example of modified packages in CatalogSourceConfig
77+
[source,yaml]
78+
----
79+
packages: descheduler
80+
----
81+
+
82+
Save the change and the marketplace-operator will reconcile the CatalogSourceConfig.
83+
84+
** If there is only one Operator in the CatalogSourceConfig, you can remove it
85+
by simply deleting the entire CatalogSourceConfig as follows:
86+
+
87+
----
88+
$ oc delete catalogsourceconfig -n openshift-marketplace \
89+
installed-community-openshift-operators
90+
----
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * applications/operators/olm-adding-operators-to-cluster.adoc
4+
5+
[id='olm-deleting-operators-from-a-cluster-using-web-console-{context}']
6+
= Deleting Operators from a cluster using the web console
7+
8+
To delete an installed Operator from the selected namespace through the Web console, follow these steps:
9+
10+
.Procedure
11+
12+
. Navigate in the web console to the *Catalog* → *Operator Management* page.
13+
. Click the *Operator Subscriptions* tab to see the list of installed Operators
14+
for the namespace.
15+
. Find the Operator you want to delete (in this example, jaeger) and click
16+
the three-dot drop-down box in far right column.
17+
+
18+
image::olm-operator-delete.png[]
19+
20+
. Click *Remove Subscription*.
21+
. When prompted from the *Remove Subscription* pop-up, optionally select the
22+
`Also completely remove the jaeger Operator from the selected namespace`
23+
checkbox, if you want all components related to the installation to be removed.
24+
This removes the CSV, which in turn removes the pods, the deployments, the
25+
CRDs, and CRs associated with the Operator.
26+
. Select *Remove*. This Operator will stop running and no longer receive updates.
27+
28+
[NOTE]
29+
====
30+
Although the Operator is no longer installed or receiving updates, that
31+
Operator will still appear on the Operator Catalogs list, ready to re-subscribe. To remove the Operator from that
32+
listing, you can delete the Operator's entry in the CatalogSourceConfig
33+
from the command line (as shown in last step of "Deleting operators from a cluster using the CLI").
34+
====

modules/olm-installing-from-operatorhub-using-cli.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ appearing as if it was one step.
2121
- Access to an {product-title} cluster using an account with `cluster-admin`
2222
permissions.
2323

24+
- Install the *oc* command to your local system.
25+
2426
.Procedure
2527

2628
. View the list of Operators available to the cluster from the OperatorHub:
@@ -39,7 +41,7 @@ myoperator 14h
3941

4042
. To identify the Operators to enable on the cluster, create a CatalogSourceConfig
4143
object YAML file (for example, `csc.cr.yaml`). Include one or more packages
42-
listed in the previous step (such as amp-streams or etcd). For example:
44+
listed in the previous step (such as couchbase-enterprise or etcd). For example:
4345
+
4446
.Example CatalogSourceConfig
4547
[source,yaml]

modules/olm-installing-from-operatorhub-using-web-console.adoc

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[id="olm-installing-from-operatorhub-using-web-console-{context}"]
66
= Installing from the OperatorHub using the web console
77

8-
This procedure uses the etcd Operator as an example to install and subscribe to
8+
This procedure uses the Couchbase Operator as an example to install and subscribe to
99
an Operator from the OperatorHub using the {product-title} web console.
1010

1111
.Prerequisites
@@ -17,27 +17,24 @@ permissions.
1717

1818
. Navigate in the web console to the *Catalog → OperatorHub* page.
1919

20-
. Choose the Operator you want to install from the list of available Operators (*etcd* for this example).
21-
A pop-up window appears, warning you that you are installing a Community Operator.
20+
. Scroll or type a keyword into the `Filter by keyword` box (in this case, `Couchbase`) to find the Operator you want.
2221
+
23-
[NOTE]
24-
====
25-
This Operator will be available under the *Red Hat* category in the GA release.
26-
====
27-
. Select *Continue* to acknowledge the *Show Community Operator* warning.
22+
image::olm-operatorhub.png[]
23+
24+
. Select the Operator. Information about the Operator is displayed.
2825

2926
. Read the information about the Operator and click *Install*.
3027

3128
. On the *Create Operator Subscription* page, select:
32-
.. Select *All namespaces on the cluster (default)* to install the Operator to all namespaces or
29+
.. *All namespaces on the cluster (default)* to install the Operator to all namespaces or
3330
*A specific namespace on the cluster* to choose a specific, single namespace on which to
3431
install the Operator. The *All namespaces...* option is not always available.
3532
.. An *Update Channel* (if more than one is available)
3633
.. *Automatic* or *Manual* approval strategy, as described earlier.
3734

3835
. Click *Subscribe* to make the Operator available to the selected namespaces on this {product-title} cluster.
3936

40-
. Select *Catalog → Installed Operators* to verify that the *etcd*
37+
. Select *Catalog → Installed Operators* to verify that the *Couchbase*
4138
ClusterServiceVersion (CSV) eventually shows up and its *Status* ultimately
4239
resolves to *InstallSucceeded*.
4340
+

0 commit comments

Comments
 (0)