Skip to content

Commit b72b4d9

Browse files
Michael Petermichaelryanpeter
authored andcommitted
4.14 OLM 1.0 Tech Preview procedures
1 parent 7c64dcf commit b72b4d9

10 files changed

+831
-0
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,6 +1885,8 @@ Topics:
18851885
File: olmv1-packaging-format
18861886
- Name: Managing catalogs
18871887
File: olmv1-managing-catalogs
1888+
- Name: Installing an Operator from a catalog
1889+
File: olmv1-installing-an-operator-from-a-catalog
18881890
---
18891891
Name: CI/CD
18901892
Dir: cicd

modules/olmv1-about-catalogs.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * operators/olm_v1/olmv1-installing-an-operator-from-a-catalog.adoc
4+
5+
:_content-type: CONCEPT
6+
7+
[id="olmv1-about-catalogs_{context}"]
8+
= About catalogs in OLM 1.0
9+
10+
You can discover installable content by querying a catalog for Kubernetes extensions, such as Operators and controllers, by using the catalogd component. Catalogd is a Kubernetes extension that unpacks catalog content for on-cluster clients and is part of the OLM 1.0 suite of microservices. Currently, catalogd unpacks catalog content that is packaged and distributed as container images.
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+
// * operators/olm_v1/olmv1-installing-an-operator-from-a-catalog.adoc
4+
5+
:_content-type: CONCEPT
6+
7+
[id="olmv1-about-operator-updates_{context}"]
8+
= About target versions in OLM 1.0
9+
10+
In Operator Lifecycle Manager 1.0, cluster administrators set the target version of an Operator declaratively in the Operator's custom resource (CR).
11+
12+
If you specify a channel in the Operator's CR, OLM 1.0 installs the latest release from the specified channel. When updates are published to the specified channel, OLM 1.0 automatically updates to the latest release from the channel.
13+
14+
.Example CR with a specified channel
15+
[source,yaml]
16+
----
17+
apiVersion: operators.operatorframework.io/v1alpha1
18+
kind: Operator
19+
metadata:
20+
name: quay-example
21+
spec:
22+
packageName: quay-operator
23+
channel: stable-3.8 <1>
24+
----
25+
<1> Installs the latest release published to the specified channel. Updates to the channel are automatically installed.
26+
27+
If you specify the Operator's target version in the CR, OLM 1.0 installs the specified version. When the target version is specified in the Operator's CR, OLM 1.0 does not change the target version when updates are published to the catalog.
28+
29+
If you want to update the version of the Operator that is installed on the cluster, you must manually update the Operator's CR. Specifying a Operator's target version pins the Operator's version to the specified release.
30+
31+
.Example CR with the target version specified
32+
[source,yaml]
33+
----
34+
apiVersion: operators.operatorframework.io/v1alpha1
35+
kind: Operator
36+
metadata:
37+
name: quay-example
38+
spec:
39+
packageName: quay-operator
40+
version: 3.8.12 <1>
41+
----
42+
<1> Specifies the target version. If you want to update the version of the Operator that is installed on the cluster, you must manually update this field the Operator's CR to the desired target version.
43+
44+
If you want to change the installed version of an Operator, edit the Operator's CR to the desired target version.
45+
46+
[WARNING]
47+
====
48+
In previous versions of OLM, Operator authors could define upgrade edges to prevent you from updating to unsupported versions. In its current state of development, OLM 1.0 does not enforce upgrade edge definitions. You can specify any version of an Operator, and OLM 1.0 attempts to apply the update.
49+
====
50+
51+
You can inspect an Operator's catalog contents, including available versions and channels, by running the following command:
52+
53+
.Command syntax
54+
[source,terminal]
55+
----
56+
$ oc get package <catalog_name>-<package_name> -o yaml
57+
----
58+
59+
After a you create or update a CR, create or configure the Operator by running the following command:
60+
61+
.Command syntax
62+
[source,terminal]
63+
----
64+
$ oc apply -f <extension_name>.yaml
65+
----
66+
67+
.Troubleshooting
68+
69+
* If you specify a target version or channel that does not exist, you can run the following command to check the status of your Operator:
70+
+
71+
[source,terminal]
72+
----
73+
$ oc get operators.operators.operatorframework.io <operator_name> -o yaml
74+
----
75+
+
76+
.Example output
77+
[source,text]
78+
----
79+
apiVersion: operators.operatorframework.io/v1alpha1
80+
kind: Operator
81+
metadata:
82+
annotations:
83+
kubectl.kubernetes.io/last-applied-configuration: |
84+
{"apiVersion":"operators.operatorframework.io/v1alpha1","kind":"Operator","metadata":{"annotations":{},"name":"quay-example"},"spec":{"packageName":"quay-operator","version":"999.99.9"}}
85+
creationTimestamp: "2023-10-19T18:39:37Z"
86+
generation: 3
87+
name: quay-example
88+
resourceVersion: "51505"
89+
uid: 2558623b-8689-421c-8ed5-7b14234af166
90+
spec:
91+
packageName: quay-operator
92+
version: 999.99.9
93+
status:
94+
conditions:
95+
- lastTransitionTime: "2023-10-19T18:50:34Z"
96+
message: package 'quay-operator' at version '999.99.9' not found
97+
observedGeneration: 3
98+
reason: ResolutionFailed
99+
status: "False"
100+
type: Resolved
101+
- lastTransitionTime: "2023-10-19T18:50:34Z"
102+
message: installation has not been attempted as resolution failed
103+
observedGeneration: 3
104+
reason: InstallationStatusUnknown
105+
status: Unknown
106+
type: Installed
107+
----

modules/olmv1-adding-a-catalog.adoc

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * operators/olm_v1/olmv1-installing-an-operator-from-a-catalog.adoc
4+
5+
:_content-type: PROCEDURE
6+
7+
[id="olmv1-adding-a-catalog-to-a-cluster_{context}"]
8+
= Adding a catalog to a cluster
9+
10+
To add a catalog to a cluster, create a catalog custom resource (CR) and apply it to the cluster.
11+
12+
.Procedure
13+
14+
. Create a catalog custom resource (CR), similar to the following example:
15+
+
16+
.Example `redhat-operators.yaml`
17+
[source,yaml,subs="attributes+"]
18+
----
19+
apiVersion: catalogd.operatorframework.io/v1alpha1
20+
kind: Catalog
21+
metadata:
22+
name: redhat-operators
23+
spec:
24+
source:
25+
type: image
26+
image:
27+
ref: registry.redhat.io/redhat/redhat-operator-index:v{product-version} <1>
28+
----
29+
<1> Specify the catalog's image in the `spec.source.image` field.
30+
31+
. Add the catalog to your cluster by running the following command:
32+
+
33+
[source,terminal]
34+
----
35+
$ oc apply -f redhat-operators.yaml
36+
----
37+
+
38+
.Example output
39+
[source,text]
40+
----
41+
catalog.catalogd.operatorframework.io/redhat-operators created
42+
----
43+
44+
.Verification
45+
46+
* Run the following commands to verify the status of your catalog:
47+
48+
.. Check if you catalog is available by running the following command:
49+
+
50+
[source,terminal]
51+
----
52+
$ oc get catalog
53+
----
54+
+
55+
.Example output
56+
[source,text]
57+
----
58+
NAME AGE
59+
redhat-operators 20s
60+
----
61+
62+
.. Check the status of your catalog by running the following command:
63+
+
64+
[source,terminal]
65+
----
66+
$ oc get catalogs.catalogd.operatorframework.io -o yaml
67+
----
68+
+
69+
.Example output
70+
[source,text,subs="attributes+"]
71+
----
72+
apiVersion: v1
73+
items:
74+
- apiVersion: catalogd.operatorframework.io/v1alpha1
75+
kind: Catalog
76+
metadata:
77+
annotations:
78+
kubectl.kubernetes.io/last-applied-configuration: |
79+
{"apiVersion":"catalogd.operatorframework.io/v1alpha1","kind":"Catalog","metadata":{"annotations":{},"name":"redhat-operators"},"spec":{"source":{"image":{"ref":"registry.redhat.io/redhat/redhat-operator-index:v4.14"},"type":"image"}}}
80+
creationTimestamp: "2023-10-16T13:30:59Z"
81+
generation: 1
82+
name: redhat-operators
83+
resourceVersion: "37304"
84+
uid: cf00c68c-4312-4e06-aa8a-299f0bbf496b
85+
spec:
86+
source:
87+
image:
88+
ref: registry.redhat.io/redhat/redhat-operator-index:v{product-version}
89+
type: image
90+
status: <1>
91+
conditions:
92+
- lastTransitionTime: "2023-10-16T13:32:25Z"
93+
message: successfully unpacked the catalog image "registry.redhat.io/redhat/redhat-operator-index@sha256:bd2f1060253117a627d2f85caa1532ebae1ba63da2a46bdd99e2b2a08035033f" <2>
94+
reason: UnpackSuccessful <3>
95+
status: "True"
96+
type: Unpacked
97+
phase: Unpacked <4>
98+
resolvedSource:
99+
image:
100+
ref: registry.redhat.io/redhat/redhat-operator-index@sha256:bd2f1060253117a627d2f85caa1532ebae1ba63da2a46bdd99e2b2a08035033f <5>
101+
type: image
102+
kind: List
103+
metadata:
104+
resourceVersion: ""
105+
----
106+
<1> Stanza describing the status of the catalog.
107+
<2> Output message of the status of the catalog.
108+
<3> Displays the reason the catalog is in the current state.
109+
<4> Displays the phase of the installion process.
110+
<5> Displays the image reference of the catalog.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * operators/olm_v1/olmv1-installing-an-operator-from-a-catalog.adoc
4+
5+
:_content-type: PROCEDURE
6+
7+
[id="olmv1-deleting-an-operator_{context}"]
8+
= Deleting an Operator
9+
10+
You can delete an Operator and its custom resource definitions (CRDs) by deleting the Operator's custom resource (CR).
11+
12+
.Prerequisites
13+
14+
* You have a catalog installed.
15+
* You have an Operator installed.
16+
17+
.Procedure
18+
19+
* Delete an Operator and its CRDs by running the following command:
20+
+
21+
[source,terminal]
22+
----
23+
$ oc delete operator.operators.operatorframework.io quay-example
24+
----
25+
+
26+
.Example output
27+
[source,text]
28+
----
29+
operator.operators.operatorframework.io "quay-example" deleted
30+
----
31+
32+
.Verification
33+
34+
* Run the following commands to verify that your Operator and its resources were deleted:
35+
36+
** Verify the Operator is deleted by running the following command:
37+
+
38+
[source,terminal]
39+
----
40+
$ oc get operator.operators.operatorframework.io
41+
----
42+
+
43+
.Example output
44+
[source,text]
45+
----
46+
No resources found
47+
----
48+
49+
** Verify that the Operator's system namespace is deleted by running the following command:
50+
+
51+
[source,terminal]
52+
----
53+
$ oc get ns quay-operator-system
54+
----
55+
+
56+
.Example output
57+
[source,text]
58+
----
59+
Error from server (NotFound): namespaces "quay-operator-system" not found
60+
----

0 commit comments

Comments
 (0)