Skip to content

Commit f495394

Browse files
📖 Update "Adding a catalog of extensions"
#693 - Add prerequisites - Format content as a procedure with steps - Add PollInterval field Signed-off-by: Michael Ryan Peter <[email protected]>
1 parent 38da6fc commit f495394

File tree

1 file changed

+126
-76
lines changed

1 file changed

+126
-76
lines changed

docs/Tasks/adding-a-catalog.md

+126-76
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,126 @@
1-
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.
2-
3-
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.
4-
5-
To consume this catalog on cluster, create a `Catalog` Custom Resource(CR) with the image specified in the `spec.source.image` field:
6-
7-
```bash
8-
$ kubectl apply -f - <<EOF
9-
apiVersion: catalogd.operatorframework.io/v1alpha1
10-
kind: Catalog
11-
metadata:
12-
name: operatorhubio
13-
spec:
14-
source:
15-
type: image
16-
image:
17-
ref: quay.io/operatorhubio/catalog:latest
18-
EOF
19-
```
20-
21-
The packages made available for installation/receiving updates on cluster can then be explored by querying the `Package` and `BundleMetadata` CRs:
22-
23-
```bash
24-
$ kubectl get packages
25-
NAME AGE
26-
operatorhubio-ack-acm-controller 3m12s
27-
operatorhubio-ack-apigatewayv2-controller 3m12s
28-
operatorhubio-ack-applicationautoscaling-controller 3m12s
29-
operatorhubio-ack-cloudtrail-controller 3m12s
30-
operatorhubio-ack-dynamodb-controller 3m12s
31-
operatorhubio-ack-ec2-controller 3m12s
32-
operatorhubio-ack-ecr-controller 3m12s
33-
operatorhubio-ack-eks-controller 3m12s
34-
operatorhubio-ack-elasticache-controller 3m12s
35-
operatorhubio-ack-emrcontainers-controller 3m12s
36-
operatorhubio-ack-eventbridge-controller 3m12s
37-
operatorhubio-ack-iam-controller 3m12s
38-
operatorhubio-ack-kinesis-controller 3m12s
39-
operatorhubio-ack-kms-controller 3m12s
40-
operatorhubio-ack-lambda-controller 3m12s
41-
operatorhubio-ack-memorydb-controller 3m12s
42-
operatorhubio-ack-mq-controller 3m12s
43-
operatorhubio-ack-opensearchservice-controller 3m12s
44-
.
45-
.
46-
.
47-
48-
$ kubectl get bundlemetadata
49-
NAME AGE
50-
operatorhubio-ack-acm-controller.v0.0.1 3m58s
51-
operatorhubio-ack-acm-controller.v0.0.2 3m58s
52-
operatorhubio-ack-acm-controller.v0.0.4 3m58s
53-
operatorhubio-ack-acm-controller.v0.0.5 3m58s
54-
operatorhubio-ack-acm-controller.v0.0.6 3m58s
55-
operatorhubio-ack-apigatewayv2-controller.v0.0.10 3m58s
56-
operatorhubio-ack-apigatewayv2-controller.v0.0.11 3m58s
57-
operatorhubio-ack-apigatewayv2-controller.v0.0.12 3m58s
58-
operatorhubio-ack-apigatewayv2-controller.v0.0.13 3m58s
59-
operatorhubio-ack-apigatewayv2-controller.v0.0.14 3m58s
60-
operatorhubio-ack-apigatewayv2-controller.v0.0.15 3m58s
61-
operatorhubio-ack-apigatewayv2-controller.v0.0.16 3m58s
62-
operatorhubio-ack-apigatewayv2-controller.v0.0.17 3m58s
63-
operatorhubio-ack-apigatewayv2-controller.v0.0.18 3m58s
64-
operatorhubio-ack-apigatewayv2-controller.v0.0.19 3m58s
65-
operatorhubio-ack-apigatewayv2-controller.v0.0.20 3m58s
66-
operatorhubio-ack-apigatewayv2-controller.v0.0.21 3m58s
67-
operatorhubio-ack-apigatewayv2-controller.v0.0.22 3m58s
68-
operatorhubio-ack-apigatewayv2-controller.v0.0.9 3m58s
69-
operatorhubio-ack-apigatewayv2-controller.v0.1.0 3m58s
70-
operatorhubio-ack-apigatewayv2-controller.v0.1.1 3m58s
71-
operatorhubio-ack-apigatewayv2-controller.v0.1.2 3m58s
72-
operatorhubio-ack-apigatewayv2-controller.v0.1.3 3m58s
73-
.
74-
.
75-
.
76-
```
1+
Extension authors can publish their products in catalogs.
2+
Catalogs are curated collections of Operators and extensions.
3+
Cluster administrators can add these catalogs to their cluster.
4+
When extension authors publish updates to their catalogs, cluster administrators can install and update those changes.
5+
6+
For example, the [Kubernetes community Operators catalog](https://github.com/k8s-operatorhub/community-operators) is a catalog of curated extensions that is developed by the Kubernetes community.
7+
You can see the available extensions at [Operatorhub.io](https://operatorhub.io).
8+
This catalog is distributed as an image [quay.io/operatorhubio/catalog](https://quay.io/repository/operatorhubio/catalog?tag=latest&tab=tags) that can be installed on clusters.
9+
10+
## Prerequisites
11+
12+
* Access to a Kubernetes cluster, for example `kind`, using an account with `cluster-admin` permissions
13+
* [Operator Controller installed](https://github.com/operator-framework/operator-controller/releases) on the cluster
14+
* [Catalogd installed](https://github.com/operator-framework/catalogd/releases/) on the cluster
15+
* Kubernetes CLI (`kubectl`) installed on your workstation
16+
17+
## Procedure
18+
19+
1. Create a catalog custom resource (CR):
20+
```yaml
21+
apiVersion: catalogd.operatorframework.io/v1alpha1
22+
kind: Catalog
23+
metadata:
24+
name: operatorhubio
25+
spec:
26+
source:
27+
type: image
28+
image:
29+
ref: <catalog_image>
30+
pollInterval: <poll_interval_duration>
31+
```
32+
where:
33+
34+
`catalog_image`
35+
:Specifies the image reference for the catalog you want to install, such as `quay.io/operatorhubio/catalog:latest`.
36+
37+
`poll_interval_duration`
38+
:Specifies the interval for polling the remote registry for newer image digests.
39+
The default value is `24h`.
40+
Valid units include seconds (`s`), minutes (`m`), and hours (`h`).
41+
To disable polling, set a zero value, such as `0s`.
42+
43+
<details>
44+
<summary>Example `operatorhub.yaml` CR</summary>
45+
```yaml
46+
apiVersion: catalogd.operatorframework.io/v1alpha1
47+
kind: Catalog
48+
metadata:
49+
name: operatorhub
50+
spec:
51+
source:
52+
type: image
53+
image:
54+
ref: quay.io/operatorhubio/catalog:latest
55+
pollInterval: 1h
56+
```
57+
58+
1. Apply the catalog CR:
59+
```terminal
60+
$ kubectl apply -f <catalog_cr>.yaml
61+
```
62+
63+
**Example output**
64+
```text
65+
catalog.catalogd.operatorframework.io/redhat-operators created
66+
```
67+
68+
### Verification
69+
70+
* Run the following commands to verify the status of your catalog:
71+
72+
* Check if your catalog is available on the cluster:
73+
```terminal
74+
$ kubectl get catalog
75+
```
76+
77+
**Example output**
78+
```text
79+
NAME PHASE AGE
80+
operatorhubio 9s
81+
```
82+
83+
* Check the status of your catalog:
84+
```terminal
85+
$ kubectl describe catalog
86+
```
87+
88+
**Example output**
89+
```text
90+
Name: operatorhubio
91+
Namespace:
92+
Labels: <none>
93+
Annotations: <none>
94+
API Version: catalogd.operatorframework.io/v1alpha1
95+
Kind: Catalog
96+
Metadata:
97+
Creation Timestamp: 2024-03-12T19:34:50Z
98+
Finalizers:
99+
catalogd.operatorframework.io/delete-server-cache
100+
Generation: 2
101+
Resource Version: 6469
102+
UID: 2e2778cb-dda6-4645-96b7-992e8dd37503
103+
Spec:
104+
Source:
105+
Image:
106+
Poll Interval: 15m0s
107+
Ref: quay.io/operatorhubio/catalog:latest
108+
Type: image
109+
Status:
110+
Conditions:
111+
Last Transition Time: 2024-03-12T19:35:34Z
112+
Message:
113+
Reason: UnpackSuccessful
114+
Status: True
115+
Type: Unpacked
116+
Content URL: http://catalogd-catalogserver.catalogd-system.svc/catalogs/operatorhubio/all.json
117+
Observed Generation: 2
118+
Phase: Unpacked
119+
Resolved Source:
120+
Image:
121+
Last Poll Attempt: 2024-03-12T19:35:26Z
122+
Ref: quay.io/operatorhubio/catalog:latest
123+
Resolved Ref: quay.io/operatorhubio/catalog@sha256:dee29aaed76fd1c72b654b9bc8bebc4b48b34fd8d41ece880524dc0c3c1c55ec
124+
Type: image
125+
Events: <none>
126+
```

0 commit comments

Comments
 (0)