diff --git a/docs/Tasks/adding-a-catalog.md b/docs/Tasks/adding-a-catalog.md index ecccf0a65..98210e1a7 100644 --- a/docs/Tasks/adding-a-catalog.md +++ b/docs/Tasks/adding-a-catalog.md @@ -1,76 +1,127 @@ -Extension authors have the mechanisms to offer their product as part of a curated catalog of extensions, that they can push updates to over-the-air (eg publish new versions, publish patched versions with CVEs, etc). Cluster admins can sign up to receive these updates on clusters, by adding the catalog to the cluster. When a catalog is added to a cluster, the kubernetes extension packages in that catalog become available on cluster for installation and receiving updates. - -For example, the [k8s-operatorhub/community-operators](https://github.com/k8s-operatorhub/community-operators) is a catalog of curated extensions that contains a list of extensions being developed by the community. The list of extensions can be viewed in [Operatorhub.io](https://operatorhub.io). This catalog is distributed as an image [quay.io/operatorhubio/catalog](https://quay.io/repository/operatorhubio/catalog?tag=latest&tab=tags) for consumption on clusters. - -To consume this catalog on cluster, create a `Catalog` Custom Resource(CR) with the image specified in the `spec.source.image` field: - -```bash -$ kubectl apply -f - < + pollInterval: + ``` + where: + + `catalog_image` + :Specifies the image reference for the catalog you want to install, such as `quay.io/operatorhubio/catalog:latest`. + + `poll_interval_duration` + :Specifies 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`. + +
+ Example `operatorhub.yaml` CR + ```yaml + apiVersion: catalogd.operatorframework.io/v1alpha1 + kind: Catalog + metadata: + name: operatorhub + spec: + source: + type: image + image: + ref: quay.io/operatorhubio/catalog:latest + pollInterval: 1h + ``` + +1. Apply the catalog CR: + ```terminal + $ kubectl apply -f .yaml + ``` + + **Example output** + ```text + catalog.catalogd.operatorframework.io/redhat-operators created + ``` + +### Verification + +* Run the following commands to verify the status of your catalog: + + * Check if your catalog is available on the cluster: + ```terminal + $ kubectl get catalog + ``` + + **Example output** + ```text + NAME PHASE AGE + operatorhubio 9s + ``` + + * Check the status of your catalog: + ```terminal + $ kubectl describe catalog + ``` + + **Example output** + ```text + Name: operatorhubio + Namespace: + Labels: + Annotations: + API Version: catalogd.operatorframework.io/v1alpha1 + Kind: Catalog + Metadata: + Creation Timestamp: 2024-03-12T19:34:50Z + Finalizers: + catalogd.operatorframework.io/delete-server-cache + Generation: 2 + Resource Version: 6469 + UID: 2e2778cb-dda6-4645-96b7-992e8dd37503 + Spec: + Source: + Image: + Poll Interval: 15m0s + Ref: quay.io/operatorhubio/catalog:latest + Type: image + Status: + Conditions: + Last Transition Time: 2024-03-12T19:35:34Z + Message: + Reason: UnpackSuccessful + Status: True + Type: Unpacked + Content URL: http://catalogd-catalogserver.catalogd-system.svc/catalogs/operatorhubio/all.json + Observed Generation: 2 + Phase: Unpacked + Resolved Source: + Image: + Last Poll Attempt: 2024-03-12T19:35:26Z + Ref: quay.io/operatorhubio/catalog:latest + Resolved Ref: quay.io/operatorhubio/catalog@sha256:dee29aaed76fd1c72b654b9bc8bebc4b48b34fd8d41ece880524dc0c3c1c55ec + Type: image + Events: + ```