Skip to content

Commit 7191fa9

Browse files
authored
Merge pull request #48766 from xenolinux/mirror-reg-config
BZ2056385: Adds mirror registry example
2 parents 86a19f8 + 0542f74 commit 7191fa9

File tree

1 file changed

+69
-16
lines changed

1 file changed

+69
-16
lines changed

modules/images-configuration-registry-mirror.adoc

Lines changed: 69 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,32 @@ spec:
7777
repositoryDigestMirrors:
7878
- mirrors:
7979
- example.io/example/ubi-minimal <1>
80-
source: registry.access.redhat.com/ubi8/ubi-minimal <2>
81-
- mirrors:
82-
- example.com/example/ubi-minimal
83-
source: registry.access.redhat.com/ubi8/ubi-minimal
80+
- example.com/example/ubi-minimal <2>
81+
source: registry.access.redhat.com/ubi8/ubi-minimal <3>
8482
- mirrors:
8583
- mirror.example.com/redhat
86-
source: registry.redhat.io/openshift4 <3>
84+
source: registry.redhat.io/openshift4 <4>
85+
- mirrors:
86+
- mirror.example.com
87+
source: registry.redhat.io <5>
88+
- mirrors:
89+
- mirror.example.net/image
90+
source: registry.example.com/example/myimage <6>
91+
- mirrors:
92+
- mirror.example.net
93+
source: registry.example.com/example <7>
94+
- mirrors:
95+
- mirror.example.net/registry-example-com
96+
source: registry.example.com <8>
8797
----
8898
<1> Indicates the name of the image registry and repository.
89-
<2> Indicates the registry and repository containing the content that is mirrored.
90-
<3> You can configure a namespace inside a registry to use any image in that namespace. If you use a registry domain as a source, the `ImageContentSourcePolicy` resource is applied to all repositories from the registry.
99+
<2> Indicates multiple mirror repositories for each target repository. If one mirror is down, the target repository can use another mirror.
100+
<3> Indicates the registry and repository containing the content that is mirrored.
101+
<4> You can configure a namespace inside a registry to use any image in that namespace. If you use a registry domain as a source, the `ImageContentSourcePolicy` resource is applied to all repositories from the registry.
102+
<5> If you configure the registry name, the `ImageContentSourcePolicy` resource is applied to all repositories from a source registry to a mirror registry.
103+
<6> Pulls the image `mirror.example.net/image@sha256:...`.
104+
<7> Pulls the image `myimage` in the source registry namespace from the mirror `mirror.example.net/myimage@sha256:...`.
105+
<8> Pulls the image `registry.example.com/example/myimage` from the mirror registry `mirror.example.net/registry-example-com/example/myimage@sha256:...`. The `ImageContentSourcePolicy` resource is applied to all repositories from a source registry to a mirror registry `mirror.example.net/registry-example-com`.
91106

92107
. Create the new `ImageContentSourcePolicy` object:
93108
+
@@ -114,12 +129,12 @@ NAME STATUS ROLES AGE VERSION
114129
ip-10-0-137-44.ec2.internal Ready worker 7m v1.24.0
115130
ip-10-0-138-148.ec2.internal Ready master 11m v1.24.0
116131
ip-10-0-139-122.ec2.internal Ready master 11m v1.24.0
117-
ip-10-0-147-35.ec2.internal Ready,SchedulingDisabled worker 7m v1.24.0
132+
ip-10-0-147-35.ec2.internal Ready worker 7m v1.24.0
118133
ip-10-0-153-12.ec2.internal Ready worker 7m v1.24.0
119134
ip-10-0-154-10.ec2.internal Ready master 11m v1.24.0
120135
----
121136
+
122-
You can see that scheduling on each worker node is disabled as the change is being applied.
137+
The `Imagecontentsourcepolicy` resource does not restart the nodes.
123138

124139
.. Start the debugging process to access the node:
125140
+
@@ -154,20 +169,58 @@ sh-4.2# cat /etc/containers/registries.conf
154169
[source,terminal]
155170
----
156171
unqualified-search-registries = ["registry.access.redhat.com", "docker.io"]
172+
short-name-mode = ""
173+
174+
[[registry]]
175+
prefix = ""
176+
location = "registry.access.redhat.com/ubi8/ubi-minimal"
177+
mirror-by-digest-only = true
178+
179+
[[registry.mirror]]
180+
location = "example.io/example/ubi-minimal"
181+
182+
[[registry.mirror]]
183+
location = "example.com/example/ubi-minimal"
184+
185+
[[registry]]
186+
prefix = ""
187+
location = "registry.example.com"
188+
mirror-by-digest-only = true
189+
190+
[[registry.mirror]]
191+
location = "mirror.example.net/registry-example-com"
192+
157193
[[registry]]
158-
location = "registry.access.redhat.com/ubi8/"
159-
insecure = false
160-
blocked = false
194+
prefix = ""
195+
location = "registry.example.com/example"
196+
mirror-by-digest-only = true
197+
198+
[[registry.mirror]]
199+
location = "mirror.example.net"
200+
201+
[[registry]]
202+
prefix = ""
203+
location = "registry.example.com/example/myimage"
161204
mirror-by-digest-only = true
205+
206+
[[registry.mirror]]
207+
location = "mirror.example.net/image"
208+
209+
[[registry]]
162210
prefix = ""
211+
location = "registry.redhat.io"
212+
mirror-by-digest-only = true
163213
164214
[[registry.mirror]]
165-
location = "example.io/example/ubi8-minimal"
166-
insecure = false
215+
location = "mirror.example.com"
216+
217+
[[registry]]
218+
prefix = ""
219+
location = "registry.redhat.io/openshift4"
220+
mirror-by-digest-only = true
167221
168222
[[registry.mirror]]
169-
location = "example.com/example/ubi8-minimal"
170-
insecure = false
223+
location = "mirror.example.com/redhat"
171224
----
172225

173226
.. Pull an image digest to the node from the source and check if it is resolved by the mirror. `ImageContentSourcePolicy` objects support image digests only, not image tags.

0 commit comments

Comments
 (0)