Flux incorrectly updates HelmReleases when the tag is specified separately from the image, resulting in an invalid image ID error. I think also there's been a regression of the fix for #1290, or it wasn't fixed as I expected from reading that issue description.
HelmRelease for a chart with an imageTag value, e.g. stable/traefik or elastic/filebeat. A sample HelmRelease is included belowimageTag valueapiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
name: traefik
namespace: dev
annotations:
fluxcd.io/automated: "true"
fluxcd.io/tag.chart-image: semver:~1.7
# Tell Flux where to find the tag value
tag.fluxcd.io/traefik: imageTag
spec:
releaseName: belligerent-dog
chart:
repository: https://kubernetes-charts.storage.googleapis.com
name: traefik
version: 1.79.0
rollback:
enable: true
values:
## Default values for Traefik
image: traefik
imageTag: v1.7
Expected behavior
Flux overwrites the imageTag value with the new tag version. Instead, however, it overwrites the image value, appending the tag. This results in Helm attempting to deploy an image like traefik:v1.7.19:v1.7. Flux logs a message stating expected image name as either <image>:<tag> or just <image>: invalid image ID.
Additional context
Add any other context about the problem here, e.g
I wondered if this might be because the traefik tags are v<semver>, rather than just <semver>. However, the following HelmRelease for filebeat displays the same behaviour
apiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
name: filebeat
namespace: waives-system
annotations:
fluxcd.io/automated: "true"
fluxcd.io/tag.chart-image: semver:~7.4
# Tell Flux where to find the tag value
tag.fluxcd.io/traefik: imageTag
spec:
releaseName: filebeat
chart:
repository: https://helm.elastic.co
name: filebeat
version: 7.4.1
values:
image: docker.elastic.co/beats/filebeat
imageTag: 7.4.1
You're missing the repository and filter annotations https://docs.fluxcd.io/en/stable/references/helm-operator-integration.html#annotations
Try this:
apiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
name: filebeat
namespace: waives-system
annotations:
filter.fluxcd.io/filebeat: semver:~7.4
tag.fluxcd.io/filebeat: imageTag
repository.fluxcd.io/filebeat: image
spec:
releaseName: filebeat
chart:
repository: https://helm.elastic.co
name: filebeat
version: 7.4.1
values:
image: docker.elastic.co/beats/filebeat
imageTag: 7.4.1
Thanks @stefanprodan, much appreciated. Good shout on the repository annotation; I'd missed tha tthis was required. I don't understand the relationship between the filter.fluxcd.io/* annotation and the fluxcd.io/tag.chart-image annotation, though, and the docs don't really make this clear AFAICT. Do I not need the fluxcd.io/automated annotation either?
The changes @stefanprodan proposed have resolved the immediate issues, so many thanks for that. I still don't understand why this set worked and the previous one didn't, given the documentation here.
I'm disappointed this was closed without addressing the documentation concerns I raised in my last comment. I've found Flux quite difficult to grasp so far, not least because I'm having to pull together information from 3-4 different (and somewhat sketchy) sources, with inconsistencies across them all. I still don't understand whether the annotations I'd initially used were valid but used incorrectly, or whether they were non-existent now (cf. with the references to the weave.works annotations now replaced with fluxcd.io annotations).
@alastairs Sorry, I thought your query was resolved. Your input is very valuable as a new user, since you are looking at Flux with fresh eyes (and ours are biased after working with Flux for a while).
The tag/repository annotations indicate what image to update (and where to find it in the HelmRelease values) and the filter annotation indicates what registry images are considered as candidates for the update.
You do need the automated annotation.
I'm disappointed this was closed without addressing the documentation concerns I raised in my last comment
I didn't interpret those as concerns, my bad.
I am sorry about your frustrating experience with the documentation. It can always be improved, of course!
Regarding your disappointment, as you know this is a (rather understaffed) open source project, so, I would be really happy if you could channel that frustration/disappointment into documentation improvements so that the whole community wins as a result.
Re-opening the issue until you are satisfied with the outcome, let me know.
The tag/repository annotations indicate what image to update (and where to find it in the HelmRelease values) and the filter annotation indicates what registry images are considered as candidates for the update.
Also, fluxcd.io/tag.chart-image is a legacy and alternative way to supply a filter, where you implicitly refer to an image placed at the top level of the values section.
. I still don't understand whether the annotations I'd initially used were valid but used incorrectly, or whether they were non-existent now
Valid, but they didn't lead to the result you wanted
Regarding your disappointment, as you know this is a (rather understaffed) open source project, so, I would be really happy if you could channel that frustration/disappointment into documentation improvements so that the whole community wins as a result.
Of course! I made a start earlier in the week with #2653 and am more than happy to contribute improvements when and where theyāre clear. Iāll make some notes for a more substantial contributionāthe main thing missing from a new userās perspective is a āgetting startedā guide or similar, and Iām happy to add that when all the steps are straight in my head š
the main thing missing from a new userās perspective is a āgetting startedā guide or similar,
Have you taken a look at https://github.com/fluxcd/flux-get-started ?
Have you taken a look at https://github.com/fluxcd/flux-get-started ?
Yes, but this speaks to my points about pulling the information from multiple different sources of information š There's some information in the documentation, some in this GitHub repo, some in the repo you pointed out, and some in the helm-operator getting started repo too.