Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Doesn't update & trigger deployment of HelmRelease #2067

Closed
dminca opened this issue May 21, 2019 · 7 comments · Fixed by #2088
Closed

Doesn't update & trigger deployment of HelmRelease #2067

dminca opened this issue May 21, 2019 · 7 comments · Fixed by #2088
Labels
onboarding/activation Particular pertinence to getting Flux up and running

Comments

@dminca
Copy link

dminca commented May 21, 2019

Describe the bug
Regression bug: Flux is not able to match the RegEx pattern of the HelmRelease image label, thus not triggering the update (in git repo) & deployment of the HelmRelease.

To Reproduce
Steps to reproduce the behaviour:
0. Given a Helm Chart with the following values.yaml file:

<snip>
image:
  repository: marcel-registry.com/myapp
  tag: master-231kdsj92
<snip>
  1. Create a HelmRelease with the following values
apiVersion: flux.weave.works/v1beta1
kind: HelmRelease
metadata:
  name: myapp
  namespace: myapp-ns
  annotations:
    flux.weave.works/automated: "true"
    flux.weave.works/tag.chart-image: glob:master-*
spec:
  releaseName: myapp
  chart:
    git: ssh://git@marcel-repo.com/myapp.git
    path: helm/myapp
    ref: master
  values:
    image:
      registry: marcel-registry.com/myapp
      tag: master-3d30e14fd7
  1. Update & Release of HelmRelease actions not firing
  2. No errors reported in the logs (expecting RegEx pattern mismatch thrown)

Expected behavior
Flux detected a new image in the registry and triggered an update of the image label (in git repo) and triggered a deployment of the HelmRelease

Logs

Additional context
Add any other context about the problem here, e.g

  • Flux version: 1.12.2
  • Helm Operator version: 0.9.2
  • Kubernetes version: v1.11.7
  • Git provider: Atlassian Bitbucket
  • Container registry provider: AWS ECR
@dminca dminca added blocked-needs-validation Issue is waiting to be validated before we can proceed bug labels May 21, 2019
@dminca dminca changed the title Not updating & triggering deployment of HelmRelease Doesn't update & trigger deployment of HelmRelease May 21, 2019
@Suigi
Copy link

Suigi commented May 22, 2019

AFAIK you have to provide the image name in the HelmRelease YAML for flux to be able to list the available tags and auto-release new images.

If you list the images using fluxctl list-images you should see that there are no images listed for the HelmRelease:myapp resource. It will probably list them for the Deployment, but the Deployment does not have the automation annotations, the HelmRelease does.

In other words, I would expect the automation to start working if you change your HelmRelease to this:

apiVersion: flux.weave.works/v1beta1
kind: HelmRelease
metadata:
  name: myapp
  namespace: myapp-ns
  annotations:
    flux.weave.works/automated: "true"
    flux.weave.works/tag.chart-image: glob:master-*
spec:
  releaseName: myapp
  chart:
    git: ssh://git@marcel-repo.com/myapp.git
    path: helm/myapp
    ref: master
  values:
    image:
      repository: marcel-registry.com/<image-name>
      tag: master-3d30e14fd7

You can read more about upgrading HelmReleases in the Helm Integration Docs.

@hiddeco
Copy link
Member

hiddeco commented May 22, 2019

Thanks for your comment @Suigi, support like this from the community is highly appreciated 🥇

@dminca the comment from Suigi sums it all up pretty well, Flux needs both the image.repository and the image.tag to be able to automate the workload, once you add the repository I expect it to update the image without any problems.

@hiddeco hiddeco added onboarding/activation Particular pertinence to getting Flux up and running and removed blocked-needs-validation Issue is waiting to be validated before we can proceed bug labels May 22, 2019
@dminca
Copy link
Author

dminca commented May 22, 2019

@Suigi you are right, sorry about that, was a typo on my side.

Not an image name, actually I was referring to the registry URI there in the image.registry.

If you craft the HelmRelease like that, it's not going to pick it up properly.

To overcome this, I've just put the registry + label in the same variable in values.yaml from HelmChart and then update the HelmRelease as in

  values:
    image: marcel-registry.com/myapp:master-3d30e14fd7

Otherwise it's not triggering the deploy.

@hiddeco
Copy link
Member

hiddeco commented May 22, 2019

@dminca for portability I would personally split it in two keys, Flux will be able to detect image.repository and image.tag, which makes it easier to just modify the tag for whatever reason you may have.

In addition; are you okay with me closing the issue as it looks like it's working for you now?

@dminca
Copy link
Author

dminca commented May 23, 2019

I've already addressed this issue to @stefanprodan at KubeCon.

I wouldn't close it until there's this thing written in the docs, that it requires the full registry url and image label in the same variable; otherwise more people will raise it and you'll end up with dupes 😅

@hiddeco
Copy link
Member

hiddeco commented May 23, 2019

@dminca would the note added in the PR linked to this issue have helped you?

@dminca
Copy link
Author

dminca commented May 23, 2019

Thank you 👍

dminca added a commit to dminca/flux that referenced this issue May 23, 2019
Update readme to address regression bug that doesn't automatically
trigger HelmRelease deployment if
-> the full Docker Registry URL + image name + image label are not provided
  in a Helm Chart as a single variable (not splitted)
-> which in turn is read by the HelmRelease

Resolves:
Related: fluxcd#2067
Signed-off-by: Daniel Andrei Minca <mandrei17@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
onboarding/activation Particular pertinence to getting Flux up and running
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants