Skip to content

Commit f3cfb7a

Browse files
Merge pull request #71009 from michaelryanpeter/osdocs-8865-installing-extensions
OSDOCS#8865 Installing extensions on a cluster in OLM 1.0
2 parents f01f20b + a36c876 commit f3cfb7a

File tree

1 file changed

+171
-27
lines changed

1 file changed

+171
-27
lines changed

modules/olmv1-installing-an-operator.adoc

Lines changed: 171 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,127 @@
55
:_mod-docs-content-type: PROCEDURE
66

77
[id="olmv1-installing-an-operator_{context}"]
8-
= Installing an Operator
8+
= Installing an Operator from a catalog
99

10-
You can install an Operator from a catalog by creating an Operator custom resource (CR) and applying it to the cluster.
10+
{olmv1-first} supports installing Operators and extensions scoped to the cluster. You can install an Operator from a catalog by creating an Operator custom resource (CR) and applying it to the cluster.
11+
12+
[IMPORTANT]
13+
====
14+
Currently, {olmv1} supports the installation Operators and extensions that meet the following criteria:
15+
16+
* The Operator or extension must use the `AllNamespaces` install mode.
17+
* The Operator or extension must not use webhooks.
18+
19+
Operators and extensions that use webhooks or that target a single or specified set of namespaces cannot be installed.
20+
====
1121

1222
.Prerequisite
1323

1424
* You have added a catalog to your cluster.
15-
* You have inspected the details of an Operator to find what version you want to install.
25+
* You have downloaded a local copy of the catalog file.
1626

1727
.Procedure
1828

29+
. Inspect a package for channel and version information from a local copy of your catalog file by completing the following steps:
30+
31+
.. Get a list of channels from a selected package by running the following command:
32+
+
33+
[source,terminal]
34+
----
35+
$ jq -s '.[] | select( .schema == "olm.channel" ) | \
36+
select( .package == "<package_name>") | \
37+
.name' /<path>/<catalog_name>.json
38+
----
39+
+
40+
.Example command
41+
[%collapsible]
42+
====
43+
[source,terminal]
44+
----
45+
$ jq -s '.[] | select( .schema == "olm.channel" ) | \
46+
select( .package == "openshift-pipelines-operator-rh") | \
47+
.name' /home/username/rhoc.json
48+
----
49+
====
50+
+
51+
.Example output
52+
[%collapsible]
53+
====
54+
[source,text]
55+
----
56+
"latest"
57+
"pipelines-1.11"
58+
"pipelines-1.12"
59+
"pipelines-1.13"
60+
----
61+
====
62+
63+
.. Get a list of the versions published in a channel by running the following command:
64+
+
65+
[source,terminal]
66+
----
67+
$ jq -s '.[] | select( .package == "<package_name" ) | \
68+
select( .schema == "olm.channel" ) | \
69+
select( .name == "<channel_name" ) | .entries | \
70+
.[] | .name' /<path>/<catalog_name>.json
71+
----
72+
+
73+
.Example command
74+
[%collapsible]
75+
====
76+
[source,terminal]
77+
----
78+
$ jq -s '.[] | select( .package == "openshift-pipelines-operator-rh" ) | \
79+
select( .schema == "olm.channel" ) | select( .name == "latest" ) | \
80+
.entries | .[] | .name' /home/username/rhoc.json
81+
----
82+
====
83+
+
84+
.Example output
85+
[%collapsible]
86+
====
87+
[source,text]
88+
----
89+
"openshift-pipelines-operator-rh.v1.11.1"
90+
"openshift-pipelines-operator-rh.v1.12.0"
91+
"openshift-pipelines-operator-rh.v1.12.1"
92+
"openshift-pipelines-operator-rh.v1.12.2"
93+
"openshift-pipelines-operator-rh.v1.13.0"
94+
"openshift-pipelines-operator-rh.v1.13.1"
95+
----
96+
====
97+
1998
. Create an Operator CR, similar to the following example:
2099
+
21-
.Example `test-operator.yaml` CR
100+
.Example `pipelines-operator.yaml` CR
22101
[source,yaml]
23102
----
24103
apiVersion: operators.operatorframework.io/v1alpha1
25104
kind: Operator
26105
metadata:
27-
name: quay-example
106+
name: pipelines-operator
28107
spec:
29-
packageName: quay-operator
30-
version: 3.8.12
108+
packageName: openshift-pipelines-operator-rh
109+
channel: <channel>
110+
version: <version>
31111
----
112+
+
113+
where:
114+
+
115+
<channel>:: Optional: Specifies the channel, such as `pipelines-1.11` or `latest`, for the package you want to install or update.
116+
<version>:: Optional: Specifies the specific version or version range, such as `1.11.1`, `1.12.x`, or `>=1.12.1`, of the package you want to install or update. For more information, see "About target versions in OLM 1.0" and "Support for version ranges".
32117

33118
. Apply the Operator CR to the cluster by running the following command:
34119
+
35120
[source,terminal]
36121
----
37-
$ oc apply -f test-operator.yaml
122+
$ oc apply -f pipeline-operator.yaml
38123
----
39124
+
40125
.Example output
41126
[source,text]
42127
----
43-
operator.operators.operatorframework.io/quay-example created
128+
operator.operators.operatorframework.io/pipelines-operator created
44129
----
45130

46131
.Verification
@@ -49,54 +134,113 @@ operator.operators.operatorframework.io/quay-example created
49134
+
50135
[source,terminal]
51136
----
52-
$ oc get operator.operators.operatorframework.io/quay-example -o yaml
137+
$ oc get operator.operators.operatorframework.io pipelines-operator -o yaml
53138
----
54139
+
140+
[NOTE]
141+
====
142+
If you specify a channel or define a version range in your Operator or extension's CR, {olmv1} does not display the resolved version installed on the cluster. Only the version and channel information specified in the CR are displayed.
143+
144+
If you want to find the specific version that is installed, you must compare the SHA of the image of the `spec.source.image.ref` field to the image reference in the catalog.
145+
====
146+
+
55147
.Example output
148+
[%collapsible]
149+
====
56150
[source,text]
57151
----
58152
apiVersion: operators.operatorframework.io/v1alpha1
59153
kind: Operator
60154
metadata:
61155
annotations:
62156
kubectl.kubernetes.io/last-applied-configuration: |
63-
{"apiVersion":"operators.operatorframework.io/v1alpha1","kind":"Operator","metadata":{"annotations":{},"name":"quay-example"},"spec":{"packageName":"quay-operator","version":"3.8.12"}}
64-
creationTimestamp: "2023-10-19T18:39:37Z"
157+
{"apiVersion":"operators.operatorframework.io/v1alpha1","kind":"Operator","metadata":{"annotations":{},"name":"pipelines-operator"},"spec":{"channel":"latest","packageName":"openshift-pipelines-operator-rh","version":"1.11.x"}}
158+
creationTimestamp: "2024-01-30T20:06:09Z"
65159
generation: 1
66-
name: quay-example
67-
resourceVersion: "45663"
68-
uid: 2558623b-8689-421c-8ed5-7b14234af166
160+
name: pipelines-operator
161+
resourceVersion: "44362"
162+
uid: 4272d228-22e1-419e-b9a7-986f982ee588
69163
spec:
70-
packageName: quay-operator
71-
version: 3.8.12
164+
channel: latest
165+
packageName: openshift-pipelines-operator-rh
166+
upgradeConstraintPolicy: Enforce
167+
version: 1.11.x
72168
status:
73169
conditions:
74-
- lastTransitionTime: "2023-10-19T18:39:37Z"
75-
message: resolved to "registry.redhat.io/quay/quay-operator-bundle@sha256:bf26c7679ea1f7b47d2b362642a9234cddb9e366a89708a4ffcbaf4475788dc7"
170+
- lastTransitionTime: "2024-01-30T20:06:15Z"
171+
message: resolved to "registry.redhat.io/openshift-pipelines/pipelines-operator-bundle@sha256:e09d37bb1e754db42324fd18c1cb3e7ce77e7b7fcbf4932d0535391579938280"
76172
observedGeneration: 1
77173
reason: Success
78174
status: "True"
79175
type: Resolved
80-
- lastTransitionTime: "2023-10-19T18:39:46Z"
81-
message: installed from "registry.redhat.io/quay/quay-operator-bundle@sha256:bf26c7679ea1f7b47d2b362642a9234cddb9e366a89708a4ffcbaf4475788dc7"
176+
- lastTransitionTime: "2024-01-30T20:06:31Z"
177+
message: installed from "registry.redhat.io/openshift-pipelines/pipelines-operator-bundle@sha256:e09d37bb1e754db42324fd18c1cb3e7ce77e7b7fcbf4932d0535391579938280"
82178
observedGeneration: 1
83179
reason: Success
84180
status: "True"
85181
type: Installed
86-
installedBundleResource: registry.redhat.io/quay/quay-operator-bundle@sha256:bf26c7679ea1f7b47d2b362642a9234cddb9e366a89708a4ffcbaf4475788dc7
87-
resolvedBundleResource: registry.redhat.io/quay/quay-operator-bundle@sha256:bf26c7679ea1f7b47d2b362642a9234cddb9e366a89708a4ffcbaf4475788dc7
182+
installedBundleResource: registry.redhat.io/openshift-pipelines/pipelines-operator-bundle@sha256:e09d37bb1e754db42324fd18c1cb3e7ce77e7b7fcbf4932d0535391579938280
183+
resolvedBundleResource: registry.redhat.io/openshift-pipelines/pipelines-operator-bundle@sha256:e09d37bb1e754db42324fd18c1cb3e7ce77e7b7fcbf4932d0535391579938280
88184
----
185+
====
89186

90-
. Get information about your Operator's controller manager pod by running the following command:
187+
. Get information about your Operator's bundle deployment by running the following command:
91188
+
92189
[source,terminal]
93190
----
94-
$ oc get pod -n quay-operator-system
191+
$ oc get bundleDeployment pipelines-operator -o yaml
95192
----
96193
+
97194
.Example output
195+
[%collapsible]
196+
====
98197
[source,text]
99198
----
100-
NAME READY STATUS RESTARTS AGE
101-
quay-operator.v3.8.12-6677b5c98f-2kdtb 1/1 Running 0 2m28s
199+
apiVersion: core.rukpak.io/v1alpha1
200+
kind: BundleDeployment
201+
metadata:
202+
creationTimestamp: "2024-01-30T20:06:15Z"
203+
generation: 2
204+
name: pipelines-operator
205+
ownerReferences:
206+
- apiVersion: operators.operatorframework.io/v1alpha1
207+
blockOwnerDeletion: true
208+
controller: true
209+
kind: Operator
210+
name: pipelines-operator
211+
uid: 4272d228-22e1-419e-b9a7-986f982ee588
212+
resourceVersion: "44464"
213+
uid: 0a0c3525-27e2-4c93-bf57-55920a7707c0
214+
spec:
215+
provisionerClassName: core-rukpak-io-plain
216+
template:
217+
metadata: {}
218+
spec:
219+
provisionerClassName: core-rukpak-io-registry
220+
source:
221+
image:
222+
ref: registry.redhat.io/openshift-pipelines/pipelines-operator-bundle@sha256:e09d37bb1e754db42324fd18c1cb3e7ce77e7b7fcbf4932d0535391579938280
223+
type: image
224+
status:
225+
activeBundle: pipelines-operator-29x720cjzx8yiowf13a3j75fil2zs3mfw
226+
conditions:
227+
- lastTransitionTime: "2024-01-30T20:06:15Z"
228+
message: Successfully unpacked the pipelines-operator-29x720cjzx8yiowf13a3j75fil2zs3mfw
229+
Bundle
230+
reason: UnpackSuccessful
231+
status: "True"
232+
type: HasValidBundle
233+
- lastTransitionTime: "2024-01-30T20:06:28Z"
234+
message: Instantiated bundle pipelines-operator-29x720cjzx8yiowf13a3j75fil2zs3mfw
235+
successfully
236+
reason: InstallationSucceeded
237+
status: "True"
238+
type: Installed
239+
- lastTransitionTime: "2024-01-30T20:06:40Z"
240+
message: BundleDeployment is healthy
241+
reason: Healthy
242+
status: "True"
243+
type: Healthy
244+
observedGeneration: 2
102245
----
246+
====

0 commit comments

Comments
 (0)