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

Proposal: Support to mirror multiple upstream registries #4505

Open
jeffyjf opened this issue Nov 13, 2024 · 2 comments
Open

Proposal: Support to mirror multiple upstream registries #4505

jeffyjf opened this issue Nov 13, 2024 · 2 comments

Comments

@jeffyjf
Copy link

jeffyjf commented Nov 13, 2024

Description

I noticed that distribution currently support to mirror only one upstream registry at a time [1]. But, In many use cases, the container images come from multiple registries (eg: In a kubernetes cluster). So, the feature what support to mirror multiple upstream registries is necessary.

The possible implementation way:

  • containerd is the most popular CSI runtime of kubernetes. And it support Registry Host Namespace [2] feature. By this feature, containerd will add a query parameter ?ns=<source registry host> when pulling image with mirror endpoint. So I propose to add several configuration options like blow:
proxy:
   remotehostquerykey: ns
   remotehostconfigmap:
      registry.k8s.io:
          remoteurl: https://registry.k8s.io
          username: username
          password: password

With this, distribution can identify the source registry of the image, obtain the correct remote URL, and pull and cache images from different registries.

[1] https://distribution.github.io/distribution/recipes/mirror/#gotcha
[2] https://github.com/containerd/containerd/blob/main/docs/hosts.md#registry-host-namespace

@jeffyjf
Copy link
Author

jeffyjf commented Nov 18, 2024

@milosgajdos @Jamstah @wy65701436 asking for review. Thank you in advance.

@milosgajdos
Copy link
Member

Dupe of #3725

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

No branches or pull requests

2 participants