Deploy through ArgoCD with same image name and tag ( image:latest )

Viewed 53

I have started to learn GitOps ArgoCD. I have one basic doubt. I am unable to test ArgoCD because I do not have any Cluster. It will be so kind of you if you can clear my doubts.

  1. As an example currently I am running my deployment using test:1 docker image. Then using Jenkins I upload test:2 and then put test:2 in place of test:1 then ArgoCD detects the change and applies the new image in a cluster. But if before I used test:latest then using Jenkins I uploads a new image with same name test:latest. What will happen now? Will ArgoCD deploy the image ( name and tag of the new and previous image are the same )
1 Answers

If you need automation, you can consider Argo CD Image Updater, which does include in its update strategies:

latest/newest-build - Update to the most recently built image found in a registry

It is important to understand, that this strategy will consider the build date of the image, and not the date of when the image was tagged or pushed to the registry.

If you are tagging the same image with multiple tags, these tags will have the same build date.
In this case, Argo CD Image Updater will sort the tag names lexically descending and pick the last tag name of that list.

For example, consider an image that was tagged with the f33bacd, dev and latest tags.
You might want to have the f33bacd tag set for your application, but Image Updater will pick the latest tag name.

argocd-image-updater.argoproj.io/image-list: myimage=some/image
argocd-image-updater.argoproj.io/myimage.update-strategy: latest
Related