Skip to content

Commit 53e98bc

Browse files
OSDOCS-8880: OLM 1.0 Adding a catalog to a cluster
- Add docs for creating a namespace-scoped pull secret for catalogd
1 parent da2200c commit 53e98bc

5 files changed

+171
-48
lines changed

modules/olmv1-adding-a-catalog.adoc

Lines changed: 52 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99

1010
To add a catalog to a cluster, create a catalog custom resource (CR) and apply it to the cluster.
1111

12+
.Prerequisites
13+
14+
// https://docs.asciidoctor.org/asciidoc/latest/directives/include-list-item-content/
15+
* {empty}
16+
+
17+
--
18+
include::snippets/olmv1-secure-registry-pull-secret.adoc[]
19+
--
20+
1221
.Procedure
1322

1423
. Create a catalog custom resource (CR), similar to the following example:
@@ -25,8 +34,10 @@ spec:
2534
type: image
2635
image:
2736
ref: registry.redhat.io/redhat/redhat-operator-index:v{product-version} <1>
37+
pullSecret: <pull_secret_name> <2>
2838
----
2939
<1> Specify the catalog's image in the `spec.source.image` field.
40+
<2> If your catalog is hosted on a secure registry, such as `registry.redhat.io`, you must create a pull secret scoped to the `openshift-catalog` namespace.
3041

3142
. Add the catalog to your cluster by running the following command:
3243
+
@@ -63,48 +74,50 @@ redhat-operators 20s
6374
+
6475
[source,terminal]
6576
----
66-
$ oc get catalogs.catalogd.operatorframework.io -o yaml
77+
$ oc describe catalog
6778
----
6879
+
6980
.Example output
7081
[source,text,subs="attributes+"]
7182
----
72-
apiVersion: v1
73-
items:
74-
- apiVersion: catalogd.operatorframework.io/v1alpha1
75-
kind: Catalog
76-
metadata:
77-
annotations:
78-
kubectl.kubernetes.io/last-applied-configuration: |
79-
{"apiVersion":"catalogd.operatorframework.io/v1alpha1","kind":"Catalog","metadata":{"annotations":{},"name":"redhat-operators"},"spec":{"source":{"image":{"ref":"registry.redhat.io/redhat/redhat-operator-index:v4.14"},"type":"image"}}}
80-
creationTimestamp: "2023-10-16T13:30:59Z"
81-
generation: 1
82-
name: redhat-operators
83-
resourceVersion: "37304"
84-
uid: cf00c68c-4312-4e06-aa8a-299f0bbf496b
85-
spec:
86-
source:
87-
image:
88-
ref: registry.redhat.io/redhat/redhat-operator-index:v{product-version}
89-
type: image
90-
status: <1>
91-
conditions:
92-
- lastTransitionTime: "2023-10-16T13:32:25Z"
93-
message: successfully unpacked the catalog image "registry.redhat.io/redhat/redhat-operator-index@sha256:bd2f1060253117a627d2f85caa1532ebae1ba63da2a46bdd99e2b2a08035033f" <2>
94-
reason: UnpackSuccessful <3>
95-
status: "True"
96-
type: Unpacked
97-
phase: Unpacked <4>
98-
resolvedSource:
99-
image:
100-
ref: registry.redhat.io/redhat/redhat-operator-index@sha256:bd2f1060253117a627d2f85caa1532ebae1ba63da2a46bdd99e2b2a08035033f <5>
101-
type: image
102-
kind: List
103-
metadata:
104-
resourceVersion: ""
83+
Name: redhat-operators
84+
Namespace:
85+
Labels: <none>
86+
Annotations: <none>
87+
API Version: catalogd.operatorframework.io/v1alpha1
88+
Kind: Catalog
89+
Metadata:
90+
Creation Timestamp: 2024-01-10T16:18:38Z
91+
Finalizers:
92+
catalogd.operatorframework.io/delete-server-cache
93+
Generation: 1
94+
Resource Version: 57057
95+
UID: 128db204-49b3-45ee-bfea-a2e6fc8e34ea
96+
Spec:
97+
Source:
98+
Image:
99+
Pull Secret: redhat-cred
100+
Ref: registry.redhat.io/redhat/redhat-operator-index:v4.15
101+
Type: image
102+
Status: <1>
103+
Conditions:
104+
Last Transition Time: 2024-01-10T16:18:55Z
105+
Message:
106+
Reason: UnpackSuccessful <2>
107+
Status: True
108+
Type: Unpacked
109+
Content URL: http://catalogd-catalogserver.openshift-catalogd.svc/catalogs/redhat-operators/all.json
110+
Observed Generation: 1
111+
Phase: Unpacked <3>
112+
Resolved Source:
113+
Image:
114+
Last Poll Attempt: 2024-01-10T16:18:51Z
115+
Ref: registry.redhat.io/redhat/redhat-operator-index:v4.15
116+
Resolved Ref: registry.redhat.io/redhat/redhat-operator-index@sha256:7b536ae19b8e9f74bb521c4a61e5818e036ac1865a932f2157c6c9a766b2eea5 <4>
117+
Type: image
118+
Events: <none>
105119
----
106-
<1> Stanza describing the status of the catalog.
107-
<2> Output message of the status of the catalog.
108-
<3> Displays the reason the catalog is in the current state.
109-
<4> Displays the phase of the installion process.
110-
<5> Displays the image reference of the catalog.
120+
<1> Describes the status of the catalog.
121+
<2> Displays the reason the catalog is in the current state.
122+
<3> Displays the phase of the installation process.
123+
<4> Displays the image reference of the catalog.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * operators/olm_v1/olmv1-installing-an-operator-from-a-catalog.adoc
4+
5+
ifeval::["{context}" == "olmv1-installing-operator"]
6+
:olmv1-pullsecret-proc:
7+
endif::[]
8+
9+
:_mod-docs-content-type: PROCEDURE
10+
11+
[id="olmv1-creating-a-pull-secret-for-catalogs-secure-registry_{context}"]
12+
= Creating a pull secret for catalogs hosted on a secure registry
13+
14+
include::snippets/olmv1-secure-registry-pull-secret.adoc[]
15+
16+
.Prerequisites
17+
18+
* Login credentials for the secure registry
19+
* Docker or Podman installed on your workstation
20+
21+
.Procedure
22+
23+
* If you already have a `.dockercfg` file with login credentials for the secure registry, create a pull secret by running the following command:
24+
+
25+
[source,terminal]
26+
----
27+
$ oc create secret generic <pull_secret_name> \
28+
--from-file=.dockercfg=<file_path>/.dockercfg \
29+
--type=kubernetes.io/dockercfg \
30+
--namespace=openshift-catalogd
31+
----
32+
+
33+
.Example command
34+
[%collapsible]
35+
====
36+
[source,terminal]
37+
----
38+
$ oc create secret generic redhat-cred \
39+
--from-file=.dockercfg=/home/<username>/.dockercfg \
40+
--type=kubernetes.io/dockercfg \
41+
--namespace=openshift-catalogd
42+
----
43+
====
44+
45+
* If you already have a `$HOME/.docker/config.json` file with login credentials for the secured registry, create a pull secret by running the following command:
46+
+
47+
[source,terminal]
48+
----
49+
$ oc create secret generic <pull_secret_name> \
50+
--from-file=.dockerconfigjson=<file_path>/.docker/config.json \
51+
--type=kubernetes.io/dockerconfigjson \
52+
--namespace=openshift-catalogd
53+
----
54+
+
55+
.Example command
56+
[%collapsible]
57+
====
58+
[source,terminal]
59+
----
60+
$ oc create secret generic redhat-cred \
61+
--from-file=.dockerconfigjson=/home/<username>/.docker/config.json \
62+
--type=kubernetes.io/dockerconfigjson \
63+
--namespace=openshift-catalogd
64+
----
65+
====
66+
* If you do not have a Docker configuration file with login credentials for the secure registry, create a pull secret by running the following command:
67+
+
68+
[source,terminal]
69+
----
70+
$ oc create secret docker-registry <pull_secret_name> \
71+
--docker-server=<registry_server> \
72+
--docker-username=<username> \
73+
--docker-password=<password> \
74+
--docker-email=<email> \
75+
--namespace=openshift-catalogd
76+
----
77+
+
78+
.Example command
79+
[%collapsible]
80+
====
81+
[source,terminal]
82+
----
83+
$ oc create secret docker-registry redhat-cred \
84+
--docker-server=registry.redhat.io \
85+
--docker-username=username \
86+
--docker-password=password \
87+
88+
--namespace=openshift-catalogd
89+
----
90+
====
91+
92+
ifeval::["{context}" == "olmv1-installing-operator"]
93+
:!olmv1-pullsecret-proc:
94+
endif::[]

modules/olmv1-red-hat-catalogs.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010

1111
{olmv1-first} does not include Red Hat-provided Operator catalogs by default. If you want to add a Red Hat-provided catalog to your cluster, create a custom resource (CR) for the catalog and apply it to the cluster. The following custom resource (CR) examples show how to create a catalog resources for {olmv1}.
1212

13+
[IMPORTANT]
14+
====
15+
include::snippets/olmv1-secure-registry-pull-secret.adoc[]
16+
====
17+
1318
.Example Red Hat Operators catalog
1419
[source,yaml,subs="attributes+"]
1520
----
@@ -22,6 +27,7 @@ spec:
2227
type: image
2328
image:
2429
ref: registry.redhat.io/redhat/redhat-operator-index:v{product-version}
30+
pullSecret: <pull_secret_name>
2531
----
2632

2733
.Example Certified Operators catalog
@@ -36,6 +42,7 @@ spec:
3642
type: image
3743
image:
3844
ref: registry.redhat.io/redhat/certified-operator-index:v{product-version}
45+
pullSecret: <pull_secret_name>
3946
----
4047

4148
.Example Community Operators catalog
@@ -50,6 +57,7 @@ spec:
5057
type: image
5158
image:
5259
ref: registry.redhat.io/redhat/community-operator-index:v{product-version}
60+
pullSecret: <pull_secret_name>
5361
----
5462

5563
The following command adds a catalog to your cluster:

operators/olm_v1/olmv1-installing-an-operator-from-a-catalog.adoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,30 @@ Enabling the `TechPreviewNoUpgrade` feature set cannot be undone and prevents mi
3131

3232
[role="_additional-resources"]
3333
.Additional resources
34-
3534
* xref:../../nodes/clusters/nodes-cluster-enabling-features.adoc#nodes-cluster-enabling[Enabling features using feature gates]
3635

3736
include::modules/olmv1-about-catalogs.adoc[leveloffset=+1]
3837
[role="_additional-resources"]
3938
.Additional resources
4039
* xref:../../operators/understanding/olm-packaging-format.adoc#olm-file-based-catalogs_olm-packaging-format[File-based catalogs]
4140

42-
include::modules/olmv1-red-hat-catalogs.adoc[leveloffset=+2]
41+
include::modules/olmv1-red-hat-catalogs.adoc[leveloffset=+1]
4342

4443
[role="_additional-resources"]
4544
.Additional resources
45+
* xref:../../operators/olm_v1/olmv1-installing-an-operator-from-a-catalog.adoc#olmv1-creating-a-pull-secret-for-catalogs-secure-registry_olmv1-installing-operator[Creating a pull secret for catalogs hosted on a secure registry]
4646
* xref:../../operators/olm_v1/olmv1-installing-an-operator-from-a-catalog.adoc#olmv1-adding-a-catalog-to-a-cluster_olmv1-installing-operator[Adding a catalog to a cluster]
4747
* xref:../../operators/understanding/olm-rh-catalogs.adoc#olm-rh-catalogs_olm-rh-catalogs[About Red Hat-provided Operator catalogs]
4848

49-
[NOTE]
50-
====
51-
The following procedures use the Red Hat Operators catalog and the Quay Operator as examples.
52-
====
53-
54-
include::modules/olmv1-about-target-versions.adoc[leveloffset=+1]
49+
include::modules/olmv1-creating-a-pull-secret-for-catalogd.adoc[leveloffset=+1]
5550
include::modules/olmv1-adding-a-catalog.adoc[leveloffset=+1]
51+
52+
[role="_additional-resources"]
53+
.Additional resources
54+
* xref:../../operators/olm_v1/olmv1-installing-an-operator-from-a-catalog.adoc#olmv1-creating-a-pull-secret-for-catalogs-secure-registry_olmv1-installing-operator[Creating a pull secret for catalogs hosted on a secure registry]
55+
5656
include::modules/olmv1-finding-operators-to-install.adoc[leveloffset=+1]
5757

58-
include::modules/olmv1-installing-an-operator.adoc[leveloffset=+1]
58+
include::modules/olmv1-about-target-versions.adoc[leveloffset=+1]
5959
include::modules/olmv1-updating-an-operator.adoc[leveloffset=+1]
6060
include::modules/olmv1-deleting-an-operator.adoc[leveloffset=+1]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Text snippet included in the following modules:
2+
//
3+
// * modules/olmv1-operator-api.adoc
4+
5+
:_mod-docs-content-type: SNIPPET
6+
7+
If you want to use a catalog that is hosted on a secure registry, such as Red Hat-provided Operator catalogs from `registry.redhat.io`, you must have a pull secret scoped to the `openshift-catalogd` namespace.
8+
ifndef::olmv1-pullsecret-proc[For more information, see "Creating a pull secret for catalogs hosted on a secure registry".]

0 commit comments

Comments
 (0)