2

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 )
Arghya Roy
  • 429
  • 3
  • 13
  • Please only ask one question at a time (especially, it's not obvious to me what "sync pod with GitHub repo" means). My expectation is that, if you build your images tagged `...:latest`, a Kubernetes redeploy will do nothing: the Deployment wants a matching Pod with an image named `...:latest`, which already exists, so it's untouched, and the Node needs an image named `...:latest`, which also already exists, so it's used as-is, and your cluster is using the old code and not the new. – David Maze Sep 11 '22 at 10:11
  • Thanks, So you mean if we use same image name will name tag then ArgoCD will be unable to detect that..and will not deploy new code...Am I right? – Arghya Roy Sep 11 '22 at 10:53
  • That would be the behavior I'd expect from Kubernetes. ArgoCD may have a way to force a restart, but it still wouldn't necessarily work reliably in a multi-node environment. – David Maze Sep 11 '22 at 12:08
  • I have similar answer here https://stackoverflow.com/a/73617541/2854252 – yip102011 Sep 14 '22 at 04:18

1 Answers1

1

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
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    Please note that ArgoCD Image Updater is not considered production-ready by its own [docs](https://argocd-image-updater.readthedocs.io/en/stable/). I have yet to find a production ready solution for that problem....if anybody has a suggestion...? – asturm Jun 01 '23 at 11:36
  • @asturm Good point. I did not find a production ready solution either. – VonC Jun 01 '23 at 11:49