Skip to content

Commit a59d923

Browse files
Merge pull request #33001 from aireilly/MGMT-1152
MGMT-1152: Generate ImageContentSourcePolicy scoped to a registry
2 parents 97b90c5 + cbcc88b commit a59d923

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * updating/updating-restricted-network-cluster.adoc
4+
5+
[id="generating-icsp-object-scoped-to-a-registry_{context}"]
6+
= Widening the scope of the mirror image catalog to reduce the frequency of cluster node reboots
7+
8+
You can scope the mirrored image catalog at the repository level or the wider registry level. A widely scoped `ImageContentSourcePolicy` resource reduces the number of times the nodes need to reboot in response to changes to the resource.
9+
10+
To widen the scope of the mirror image catalog in the `ImageContentSourcePolicy` resource, perform the following procedure.
11+
12+
.Prerequisites
13+
14+
* Install the {product-title} CLI `oc`.
15+
* Log in as a user with `cluster-admin` privileges.
16+
* Configure a mirrored image catalog for use in your disconnected cluster.
17+
18+
.Procedure
19+
20+
. Run the following command, specifying values for `<local_registry>`, `<pull_spec>`, and `<pull_secret_file>`:
21+
+
22+
[source,terminal]
23+
----
24+
$ oc adm catalog mirror <local_registry>/<pull_spec> <local_registry> -a <pull_secret_file> --icsp-scope=registry
25+
----
26+
+
27+
where:
28+
+
29+
--
30+
<local_registry>:: is the local registry you have configured for your disconnected cluster, for example, `local.registry:5000`.
31+
<pull_spec>:: is the pull specification as configured in your disconnected registry, for example, `redhat/redhat-operator-index:v{product-version}`
32+
<pull_secret_file>:: is the `registry.redhat.io` pull secret in `.json` file format downloaded from the link:https://cloud.redhat.com/openshift/install/pull-secret[Pull Secret] page on the {cloud-redhat-com} site.
33+
--
34+
+
35+
The `oc adm catalog mirror` command creates a `/redhat-operator-index-manifests` directory and generates `imageContentSourcePolicy.yaml`, `catalogSource.yaml`, and `mapping.txt` files.
36+
37+
. Apply the new `ImageContentSourcePolicy` resource to the cluster:
38+
+
39+
[source,terminal]
40+
----
41+
$ oc apply -f imageContentSourcePolicy.yaml
42+
----
43+
44+
.Verification
45+
46+
* Verify that `oc apply` successfully applied the change to `ImageContentSourcePolicy`:
47+
+
48+
[source,terminal]
49+
----
50+
$ oc get ImageContentSourcePolicy -o yaml
51+
----
52+
+
53+
.Example output
54+
55+
[source,yaml]
56+
----
57+
apiVersion: v1
58+
items:
59+
- apiVersion: operator.openshift.io/v1alpha1
60+
kind: ImageContentSourcePolicy
61+
metadata:
62+
annotations:
63+
kubectl.kubernetes.io/last-applied-configuration: |
64+
{"apiVersion":"operator.openshift.io/v1alpha1","kind":"ImageContentSourcePolicy","metadata":{"annotations":{},"name":"redhat-operator-index"},"spec":{"repositoryDigestMirrors":[{"mirrors":["local.registry:5000"],"source":"registry.redhat.io"}]}}
65+
...
66+
----
67+
68+
After you update the `ImageContentSourcePolicy` resource, {product-title} deploys the new settings to each node and the cluster starts using the mirrored repository for requests to the source repository.

updating/updating-restricted-network-cluster.adoc

+5
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,13 @@ include::modules/update-restricted.adoc[leveloffset=+1]
5555

5656
include::modules/images-configuration-registry-mirror.adoc[leveloffset=+1]
5757

58+
include::modules/generating-icsp-object-scoped-to-a-registry.adoc[leveloffset=+1]
59+
5860
[id="additional-resources_security-container-signature"]
5961
== Additional resources
62+
63+
* xref:../operators/admin/olm-restricted-networks.adoc#olm-restricted-networks[Using Operator Lifecycle Manager on restricted networks]
64+
6065
* xref:../post_installation_configuration/machine-configuration-tasks.adoc#machine-config-overview-post-install-machine-configuration-tasks[Machine Config Overview]
6166

6267
* xref:../updating/installing-update-service.adoc#installing-update-service[Installing and configuring the OpenShift Update Service]

0 commit comments

Comments
 (0)