|
| 1 | +//Modules included in the following assemblies |
| 2 | +// |
| 3 | +// * openshift_images/image-configuration.adoc |
| 4 | + |
| 5 | +:_content-type: PROCEDURE |
| 6 | +[id="images-configuration-blocked-payload"] |
| 7 | + |
| 8 | += Blocking a payload registry |
| 9 | + |
| 10 | +In a mirroring configuration, you can block upstream payload registries in a disconnected environment using a `ImageContentSourcePolicy` (ICSP) object. The following example procedure demonstrates how to block the `quay.io/openshift-payload` payload registry. |
| 11 | + |
| 12 | +.Procedure |
| 13 | +. Create the mirror configuration using an `ImageContentSourcePolicy` (ICSP) object to mirror the payload to a registry in your instance. The following example ICSP file mirrors the payload `internal-mirror.io/openshift-payload`: |
| 14 | ++ |
| 15 | +[source,yaml] |
| 16 | +---- |
| 17 | +apiVersion: operator.openshift.io/v1alpha1 |
| 18 | +kind: ImageContentSourcePolicy |
| 19 | +metadata: |
| 20 | + name: my-icsp |
| 21 | +spec: |
| 22 | + repositoryDigestMirrors: |
| 23 | + - mirrors: |
| 24 | + - internal-mirror.io/openshift-payload |
| 25 | + source: quay.io/openshift-payload |
| 26 | +---- |
| 27 | +. After the object deploys onto your nodes, verify that the mirror configuration is set by checking the `/etc/containers/registries.conf` file: |
| 28 | ++ |
| 29 | +.Example output |
| 30 | +[source,terminal] |
| 31 | +---- |
| 32 | +[[registry]] |
| 33 | + prefix = "" |
| 34 | + location = "quay.io/openshift-payload" |
| 35 | + mirror-by-digest-only = true |
| 36 | +
|
| 37 | +[[registry.mirror]] |
| 38 | + location = "internal-mirror.io/openshift-payload" |
| 39 | +---- |
| 40 | +. Use the following command to edit the `image.config.openshift.io` custom resource file: |
| 41 | ++ |
| 42 | +[source,terminal] |
| 43 | +---- |
| 44 | +$ oc edit image.config.openshift.io cluster |
| 45 | +---- |
| 46 | +. To block the payload registry, add the following configuration to the `image.config.openshift.io` custom resource file: |
| 47 | ++ |
| 48 | +[source,yaml] |
| 49 | +---- |
| 50 | +spec: |
| 51 | + registrySource: |
| 52 | + blockedRegistries: |
| 53 | + - quay.io/openshift-payload |
| 54 | +---- |
| 55 | + |
| 56 | +.Verification |
| 57 | +* Verify that the upstream payload registry is blocked by checking the `/etc/containers/registries.conf` file on the node. |
| 58 | ++ |
| 59 | +.Example output |
| 60 | +[source,terminal] |
| 61 | +---- |
| 62 | +[[registry]] |
| 63 | + prefix = "" |
| 64 | + location = "quay.io/openshift-payload" |
| 65 | + blocked = true |
| 66 | + mirror-by-digest-only = true |
| 67 | +
|
| 68 | +[[registry.mirror]] |
| 69 | + location = "internal-mirror.io/openshift-payload" |
| 70 | +---- |
0 commit comments