|
2 | 2 | // |
3 | 3 | // * operators/understanding/olm/olm-understanding-olm.adoc |
4 | 4 |
|
| 5 | +ifdef::openshift-origin[] |
| 6 | +:global_ns: olm |
| 7 | +endif::[] |
| 8 | +ifndef::openshift-origin[] |
| 9 | +:global_ns: openshift-marketplace |
| 10 | +endif::[] |
| 11 | + |
5 | 12 | [id="olm-catalogsource_{context}"] |
6 | 13 | = Catalog source |
7 | 14 |
|
8 | | -A catalog source represents a store of metadata that OLM can query to discover and install Operators and their dependencies. The spec of a `CatalogSource` object indicates how to construct a pod or how to communicate with a service that serves the Operator Registry gRPC API. |
9 | | - |
10 | | -There are three primary `sourceTypes` for a `CatalogSource` object: |
| 15 | +A _catalog source_ represents a store of metadata, typically by referencing an _index image_ stored in a container registry. Operator Lifecycle Manager (OLM) queries catalog sources to discover and install Operators and their dependencies. The OperatorHub in the {product-title} web console also displays the Operators provided by catalog sources. |
11 | 16 |
|
12 | | -* `grpc` with an `image` reference: OLM pulls the image and runs the pod, which is expected to serve a compliant API. |
13 | | -* `grpc` with an `address` field: OLM attempts to contact the gRPC API at the given address. This should not be used in most cases. |
14 | | -* `internal` or `configmap`: OLM parses the ConfigMap data and runs a pod that can serve the gRPC API over it. |
| 17 | +[TIP] |
| 18 | +==== |
| 19 | +Cluster administrators can view the full list of Operators provided by an enabled catalog source on a cluster by using the *Administration* -> *Cluster Settings* -> *Configuration* -> *OperatorHub* page in the web console. |
| 20 | +==== |
15 | 21 |
|
16 | | -The following example defines a catalog source for OperatorHub.io content: |
| 22 | +The `spec` of a `CatalogSource` object indicates how to construct a pod or how to communicate with a service that serves the Operator Registry gRPC API. |
17 | 23 |
|
18 | 24 | .Example `CatalogSource` object |
19 | | -[source,yaml] |
| 25 | +[%collapsible] |
| 26 | +==== |
| 27 | +[source,yaml,subs="attributes+"] |
20 | 28 | ---- |
21 | | -apiVersion: operators.coreos.com/v1alpha1 |
| 29 | +apiVersion: operators.coreos.com/v1alpha1 |
22 | 30 | kind: CatalogSource |
23 | 31 | metadata: |
24 | | - name: operatorhubio-catalog |
25 | | - namespace: olm |
| 32 | + generation: 1 |
| 33 | + name: example-catalog <.> |
| 34 | + namespace: {global_ns} <.> |
26 | 35 | spec: |
27 | | - sourceType: grpc |
28 | | - image: quay.io/operatorhubio/catalog:latest <1> |
29 | | - priority: -400 |
30 | | - displayName: Community Operators |
31 | | - publisher: OperatorHub.io |
32 | | - updateStrategy: |
33 | | - registryPoll: <2> |
34 | | - interval: 30m |
| 36 | + displayName: Example Catalog <.> |
| 37 | + image: quay.io/example-org/example-catalog:v1 <.> |
| 38 | + priority: -400 <.> |
| 39 | + publisher: Example Org |
| 40 | + sourceType: grpc <.> |
| 41 | + updateStrategy: |
| 42 | + registryPoll: <.> |
| 43 | + interval: 30m0s |
| 44 | +status: |
| 45 | + connectionState: |
| 46 | + address: example-catalog.{global_ns}.svc:50051 |
| 47 | + lastConnect: 2021-08-26T18:14:31Z |
| 48 | + lastObservedState: READY <.> |
| 49 | + latestImageRegistryPoll: 2021-08-26T18:46:25Z <.> |
| 50 | + registryService: <.> |
| 51 | + createdAt: 2021-08-26T16:16:37Z |
| 52 | + port: 50051 |
| 53 | + protocol: grpc |
| 54 | + serviceName: example-catalog |
| 55 | + serviceNamespace: {global_ns} |
35 | 56 | ---- |
36 | | -<1> Specify catalog image. |
37 | | -<2> Automatically check for new versions at a given interval to keep up to date. |
| 57 | +<.> Name for the `CatalogSource` object. This value is also used as part of the name for the related pod that is created in the requested namespace. |
| 58 | +<.> Namespace to create the catalog available. To make the catalog available cluster-wide in all namespaces, set this value to `{global_ns}`. The default Red Hat-provided catalog sources also use the `{global_ns}` namespace. Otherwise, set the value to a specific namespace to make the Operator only available in that namespace. |
| 59 | +<.> Display name for the catalog in the web console and CLI. |
| 60 | +<.> Index image for the catalog. |
| 61 | +<.> Weight for the catalog source. OLM uses the weight for prioritization during dependency resolution. A higher weight indicates the catalog is preferred over lower-weighted catalogs. |
| 62 | +<.> Source types include the following: |
| 63 | ++ |
| 64 | +-- |
| 65 | +* `grpc` with an `image` reference: OLM pulls the image and runs the pod, which is expected to serve a compliant API. |
| 66 | +* `grpc` with an `address` field: OLM attempts to contact the gRPC API at the given address. This should not be used in most cases. |
| 67 | +* `internal` or `configmap`: OLM parses config map data and runs a pod that can serve the gRPC API over it. |
| 68 | +-- |
| 69 | +<.> Automatically check for new versions at a given interval to stay up-to-date. |
| 70 | +<.> Last observed state of the catalog connection. For example: |
| 71 | ++ |
| 72 | +-- |
| 73 | +* `READY`: A connection is successfully established. |
| 74 | +* `CONNECTING`: A connection is attempting to establish. |
| 75 | +* `TRANSIENT_FAILURE`: A temporary problem has occurred while attempting to establish a connection, such as a timeout. The state will eventually switch back to `CONNECTING` and try again. |
| 76 | +-- |
| 77 | ++ |
| 78 | +See link:https://grpc.github.io/grpc/core/md_doc_connectivity-semantics-and-api.html[States of Connectivity] in the gRPC documentation for more details. |
| 79 | +<.> Latest time the container registry storing the catalog image was polled to ensure the image is up-to-date. |
| 80 | +<.> Status information for the catalog's Operator Registry service. |
| 81 | +==== |
38 | 82 |
|
39 | | -The `name` of the `CatalogSource` object is used as input to a subscription, which instructs OLM where to look to find a requested Operator: |
| 83 | +Referencing the `name` of a `CatalogSource` object in a subscription instructs OLM where to search to find a requested Operator: |
40 | 84 |
|
41 | 85 | .Example `Subscription` object referencing a catalog source |
42 | | -[source,yaml] |
| 86 | +[%collapsible] |
| 87 | +==== |
| 88 | +[source,yaml,subs="attributes+"] |
43 | 89 | ---- |
44 | 90 | apiVersion: operators.coreos.com/v1alpha1 |
45 | 91 | kind: Subscription |
46 | 92 | metadata: |
47 | | - name: my-operator |
48 | | - namespace: olm |
| 93 | + name: example-operator |
| 94 | + namespace: example-namespace |
49 | 95 | spec: |
50 | | - channel: stable |
51 | | - name: my-operator |
52 | | - source: operatorhubio-catalog |
| 96 | + channel: stable |
| 97 | + name: example-operator |
| 98 | + source: example-catalog |
| 99 | + sourceNamespace: {global_ns} |
53 | 100 | ---- |
| 101 | +==== |
| 102 | + |
| 103 | +ifdef::openshift-origin[] |
| 104 | +:!global_ns: |
| 105 | +endif::[] |
| 106 | +ifndef::openshift-origin[] |
| 107 | +:!global_ns: |
| 108 | +endif::[] |
0 commit comments