argoproj-labs / argocd-image-updater

Automatic container image update for Argo CD
https://argocd-image-updater.readthedocs.io/en/stable/
Apache License 2.0
1.25k stars 258 forks source link

Update none image fields using image updater #553

Open NissesSenap opened 1 year ago

NissesSenap commented 1 year ago

Is your feature request related to a problem? Please describe. When updating a container image, it's normally not enough to just update the image. You also need to update labels to inform your other third party solution about changes.

For example, datadog needs to this to see the new version that have been deployed https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging/?tab=kubernetes#partial-configuration and same goes for keptn https://github.com/keptn/lifecycle-toolkit#how-to-use.

Describe the solution you'd like We need a similar solution to what flux have implemented

    image: ghcr.io/stefanprodan/podinfo:5.0.0 # {"$imagepolicy": "flux-system:podinfo"}

https://fluxcd.io/flux/guides/image-update/#configure-image-updates where you can easily define a comment in your yaml that makes it possible for the image-updater that it needs to update multiple fields.

This will also make it possible to update other things than images, for example CRDs and any other third party offerings that you might have. As long as you can add a label and image-updater can parse the file for that comment, it should be possible.

Describe alternatives you've considered Personally I don't see any other solutions forward, since the flux community went this way I assume that they consider a number of other solutions as well.

But of course, it doesn't hurt to think of other solutions. But I think this one is the easiest and also most extensiable.

Additional context N/A

jannfis commented 1 year ago

Sorry, but I don't understand this enhancement request, to be honest.

From the Flux documentation, I can't see that they are updating some labels. The markers seem to specify the update policies, similar to what our annotations do.

What is it exactly that you are looking for, here?

NissesSenap commented 1 year ago

So the comment that flux adds to the image can be added to any yaml and updater will update these fields as well.

For example

labels
  version: v1.0.1 # {"$imagepolicy": "flux-system:podinfo"}

This way i can update things like keptn/datadog labels when i update my image.

Does this explain it better @jannfis ? In short i want to be able to change any field i want using the image updater and not just images.

jannfis commented 1 year ago

OK. I understand this now, thanks.

However, Image Updater doesn't modify or mutate any YAML at all. It works by parameterizing Argo CD to render your application's source (Helm or Kustomize) in a certain way.

If you use Helm, you could just use the parameters that Image Updater sets as the values for some of your labels or annotations.

NissesSenap commented 1 year ago

Don't you update the application yaml using git https://argocd-image-updater.readthedocs.io/en/stable/configuration/applications/#configuring-the-write-back-method?

But at it's core this is the problem. To actually use the image updater we need to support updating other things then images and not just update application CRDs.

I fully understand if you don't agree with this statement but for me the current functionality that the image updater provides, solves the basic problem. But sadly it don't solve the whole thing of actually managing image updates since multiple third party resources that i assume many of the community use actually needs this to be able to visualize changes in a good way. Maybe people have solved this trough CI magic, but then they - probably don't use this feature at all.

Unless i miss something really obvious on how to solve this problem? If so please share how i should think/solve this.

But i understand that what i suggest is too solve this in whole other way and once again i understand if you/rest of the community don't agree work this.

aaaaahaaaaa commented 1 year ago

I agree that Flux's image updater offer a far better experience for the reasons @NissesSenap describes. But it's always been a first class citizen there for as far as I remember, which is only changing now when it comes to ArgoCD.

I currently face a different scenario where updating images outside of the image field would be very useful: images defined as variables in an Application Helm values.