Skip to content

Commit be92ab6

Browse files
committed
Clean up operator-registry
1 parent b4dd7ac commit be92ab6

File tree

14 files changed

+135
-273
lines changed

14 files changed

+135
-273
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,52 @@
1+
12
---
2-
title: "Overview"
3-
linkTitle: "Overview"
4-
weight: 1
5-
description: >
6-
This page introduces you to Operator Registry and what you can achieve with it
3+
title: "Operator Registry"
4+
weight: 3
75
---
86

97
{{% alert title="Warning" color="warning" %}}
10-
These pages are under construction. TODO: Some of the sections below needs to be updated.
8+
These pages are under construction.
119
{{% /alert %}}
1210

13-
1411
## What is Operator-Registry?
15-
12+
1613
[Operator Registry](https://github.com/operator-framework/operator-registry) runs in a Kubernetes or OpenShift cluster to provide operator catalog data to [Operator Lifecycle Manager](https://github.com/operator-framework/operator-lifecycle-manager).
1714

18-
15+
<pre></pre>
1916
Operator Registry provides the following binaries:
20-
17+
18+
* `opm`, which generates and updates registry databases as well as the index images that encapsulate them.
2119
* `initializer`, which takes as an input a directory of operator manifests and outputs a sqlite database containing the same data for querying.
2220
* `registry-server`, which takes a sqlite database loaded with manifests, and exposes a gRPC interface to it.
2321
* `configmap-server`, which takes a kubeconfig and a configmap reference, and parses the configmap into the sqlite database before exposing it via the same interface as `registry-server`.
24-
22+
<pre></pre>
2523
And libraries:
26-
24+
2725
* `pkg/client` - providing a high-level client interface for the gRPC api.
2826
* `pkg/api` - providing low-level client libraries for the gRPC interface exposed by `registry-server`.
2927
* `pkg/registry` - providing basic registry types like Packages, Channels, and Bundles.
3028
* `pkg/sqlite` - providing interfaces for building sqlite manifest databases from `ConfigMap`s or directories, and for querying an existing sqlite database.
31-
29+
* `pkg/lib` - providing external interfaces for interacting with this project as an api that defines a set of standards for operator bundles and indexes.
30+
* `pkg/containertools` - providing an interface to interact with and shell out to common container tooling binaries (if installed on the environment)
31+
3232
## Why do I want Operator Registry?
3333
Operator registry allows you to package your operator in a defined format and make it available for OLM so that it can install your operator in a
34-
kubernetes cluster
34+
kubernetes cluster.
35+
<pre></pre>
36+
You can find all the releases of operator-registry in the [github release page](https://github.com/operator-framework/operator-registry/releases)
37+
38+
## Installation
39+
40+
1. Clone the operator registry repository:
41+
42+
```bash
43+
$ git clone https://github.com/operator-framework/operator-registry
44+
```
3545

36-
## Where should I go next?
46+
2. Build the binaries using this command:
3747

38-
Give your users next steps from the Overview. For example:
48+
```bash
49+
$ make all
50+
```
3951

40-
* [Getting Started](/operator-registry/getting-started/): Get started with project
41-
* [Examples](/operator-registry/examples/): Check out some example code!
52+
This generates the required binaries that can be used to package your operator
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
title: "Building a Catalog"
3+
linkTitle: "Building a Catalog"
4+
date: 2020-04-27
5+
weight: 3
6+
description: >
7+
Build a Catalog of Operators using [Operator-Registry](https://github.com/operator-framework/operator-registry)
8+
---
9+
10+
# Manifest format
11+
12+
We refer to a directory of files with one ClusterServiceVersion as a "bundle". A bundle typically includes a ClusterServiceVersion and the CRDs that define the owned APIs of the CSV in its manifest directory, though additional objects may be included. It also includes an annotations file in its metadata folder which defines some higher level aggregate data that helps to describe the format and package information about how the bundle should be added into an index of bundles.
13+
<pre></pre>
14+
```
15+
# example bundle
16+
etcd
17+
├── manifests
18+
│ ├── etcdcluster.crd.yaml
19+
│ └── etcdoperator.clusterserviceversion.yaml
20+
└── metadata
21+
└── annotations.yaml
22+
```
23+
<pre></pre>
24+
When loading manifests into the database, the following invariants are validated:
25+
<pre>
26+
* The bundle must have at least one channel defined in the annotations.
27+
* Every bundle has exactly one ClusterServiceVersion.
28+
* If a ClusterServiceVersion `owns` a CRD, that CRD must exist in the bundle.
29+
</pre>
30+
Bundle directories are identified solely by the fact that they contain a ClusterServiceVersion, which provides an amount of freedom for layout of manifests.
31+
<pre></pre>
32+
Check out the [operator bundle design proposal](https://github.com/operator-framework/operator-registry/blob/master/docs/design/operator-bundle.md) for more detail on the bundle format.
33+
<pre></pre>
34+
35+
# Bundle images
36+
37+
Using [OCI spec](https://github.com/opencontainers/image-spec/blob/master/spec.md) container images as a method of storing the manifest and metadata contents of individual bundles, `opm` interacts directly with these images to generate and incrementally update the database. Once you have your [manifests defined](https://operator-framework.github.io/olm-book/docs/packaging-an-operator.html#writing-your-operator-manifests) and have created a directory in the format defined above, building the image is as simple as defining a Dockerfile and building that image:
38+
39+
```Dockerfile
40+
FROM scratch
41+
42+
# We are pushing an operator-registry bundle
43+
# that has both metadata and manifests.
44+
LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
45+
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
46+
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
47+
LABEL operators.operatorframework.io.bundle.package.v1=test-operator
48+
LABEL operators.operatorframework.io.bundle.channels.v1=beta,stable
49+
LABEL operators.operatorframework.io.bundle.channel.default.v1=stable
50+
51+
ADD test/*.yaml /manifests
52+
ADD test/metadata/annotations.yaml /metadata/annotations.yaml
53+
```
54+
55+
```sh
56+
podman build -t quay.io/my-container-registry-namespace/my-manifest-bundle:latest -f bundle.Dockerfile .
57+
```
58+
59+
Once you have built the container, you can publish it like any other container image:
60+
61+
```sh
62+
podman push quay.io/my-container-registry-namespace/my-manifest-bundle:latest
63+
```
64+
65+
Of course, this build step can be done with any other OCI spec container tools like `docker`, `buildah`, `libpod`, etc.
66+
<pre></pre>
67+
68+
# Building an index of Operators using opm
69+
70+
71+
<pre></pre>
72+
Index images are additive, so you can add a new version of your operator bundle when you publish a new version:
73+
<pre></pre>
74+
```sh
75+
opm index add --bundles quay.io/my-container-registry-namespace/my-manifest-bundle:0.0.2 --from-index quay.io/my-container-registry-namespace/my-index:1.0.0 --tag quay.io/my-container-registry-namespace/my-index:1.0.1
76+
```
77+
<pre></pre>
78+
For more detail on using `opm` to generate index images, take a look at the [documentation](https://github.com/operator-framework/operator-registry/blob/master/docs/design/opm-tooling.md).
79+
<pre></pre>
80+
## Where should I go next?
81+
82+
* [Use the catalog of operators locally](/docs/concepts/olm-architecture/operator-registry/using-catalog-locally/): Test your catalog locally
83+
* [Using a Catalog with OLM](/docs/concepts/olm-architecture/operator-registry/using-catalog-with-olm/): Make your operator available for OLM in a cluster
84+
85+

content/en/operator-registry/tasks/using-catalog-locally.md renamed to content/en/docs/Concepts/olm-architecture/operator-registry/using-catalog-locally/_index.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
---
2-
title: "Using catalog locally"
3-
linkTitle: "Using catalog locally"
2+
title: "Using the Catalog locally"
3+
linkTitle: "Using the Catalog locally"
44
date: 2020-03-25
55
weight: 3
66
description: >
7-
To test your catalog locally
7+
Test your Catalog locally
88
---
99

10+
Once you have your operator packaged in the bundle format, use the `initializer` to build a sqlite database of your operators locally.
11+
12+
```bash
13+
./bin/initializer -m <relative path to directory of manifests> -o <relative path to a sqlite file to create or overwrite>
14+
```
15+
16+
Once you have a database file, eg sqlite.db, you can serve the database locally using the `registry-server` binary.
17+
18+
```bash
19+
./bin/registry-server -d sqlite.db -p <port number to serve on (default "50051")>
20+
```
1021
[grpcurl](https://github.com/fullstorydev/grpcurl) is a useful tool for interacting with the example catalog server.
1122

1223
```sh

content/en/operator-registry/tasks/using-catalog-with-olm.md renamed to content/en/docs/Concepts/olm-architecture/operator-registry/using-catalog-with-olm/_index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
title: "Using catalog with OLM"
3-
linkTitle: "Using catalog with OLM"
2+
title: "Using the Catalog with OLM"
3+
linkTitle: "Using the Catalog with OLM"
44
date: 2020-03-25
55
weight: 3
66
description: >
7-
Make your operator available for OLM
7+
Make your operator available for OLM in a cluster
88
---
99

1010

11-
To add a catalog packaged with `operator-registry` to your cluster for use with [Operator Lifecycle Manager](https://github.com/operator-framework/operator-lifecycle-manager) (OLM) create a `CatalogSource` referencing the image you created and pushed above:
11+
To add a [catalog image](/operator-registry/tasks/building-catalog/#building-a-catalog-image-of-operators-using-operator-registry) to your cluster for use with [Operator Lifecycle Manager](https://github.com/operator-framework/operator-lifecycle-manager) (OLM), create a [CatalogSource](/docs/Concepts/crds/CatalogSource) referencing the image you created and pushed to your favourite container registry:
1212

1313
```yaml
1414
apiVersion: operators.coreos.com/v1alpha1
@@ -49,7 +49,7 @@ $ kubectl get packagemanifests etcd -o jsonpath='{.status.defaultChannel}'
4949
alpha
5050
```
5151

52-
With this information, the operators package name, the channel and the name and namespace of your catalog you can now [subscribe](https://github.com/operator-framework/operator-lifecycle-manager#discovery-catalogs-and-automated-upgrades) to Operators with Operator Lifecycle Manager. This represents an intent to install an Operator and get subsequent updates from the catalog:
52+
With this information, the operators package name, the channel and the name and namespace of your catalog you can now [subscribe](/docs/tasks/install-operator-with-olm/) to Operators with Operator Lifecycle Manager. This represents an intent to install an Operator and get subsequent updates from the catalog:
5353

5454
```yaml
5555
apiVersion: operators.coreos.com/v1alpha1

content/en/docs/_index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: Operator Lifecyle Manager Documentation
3-
linkTitle: OLM Documentation
3+
linkTitle: "Documentation"
44
menu:
55
main:
6-
weight: 40
6+
weight: 10
77
weight: 20
88
---
99

content/en/operator-registry/Concepts/_index.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

content/en/operator-registry/Concepts/manifest-format.md

Lines changed: 0 additions & 73 deletions
This file was deleted.

content/en/operator-registry/Examples/_index.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

content/en/operator-registry/Releases/_index.md

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)