7
7
[id="olmv1-finding-operators-to-install_{context}"]
8
8
= Finding Operators to install from a catalog
9
9
10
- After you add a catalog to your cluster, you can query the catalog to find Operators and extensions to install. Before you can query catalogs, you must port forward the catalog server service.
10
+ After you add a catalog to your cluster, you can query the catalog to find Operators and extensions to install.
11
+
12
+ include::snippets/olmv1-on-cluster-catalog-queries.adoc[]
11
13
12
14
.Prerequisites
13
15
14
16
* You have added a catalog to your cluster.
15
17
* You have installed the `jq` CLI tool.
18
+ * You have installed the `opm` CLI tool.
16
19
17
20
.Procedure
18
21
19
- . Port forward the catalog server service in the `openshift-catalogd` namespace by running the following command:
20
- +
21
- [source,terminal]
22
- ----
23
- $ oc -n openshift-catalogd port-forward svc/catalogd-catalogserver 8080:443
24
- ----
25
-
26
- . In a new terminal window or tab, download the catalog's JSON file locally by running the following command:
27
- +
28
- [source,terminal]
29
- ----
30
- $ curl -L -k https://localhost:8080/catalogs/<catalog_name>/all.json \
31
- -C - -o /<path>/<catalog_name>.json
32
- ----
22
+ . To return a list of extensions that support the `AllNamespaces` install mode and do not use webhooks, enter the following command:
33
23
+
34
- .Example command
35
- [%collapsible]
36
- ====
37
24
[source,terminal]
38
25
----
39
- $ curl -L -k https://localhost:8080/catalogs/redhat-operators/all.json \
40
- -C - -o /home/username/catalogs/rhoc.json
26
+ $ opm render <catalog_registry_url>:<tag> \
27
+ | jq -cs '[.[] | select(.schema == "olm.bundle" \
28
+ and (.properties[] | select(.type == "olm.csv.metadata").value.installModes[] \
29
+ | select(.type == "AllNamespaces" and .supported == true)) \
30
+ and .spec.webhookdefinitions == null) | .package] | unique[]'
41
31
----
42
- ====
32
+ where:
43
33
44
- . Run one of the following commands to return a list of Operators and extensions in a catalog.
45
- +
46
- [IMPORTANT]
47
- ====
48
- include::snippets/olmv1-tp-extension-support.adoc[]
49
- ====
50
- +
51
- * Get a list of all the Operators and extensions from the local catalog file by running the following command:
52
- +
53
- [source,terminal]
54
- ----
55
- $ jq -s '.[] | select(.schema == "olm.package") | .name' \
56
- /<path>/<filename>.json
57
- ----
34
+ `catalog_registry_url`:: Specifies the URL of the catalog registry, such as `registry.redhat.io/redhat/redhat-operator-index`.
35
+ `tag`:: Specifies the tag or version of the catalog, such as `v{product-version}` or `latest`.
58
36
+
59
37
.Example command
60
38
[%collapsible]
61
39
====
62
- [source,terminal]
40
+ [source,terminal,subs=attributes+ ]
63
41
----
64
- $ jq -s '.[] | select(.schema == "olm.package") | .name' \
65
- /home/username/catalogs/rhoc.json
42
+ $ opm render \
43
+ registry.redhat.io/redhat/redhat-operator-index:v{product-version} \
44
+ | jq -cs '[.[] | select(.schema == "olm.bundle" \
45
+ and (.properties[] | select(.type == "olm.csv.metadata").value.installModes[] \
46
+ | select(.type == "AllNamespaces" and .supported == true)) \
47
+ and .spec.webhookdefinitions == null) | .package] | unique[]'
66
48
----
67
49
====
68
50
+
@@ -71,82 +53,48 @@ $ jq -s '.[] | select(.schema == "olm.package") | .name' \
71
53
====
72
54
[source,text]
73
55
----
74
- NAME AGE
75
56
"3scale-operator"
76
- "advanced-cluster-management"
77
57
"amq-broker-rhel8"
78
58
"amq-online"
79
59
"amq-streams"
80
- "amq7-interconnect-operator "
60
+ "amq-streams-console "
81
61
"ansible-automation-platform-operator"
82
62
"ansible-cloud-addons-operator"
83
63
"apicast-operator"
84
- "aws-efs-csi-driver -operator"
64
+ "authorino -operator"
85
65
"aws-load-balancer-operator"
86
- "bamoe-businessautomation-operator"
87
66
"bamoe-kogito-operator"
88
- "bare-metal-event-relay"
89
- "businessautomation-operator"
90
- ...
91
- ----
92
- ====
93
- +
94
- * Get list of packages that support `AllNamespaces` install mode and do not use webhooks from the local catalog file by running the following command:
95
- +
96
- [source,terminal]
97
- ----
98
- $ jq -c 'select(.schema == "olm.bundle") | \
99
- {"package":.package, "version":.properties[] | \
100
- select(.type == "olm.bundle.object").value.data | @base64d | fromjson | \
101
- select(.kind == "ClusterServiceVersion" and (.spec.installModes[] | \
102
- select(.type == "AllNamespaces" and .supported == true) != null) \
103
- and .spec.webhookdefinitions == null).spec.version}' \
104
- /<path>/<catalog_name>.json
105
- ----
106
- +
107
- .Example output
108
- [%collapsible]
109
- ====
110
- [source,text]
111
- ----
112
- {"package":"3scale-operator","version":"0.10.0-mas"}
113
- {"package":"3scale-operator","version":"0.10.5"}
114
- {"package":"3scale-operator","version":"0.11.0-mas"}
115
- {"package":"3scale-operator","version":"0.11.1-mas"}
116
- {"package":"3scale-operator","version":"0.11.2-mas"}
117
- {"package":"3scale-operator","version":"0.11.3-mas"}
118
- {"package":"3scale-operator","version":"0.11.5-mas"}
119
- {"package":"3scale-operator","version":"0.11.6-mas"}
120
- {"package":"3scale-operator","version":"0.11.7-mas"}
121
- {"package":"3scale-operator","version":"0.11.8-mas"}
122
- {"package":"amq-broker-rhel8","version":"7.10.0-opr-1"}
123
- {"package":"amq-broker-rhel8","version":"7.10.0-opr-2"}
124
- {"package":"amq-broker-rhel8","version":"7.10.0-opr-3"}
125
- {"package":"amq-broker-rhel8","version":"7.10.0-opr-4"}
126
- {"package":"amq-broker-rhel8","version":"7.10.1-opr-1"}
127
- {"package":"amq-broker-rhel8","version":"7.10.1-opr-2"}
128
- {"package":"amq-broker-rhel8","version":"7.10.2-opr-1"}
129
- {"package":"amq-broker-rhel8","version":"7.10.2-opr-2"}
67
+ "cephcsi-operator"
68
+ "cincinnati-operator"
69
+ "cluster-logging"
70
+ "cluster-observability-operator"
71
+ "compliance-operator"
72
+ "container-security-operator"
73
+ "cryostat-operator"
74
+ "datagrid"
75
+ "devspaces"
130
76
...
131
77
----
132
78
====
133
79
134
- . Inspect the contents of an Operator or extension's metadata by running the following command:
80
+ . Inspect the contents of an extension's metadata by running the following command:
135
81
+
136
82
[source,terminal]
137
83
----
138
- $ jq -s '.[] | select( .schema == "olm.package") | \
139
- select( .name == "<package_name>")' /<path>/<catalog_name>.json
84
+ $ opm render <catalog_registry_url>:<tag> \
85
+ | jq -s '.[] | select( .schema == "olm.package") \
86
+ | select( .name == "<package_name>")'
140
87
----
141
88
+
142
89
.Example command
143
90
[%collapsible]
144
91
====
145
- [source,terminal]
92
+ [source,terminal,subs=attributes+ ]
146
93
----
147
- $ jq -s '.[] | select( .schema == "olm.package") | \
148
- select( .name == "openshift-pipelines-operator-rh")' \
149
- /home/username/rhoc.json
94
+ $ opm render \
95
+ registry.redhat.io/redhat/redhat-operator-index:v{product-version} \
96
+ | jq -s '.[] | select( .schema == "olm.package") \
97
+ | select( .name == "openshift-pipelines-operator-rh")'
150
98
----
151
99
====
152
100
+
@@ -156,13 +104,13 @@ $ jq -s '.[] | select( .schema == "olm.package") | \
156
104
[source,text]
157
105
----
158
106
{
159
- "defaultChannel": "stable",
107
+ "schema": "olm.package",
108
+ "name": "openshift-pipelines-operator-rh",
109
+ "defaultChannel": "latest",
160
110
"icon": {
161
- "base64data": "PHN2ZyB4bWxu ..."
111
+ "base64data": "iVBORw0KGgoAAAANSUhE ...",
162
112
"mediatype": "image/png"
163
- },
164
- "name": "openshift-pipelines-operator-rh",
165
- "schema": "olm.package"
113
+ }
166
114
}
167
115
----
168
116
====
0 commit comments