Skip to content

Commit ebe2c03

Browse files
📖 Update "Adding a catalog of extensions" (operator-framework#694)
* 📖 Update "Adding a catalog of extensions" operator-framework#693 - Add prerequisites - Format content as a procedure with steps - Add PollInterval field Signed-off-by: Michael Ryan Peter <[email protected]> * Troubleshooting MD issues * Update site configuration for code blocks and definition lists - Edit `mkdocs.yml` - Add support for definition lists - Syntax highlighting * Add Netlify preview requirements - `requirements.txt` - `runtime.txt` - `netlify.toml` Reference: https://www.starfallprojects.co.uk/projects/deploy-host-docs/deploy-mkdocs-material-netlify/#site-setup * Apply Bryce's review comments --------- Signed-off-by: Michael Ryan Peter <[email protected]>
1 parent 47fd760 commit ebe2c03

File tree

5 files changed

+144
-76
lines changed

5 files changed

+144
-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+
# Adding a catalog of extensions to a cluster
2+
3+
Extension authors can publish their products in catalogs.
4+
Catalogs are curated collections of Kubernetes extensions, such as Operators.
5+
Cluster administrators can add these catalogs to their cluster.
6+
Cluster administrators can enable polling to get over-the-air updates to catalogs when extension authors publish changes such as bug fixes and new features.
7+
8+
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.
9+
You can see the available extensions at [Operatorhub.io](https://operatorhub.io).
10+
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.
11+
12+
## Prerequisites
13+
14+
* Access to a Kubernetes cluster, for example `kind`, using an account with `cluster-admin` permissions
15+
* [Operator Controller installed](https://github.com/operator-framework/operator-controller/releases) on the cluster
16+
* [Catalogd installed](https://github.com/operator-framework/catalogd/releases/) on the cluster
17+
* Kubernetes CLI (`kubectl`) installed on your workstation
18+
19+
## Procedure
20+
21+
1. Create a catalog custom resource (CR):
22+
23+
``` yaml title="catalog_cr.yaml"
24+
apiVersion: catalogd.operatorframework.io/v1alpha1
25+
kind: Catalog
26+
metadata:
27+
name: operatorhubio
28+
spec:
29+
source:
30+
type: image
31+
image:
32+
ref: <catalog_image>
33+
pollInterval: <poll_interval_duration>
34+
```
35+
36+
`catalog_name`
37+
: Specifies the image reference for the catalog you want to install, such as `quay.io/operatorhubio/catalog:latest`.
38+
39+
`poll_interval_duration`
40+
: Specifies the interval for polling the remote registry for newer image digests.
41+
The default value is `24h`.
42+
Valid units include seconds (`s`), minutes (`m`), and hours (`h`).
43+
To disable polling, set a zero value, such as `0s`.
44+
45+
``` yaml title="Example `operatorhubio.yaml` CR"
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+
2. Apply the catalog CR:
59+
60+
``` terminal
61+
$ kubectl apply -f <catalog_cr>.yaml
62+
```
63+
64+
``` text title="Example output"
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+
74+
``` terminal
75+
$ kubectl get catalog
76+
```
77+
78+
``` terminal title="Example output"
79+
NAME PHASE AGE
80+
operatorhubio 9s
81+
```
82+
83+
* Check the status of your catalog:
84+
85+
``` terminal
86+
$ kubectl describe catalog
87+
```
88+
89+
``` terminal title="Example output"
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+
```

mkdocs.yml

+12
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,15 @@ nav:
1414
- Explore extensions available for installation: 'Tasks/explore-available-packages.md'
1515
- Installing an extension: 'Tasks/installing-an-extension.md'
1616
- Deleting an extension: 'Tasks/uninstall-an-extension.md'
17+
18+
markdown_extensions:
19+
- pymdownx.highlight:
20+
anchor_linenums: true
21+
line_spans: __span
22+
pygments_lang_class: true
23+
- pymdownx.inlinehilite
24+
- pymdownx.snippets
25+
- pymdownx.superfences
26+
- def_list
27+
- pymdownx.tasklist:
28+
custom_checkbox: true

netlify.toml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# netlify.toml
2+
[build]
3+
command = "mkdocs build"
4+
publish = "site"

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mkdocs-material==9.5.13

runtime.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.8

0 commit comments

Comments
 (0)