https://rancher.com/ logo
Title
h

hallowed-breakfast-56871

03/26/2023, 9:20 PM
Hey team - Is it possible to use 2 private registries within my registries.yaml? So far I can not make this work (both are to dockerhub)
c

creamy-pencil-82913

03/27/2023, 2:39 AM
If they are both mirroring docker hub, just list them both in the endpoint list
h

hallowed-breakfast-56871

03/27/2023, 2:41 AM
Hmm, I did try this. but it failed. I'd need to check the log. Is this the right format?
configs:
  <http://registry-1.docker.io|registry-1.docker.io>:
    auth:
      username: 1
      password: pass
  <http://registry-1.docker.io|registry-1.docker.io>:
    auth:
      username: 2
      password: word
c

creamy-pencil-82913

03/27/2023, 6:14 AM
That's not two registries, that's just configuring auth for docker.io twice. You need to configure the endpoints section to list your registries as endpoints for docker.io, and then configure auth for your registries.
Can you confirm exactly what you're trying to accomplish?
h

hallowed-breakfast-56871

03/27/2023, 6:20 AM
We have 2 docker hub orgs. One for each platform we host. Our clusters, need to be able to pull private images from both these private docker hub repositories. This is a temporary situation, as we have just acquired one of these platforms from a acquisition. I have plans in place to merge the CI/CD for the two platforms.... but that's going to be 6-8 months away.
c

creamy-pencil-82913

03/27/2023, 6:24 AM
Ah. That is not what mirrors are for then.
And you cannot use registries.yaml to configure multiple credentials. If you're going to put your creds in registries.yaml those creds need to be able to pull any image from that registry.
You'll need to use image pull secrets instead, and ensure that the correct credential secret is used to pull the image.
h

hallowed-breakfast-56871

03/27/2023, 6:27 AM
Ouch, OK. I was trying to avoid managing lots of credentials between all the many namespaces.
Thanks for the information. 😉