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

[QUESTION/HELP] How to use multiple caching proxies at once? #1548

Open
cowwoc opened this issue Jan 28, 2025 · 2 comments
Open

[QUESTION/HELP] How to use multiple caching proxies at once? #1548

cowwoc opened this issue Jan 28, 2025 · 2 comments
Labels
question Further information is requested

Comments

@cowwoc
Copy link

cowwoc commented Jan 28, 2025

Question / Where do you need Help?

Given this warning when creating a new cluster: WARN[0000] More than one registry specified, but the LocalRegistryHostingV1 spec only supports one -> Selecting the first one: k3d-docker-io.localhost how are we supposed to use multiple cache-on-pull docker registries against a single cluster?

My understanding is that I need to specify one local registry per remote registry I am caching (e.g. one for docker hub, another for github repository, etc). Next, I provide k3d with repositories.yaml that indicates which proxy is caching which remote registry.

But what's the point of doing all of this if k3d can only make use of one caching proxy at a time. Am I missing something?

@cowwoc cowwoc added the question Further information is requested label Jan 28, 2025
@cowwoc
Copy link
Author

cowwoc commented Jan 28, 2025

To clarify, if I spin up multiple registries using k3d registry create and pass them into a cluster using k3d cluster create "--disable-default-registry-endpoint@all:*" --registry-use X --registry-use Y --registry-use Z then I see pulls working for X but failing for Y and `Z.

The error I get is:

Failed to pull image "registry.k8s.io/ingress-nginx/kube-webhook-certgen:v1.5.1": failed to pull and unpack image "registry.k8s.io/ingress-nginx/kube-webhook-certgen:v1.5.1": failed to resolve reference "registry.k8s.io/ingress-nginx/kube-webhook-certgen:v1.5.1": failed to do request: Head "http://k3d-registry-k8s-io.localhost:5003/v2/ingress-nginx/kube-webhook-certgen/manifests/v1.5.1?ns=registry.k8s.io": dial tcp 172.19.0.5:5003: connect: connection refused

I am only aware of two ways to have k3d pull from multiple cached repositories:

  1. https://github.com/ligfx/k3d-registry-dockerd
  2. Install the open-source version of https://www.sonatype.com/products/sonatype-nexus-oss-download
  • Create a "docker (proxy)" for each repository
  • Create a "docker (group)" that delegates to the aforementioned repositories
  • Point k3d at the "docker (group)" repository. So from k3d's perspective, it only sees a single local repository.

@cowwoc
Copy link
Author

cowwoc commented Jan 29, 2025

In retrospect, option 1 is pretty damn great. It is far easier to setup than the alternatives, so I started using it. I guess the only remaining question is: does the option recommended by the documentation support multiple repositories? And, if not, then maybe we should recommend option 1 to people instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant