Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify usage of registries.conf with different mirrors #1523

Closed
telmich opened this issue Apr 21, 2022 · 3 comments · Fixed by #1525
Closed

Clarify usage of registries.conf with different mirrors #1523

telmich opened this issue Apr 21, 2022 · 3 comments · Fixed by #1525

Comments

@telmich
Copy link

telmich commented Apr 21, 2022

I hope this is the right cri-o repo to report to, if not, please advise.

General Situation

Problem

We cannot specify that a certain mirror is only for certain paths. Thus resulting in a lot of incorrect accesses over the proxies.

Pratical example

The following configuration is taken from a sample kubernetes cluster:

[09:29] server27.place10:~# cat /etc/containers/registries.conf
unqualified-search-registries = ["docker.io"]

[[registry]]
prefix = "docker.io"
location = "registry.hub.docker.com"

[[registry]]
prefix = "quay.io"
location = "quay.io"

# List of our mirrors
[[registry.mirror]]
location = "harbor.ungleich.svc.p10.k8s.ooo/quayio"

[[registry.mirror]]
location = "harbor.ungleich.svc.p10.k8s.ooo/dockerhub"

[[registry.mirror]]
location = "harbor.ungleich.svc.c2.k8s.ooo/dockerhub"

[[registry.mirror]]
location = "harbor.ungleich.svc.c2.k8s.ooo/quayio"

As you can see there are 2 quayio mirrors and 2 dockerhub mirrors. We plan to add 3 mirrors per official source for redundancy reasons. Thus per pull request cri-o might fall through 3 incorrect mirrors and then finally access the correct one.

Improvement

We suggest to add a new field, prefix to the mirror list:

[[registry.mirror]]
location = "harbor.ungleich.svc.c2.k8s.ooo/quayio"
prefix="quay.io"

This way only the mirrors with the right prefix would be contacted.

@vrothberg
Copy link
Member

vrothberg commented Apr 21, 2022

Thanks for reaching out, @telmich! You've found the right place for this kind of question.

If you have a dedicated mirror for Docker Hub and a dedicated mirror Quay, an exemplary config may look as follows:

[[registry]]
location = "docker.io"
[[registry.mirror]]
location = "docker.mirror.com"

[[registry]]
location = "quay.io"
[[registry.mirror]]
location = "quay.mirror.com"

Notice that the mirrors are not global for all registries but are associated with the previous registry. This way, when pulling from quay.io only quay.mirror.com will be consulted.

Does that answer your question?

@telmich
Copy link
Author

telmich commented Apr 21, 2022

THAT certainly answers the question! OMG, had we known this earlier... So in this regard I suggest to update the documentation to include the notion of "order matters" and maybe even including your example.

Thanks a lot for the quick clarification, much appreciated!

vrothberg added a commit to vrothberg/image that referenced this issue Apr 21, 2022
Clarify that a `[[registry.mirror]]` is associated only with the
previous `[[registry]]`.

Fixes: containers#1523
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
vrothberg added a commit to vrothberg/image that referenced this issue Apr 21, 2022
Clarify that a `[[registry.mirror]]` is associated only with the
previous `[[registry]]`.

Fixes: containers#1523
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
@vrothberg
Copy link
Member

I opened #1525 to clarify the issue in the man pages.

vrothberg added a commit to vrothberg/image that referenced this issue Apr 22, 2022
Clarify that a `[[registry.mirror]]` is associated only with the
previous `[[registry]]`.

Fixes: containers#1523
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
vrothberg added a commit to vrothberg/image that referenced this issue Apr 22, 2022
Clarify that a `[[registry.mirror]]` is associated only with the
previous `[[registry]]`.

Fixes: containers#1523
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants