Skip to content

Commit 6a895ff

Browse files
authored
Merge pull request #26509 from adellape/opm_cleanup
2 parents dcbc0ac + 35b986a commit 6a895ff

9 files changed

+113
-140
lines changed

modules/olm-building-operator-catalog-image.adoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ cluster has network access to, such as a mirror registry created during a
2121
restricted network cluster installation.
2222

2323
For this example, the procedure assumes use of a mirror registry that has access
24-
to both your network and the internet.
24+
to both your network and the Internet.
2525

2626
.Prerequisites
2727

@@ -65,14 +65,16 @@ target mirror registry:
6565
----
6666
$ podman login <registry_host_name>
6767
----
68-
+
69-
Also authenticate with `registry.redhat.io` so that the base image can be pulled
68+
69+
ifndef::openshift-origin[]
70+
. Authenticate with `registry.redhat.io` so that the base image can be pulled
7071
during the build:
7172
+
7273
[source,terminal]
7374
----
7475
$ podman login registry.redhat.io
7576
----
77+
endif::[]
7678

7779
. Build a catalog image based on the `redhat-operators` catalog from Quay.io,
7880
tagging and pushing it to your mirror registry:

modules/olm-creating-index-image.adoc

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ You can create an index image using the `opm` CLI.
1111

1212
* `opm` version 1.12.3+
1313
* `podman` version 1.4.4+
14-
* A bundle image built and pushed to a registry.
14+
* A bundle image built and pushed to a registry that supports link:https://docs.docker.com/registry/spec/manifest-v2-2/[Docker v2-2]
1515

1616
.Procedure
1717

@@ -20,17 +20,26 @@ You can create an index image using the `opm` CLI.
2020
[source,terminal]
2121
----
2222
$ opm index add \
23-
--bundles quay.io/<namespace>/test-operator:v0.1.0 \//<1>
24-
--tag quay.io/<namespace>/test-catalog:latest \//<2>
23+
--bundles <registry>/<namespace>/<bundle_image_name>:<tag> \//<1>
24+
--tag <registry>/<namespace>/<index_image_name>:<tag> \//<2>
2525
[--binary-image <registry_base_image>] <3>
2626
----
2727
<1> Comma-separated list of bundle images to add to the index.
2828
<2> The image tag that you want the index image to have.
2929
<3> Optional: An alternative registry base image to use for serving the catalog.
3030

31-
. Push the index image to a registry:
31+
. Push the index image to a registry.
32+
33+
.. If required, authenticate with your target registry:
34+
+
35+
[source,terminal]
36+
----
37+
$ podman login <registry>
38+
----
39+
40+
.. Push the index image:
3241
+
3342
[source,terminal]
3443
----
35-
$ podman push quay.io/<namespace>/test-catalog:latest
44+
$ podman push <registry>/<namespace>/test-catalog:latest
3645
----

modules/olm-mirroring-catalog.adoc

Lines changed: 45 additions & 100 deletions
Large diffs are not rendered by default.

modules/olm-operatorhub-overview.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
_OperatorHub_ is the web console interface in {product-title} that cluster administrators use to discover and install Operators. With one click, an Operator can be pulled from its off-cluster source, installed and subscribed on the cluster, and made ready for engineering teams to self-service manage the product across deployment environments using the Operator Lifecycle Manager (OLM).
99

10+
ifndef::openshift-origin[]
1011
Cluster administrators can choose from catalogs grouped into the following categories:
1112

1213
[cols="2a,8a",options="header"]
@@ -28,6 +29,7 @@ Cluster administrators can choose from catalogs grouped into the following categ
2829
|Custom Operators
2930
|Operators you add to the cluster yourself. If you have not added any Custom Operators, the Custom category does not appear in the web console on your OperatorHub.
3031
|===
32+
endif::[]
3133

3234
[NOTE]
3335
====

modules/olm-pruning-index-image.adoc

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
// * migration/migrating_4_2_4/deploying-cam-4-2-4.adoc
88

99
ifdef::openshift-origin[]
10+
:catalog-name: upstream-community-operators
1011
:index-image-pullspec: quay.io/operator-framework/upstream-community-operators:latest
1112
:index-image: upstream-community-operators:latest
1213
:package1: couchdb-operator
1314
:package2: eclipse-che
1415
:package3: etcd
1516
endif::[]
1617
ifndef::openshift-origin[]
18+
:catalog-name: redhat-operators
1719
:index-image-pullspec: registry.redhat.io/redhat/redhat-operator-index:v4.6
1820
:index-image: redhat-operator-index:v4.6
1921
:package1: advanced-cluster-management
@@ -24,35 +26,46 @@ endif::[]
2426
[id="olm-pruning-index-image_{context}"]
2527
= Pruning an index image
2628

27-
An index image, based on the Operator Bundle Format, is a containerized snapshot
28-
of an Operator catalog. You can prune an index of all but a specified list of
29-
packages, creating a copy of the source index containing only the Operators
30-
that you want.
29+
An index image, based on the Operator Bundle Format, is a containerized snapshot of an Operator catalog. You can prune an index of all but a specified list of packages, creating a copy of the source index containing only the Operators that you want.
3130

32-
ifeval::["{context}" == "olm-restricted-networks"]
31+
ifeval::["{context}" != "olm-managing-custom-catalogs"]
3332
When configuring Operator Lifecycle Manager (OLM) to use mirrored content on restricted network {product-title} clusters, use this pruning method if you want to only mirror a subset of Operators from the default catalogs.
33+
34+
For the steps in this procedure, the target registry is an existing mirror registry that is accessible by both your cluster and a workstation with unrestricted network access. This example also shows mirroring the default `{catalog-name}` catalog, but the process is the same for all catalogs.
3435
endif::[]
3536

3637
.Prerequisites
3738

39+
ifeval::["{context}" != "olm-managing-custom-catalogs"]
3840
* Workstation with unrestricted network access
41+
endif::[]
3942
* `podman` version 1.4.4+
4043
* link:https://github.com/fullstorydev/grpcurl[`grpcurl`]
4144
* `opm` version 1.12.3+
42-
* Access to mirror registry that supports
45+
* Access to a registry that supports
4346
link:https://docs.docker.com/registry/spec/manifest-v2-2/[Docker v2-2]
44-
* If you are working with private registries, set the `REG_CREDS` environment
45-
variable to the file path of your registry credentials for use in later steps.
46-
For example, for the `podman` CLI:
47+
48+
.Procedure
49+
50+
ifndef::openshift-origin[]
51+
ifeval::["{context}" != "olm-managing-custom-catalogs"]
52+
. Authenticate with `registry.redhat.io`:
4753
+
4854
[source,terminal]
4955
----
50-
$ REG_CREDS=${XDG_RUNTIME_DIR}/containers/auth.json
56+
$ podman login registry.redhat.io
5157
----
58+
endif::[]
59+
endif::[]
5260

53-
.Procedure
61+
. Authenticate with your target registry:
62+
+
63+
[source,terminal]
64+
----
65+
$ podman login <target_registry>
66+
----
5467

55-
. On your workstation with unrestricted network access, run the source index image that you want to prune in a container. For example:
68+
. Run the source index image that you want to prune in a container. For example:
5669
+
5770
[source,terminal,subs="attributes+"]
5871
----
@@ -107,21 +120,25 @@ $ grpcurl -plaintext localhost:50051 api.Registry/ListPackages > packages.out
107120
$ opm index prune \
108121
-f {index-image-pullspec} \// <1>
109122
-p {package1},{package2},{package3} \// <2>
110-
-t <mirror_registry>:<port>/<namespace>/{index-image} <3>
123+
-t <target_registry>:<port>/<namespace>/{index-image} <3>
111124
----
112125
<1> Index to prune.
113126
<2> Comma-separated list of packages to keep.
114127
<3> Custom tag for new index image being built.
115128

116-
. Run the following command to push the new index image to your mirror registry:
129+
. Run the following command to push the new index image to your target registry:
117130
+
118131
[source,text,subs="attributes+"]
119132
----
120-
$ podman push <mirror_registry>:<port>/<namespace>/{index-image}
133+
$ podman push <target_registry>:<port>/<namespace>/{index-image}
121134
----
122135
+
123-
where `<namespace>` is any existing namespace on the registry. For example, you might create an `olm-mirror` namespace to push all mirrored content to.
136+
where `<namespace>` is any existing namespace on the registry.
137+
ifeval::["{context}" != "olm-managing-custom-catalogs"]
138+
For example, you might create an `olm-mirror` namespace to push all mirrored content to.
139+
endif::[]
124140

141+
:!catalog-name:
125142
:!index-image-pullspec:
126143
:!index-image:
127144
:!package1:

modules/olm-restricted-networks-configuring-operatorhub.adoc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,11 @@
99
[id="olm-restricted-networks-operatorhub_{context}"]
1010
= Disabling the default OperatorHub sources
1111

12-
Operator catalogs that source content from Quay.io are configured for
13-
OperatorHub by default during an {product-title} installation. Before
14-
configuring OperatorHub to instead use local catalog sources in a restricted
15-
network environment, you must disable the default catalogs.
12+
Operator catalogs that source content provided by Red Hat and community projects are configured for OperatorHub by default during an {product-title} installation. Before configuring OperatorHub to instead use local catalog sources in a restricted network environment, you must disable the default catalogs.
1613

1714
.Procedure
1815

19-
* Disable the sources for the default catalogs by adding
20-
`disableAllDefaultSources: true` to the OperatorHub spec:
16+
* Disable the sources for the default catalogs by adding `disableAllDefaultSources: true` to the OperatorHub spec:
2117
+
2218
[source,terminal]
2319
----

modules/olm-understanding-operator-catalog-images.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[id="olm-understanding-operator-catalog-images_{context}"]
77
= Understanding Operator catalogs
88

9-
An Operator catalog is a repository of metadata that Operator Lifecycle Manager (OLM) can query to discover and install Operators and their dependencies on a cluster. OLM always installs Operators from the latest version of a catalog. As of {product-title} 4.6, Red Hat-provided catalogs are distributed using _index images_ from Quay.io.
9+
An Operator catalog is a repository of metadata that Operator Lifecycle Manager (OLM) can query to discover and install Operators and their dependencies on a cluster. OLM always installs Operators from the latest version of a catalog. As of {product-title} 4.6, Red Hat-provided catalogs are distributed using _index images_.
1010

1111
An index image, based on the Operator Bundle Format, is a containerized snapshot of a catalog. It is an immutable artifact that contains the database of pointers to a set of Operator manifest content. A catalog can reference an index image to source its content for OLM on the cluster.
1212

@@ -15,6 +15,7 @@ An index image, based on the Operator Bundle Format, is a containerized snapshot
1515
Starting in {product-title} 4.6, index images provided by Red Hat replace the App Registry catalog images, based on the deprecated Package Manifest Format, that are distributed for previous versions of {product-title} 4. While App Registry catalog images are not distributed by Red Hat for {product-title} 4.6 and later, custom catalog images based on the Package Manifest Format are still supported.
1616
====
1717

18+
ifndef::openshift-origin[]
1819
The following catalogs are distributed by Red Hat:
1920

2021
.Red Hat-provided Operator catalogs
@@ -39,10 +40,10 @@ The following catalogs are distributed by Red Hat:
3940
|`community-operators`
4041
|`registry.redhat.io/redhat/community-operator-index:latest`
4142
|Software maintained by relevant representatives in the link:https://github.com/operator-framework/community-operators[operator-framework/community-operators] GitHub repository. No official support.
42-
4343
|===
44+
endif::[]
4445

45-
As catalogs are updated, the latest versions of Operators change, and older versions may be removed or altered. This behavior can cause problems maintaining reproducible installs over time. In addition, when OLM runs on an {product-title} cluster in a restricted network environment, it is unable to access the catalogs from Quay.io directly to pull the latest content.
46+
As catalogs are updated, the latest versions of Operators change, and older versions may be removed or altered. In addition, when OLM runs on an {product-title} cluster in a restricted network environment, it is unable to access the catalogs directly from the Internet to pull the latest content.
4647

4748
As a cluster administrator, you can create your own custom index image, either based on a Red Hat-provided catalog or from scratch, which can be used to source the catalog content on the cluster. Creating and updating your own index image provides a method for customizing the set of Operators available on the cluster, while also avoiding the aforementioned restricted network environment issues.
4849

modules/olm-updating-operator-catalog-image.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ target mirror registry:
6565
----
6666
$ podman login <registry_host_name>
6767
----
68-
+
69-
Also authenticate with `registry.redhat.io` so that the base image can be pulled
68+
69+
. Authenticate with `registry.redhat.io` so that the base image can be pulled
7070
during the build:
7171
+
7272
[source,terminal]

modules/osdk-building-bundle-image.adoc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ SDK.
1313
* Operator SDK version 0.19.4
1414
* `podman` version 1.4.4+
1515
* An Operator project generated using the Operator SDK
16+
* Access to a registry that supports link:https://docs.docker.com/registry/spec/manifest-v2-2/[Docker v2-2]
1617

1718
.Procedure
1819

@@ -21,7 +22,7 @@ SDK.
2122
[source,terminal]
2223
----
2324
$ operator-sdk bundle create \
24-
quay.io/<namespace>/test-operator:v0.1.0 \//<1>
25+
<registry>/<namespace>/<bundle_image_name>:<tag> \//<1>
2526
-b podman <2>
2627
----
2728
<1> The image tag that you want the bundle image to have.
@@ -31,30 +32,30 @@ $ operator-sdk bundle create \
3132
[NOTE]
3233
====
3334
If your local manifests are not located in the default
34-
`<project_root>/deploy/olm-catalog/test-operator/manifests`, specify the
35+
`<project_root>/deploy/olm-catalog/<bundle_name>/manifests`, specify the
3536
location with the `--directory` flag.
3637
====
3738

3839
. Log in to the registry where you want to push the bundle image. For example:
3940
+
4041
[source,terminal]
4142
----
42-
$ podman login quay.io
43+
$ podman login <registry>
4344
----
4445

4546
. Push the bundle image to the registry:
4647
+
4748
[source,terminal]
4849
----
49-
$ podman push quay.io/<namespace>/test-operator:v0.1.0
50+
$ podman push <registry>/<namespace>/<bundle_image_name>:<tag>
5051
----
5152

5253
. Validate the bundle image in the remote registry:
5354
+
5455
[source,terminal]
5556
----
5657
$ operator-sdk bundle validate \
57-
quay.io/<namespace>/test-operator:v0.1.0 \
58+
<registry>/<namespace>/<bundle_image_name>:<tag> \
5859
-b podman
5960
----
6061
+

0 commit comments

Comments
 (0)