0

I have read and researched about k8s deployment, but looks like there are no solutions to the issue that I'm about to describe.

Currently, I have a setup where Deployment will pull image from our private Docker registry, let's call this Registry A.

We want to make another private Docker registry, deploy this registry to different environment in hope of better network will yield better pull time. Let's call this Registry B.

Now, to make the system resilient, we want to make the Deployment first pull image from Registry B (because it's supposed to be faster). If for some reasons, it cannot pull from that Registry, only then should it pull from the Registry A.

I'm using Golang with K8S client to apply the Deployment, here is the sample code of applying a deployment.

    c := corev1.Container()
    c.WithName(deploymentName)
    c.WithImage(image)
    c.WithImagePullPolicy("IfNotPresent")

As you can see, the only method of specifying the image for the Deployment is using WithImage.

If one of you have run into this problem, please let me know how you can tackle this one.

Update:

Loc Truong
  • 359
  • 5
  • 22
  • 1
    https://stackoverflow.com/questions/63266765/kubernetes-deployment-specify-multiple-options-for-image-pull-as-a-fallback After some searching, I've found out that my question is kind of duplicated of this one – Loc Truong Mar 09 '23 at 08:26

0 Answers0