1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-07 00:48:01 +01:00
Files
openshift-docs/modules/olmv1-adding-a-catalog.adoc
2024-02-22 13:52:43 +00:00

126 lines
3.6 KiB
Plaintext

// Module included in the following assemblies:
//
// * operators/olm_v1/olmv1-installing-an-operator-from-a-catalog.adoc
:_mod-docs-content-type: PROCEDURE
[id="olmv1-adding-a-catalog-to-a-cluster_{context}"]
= Adding a catalog to a cluster
To add a catalog to a cluster, create a catalog custom resource (CR) and apply it to the cluster.
.Prerequisites
// https://docs.asciidoctor.org/asciidoc/latest/directives/include-list-item-content/
* {empty}
+
--
include::snippets/olmv1-secure-registry-pull-secret.adoc[]
--
.Procedure
. Create a catalog custom resource (CR), similar to the following example:
+
.Example `redhat-operators.yaml`
[source,yaml,subs="attributes+"]
----
apiVersion: catalogd.operatorframework.io/v1alpha1
kind: Catalog
metadata:
name: redhat-operators
spec:
source:
type: image
image:
ref: registry.redhat.io/redhat/redhat-operator-index:v{product-version} <1>
pullSecret: <pull_secret_name> <2>
pollInterval: <poll_interval_duration> <3>
----
<1> Specify the catalog's image in the `spec.source.image` field.
<2> If your catalog is hosted on a secure registry, such as `registry.redhat.io`, you must create a pull secret scoped to the `openshift-catalog` namespace.
<3> Specify the interval for polling the remote registry for newer image digests. The default value is `24h`. Valid units include seconds (`s`), minutes (`m`), and hours (`h`). To disable polling, set a zero value, such as `0s`.
. Add the catalog to your cluster by running the following command:
+
[source,terminal]
----
$ oc apply -f redhat-operators.yaml
----
+
.Example output
[source,text]
----
catalog.catalogd.operatorframework.io/redhat-operators created
----
.Verification
* Run the following commands to verify the status of your catalog:
.. Check if you catalog is available by running the following command:
+
[source,terminal]
----
$ oc get catalog
----
+
.Example output
[source,text]
----
NAME AGE
redhat-operators 20s
----
.. Check the status of your catalog by running the following command:
+
[source,terminal]
----
$ oc describe catalog
----
+
.Example output
[source,text,subs="attributes+"]
----
Name: redhat-operators
Namespace:
Labels: <none>
Annotations: <none>
API Version: catalogd.operatorframework.io/v1alpha1
Kind: Catalog
Metadata:
Creation Timestamp: 2024-01-10T16:18:38Z
Finalizers:
catalogd.operatorframework.io/delete-server-cache
Generation: 1
Resource Version: 57057
UID: 128db204-49b3-45ee-bfea-a2e6fc8e34ea
Spec:
Source:
Image:
Pull Secret: redhat-cred
Ref: registry.redhat.io/redhat/redhat-operator-index:v4.15
Type: image
Status: <1>
Conditions:
Last Transition Time: 2024-01-10T16:18:55Z
Message:
Reason: UnpackSuccessful <2>
Status: True
Type: Unpacked
Content URL: http://catalogd-catalogserver.openshift-catalogd.svc/catalogs/redhat-operators/all.json
Observed Generation: 1
Phase: Unpacked <3>
Resolved Source:
Image:
Last Poll Attempt: 2024-01-10T16:18:51Z
Ref: registry.redhat.io/redhat/redhat-operator-index:v4.15
Resolved Ref: registry.redhat.io/redhat/redhat-operator-index@sha256:7b536ae19b8e9f74bb521c4a61e5818e036ac1865a932f2157c6c9a766b2eea5 <4>
Type: image
Events: <none>
----
<1> Describes the status of the catalog.
<2> Displays the reason the catalog is in the current state.
<3> Displays the phase of the installation process.
<4> Displays the image reference of the catalog.