fluxcd / flux

Successor: https://github.com/fluxcd/flux2
https://fluxcd.io
Apache License 2.0
6.9k stars 1.08k forks source link

Incorrect work with resource type HelmRelease #3622

Closed klinch0 closed 2 years ago

klinch0 commented 2 years ago

Describe the bug

unable to update my helm release immediately

Steps to reproduce

  1. create kind: HelmRelease manifest

  2. create GitRepository manifest

  3. wait for the end of reconciliation

  4. edit and push HelmRelease (in my case add file to templates)

  5. commit + push image

  6. edit and push HelmRelease (in my case change chart version in Chart.yaml version)

  7. commit + push image

  8. run command flux reconcile helmrelease releaseName image

  9. see problem

thanks in advance

Expected behavior

  1. see actual helm chart version

Kubernetes version / Distro / Cloud provider

rke2 on bare metal, k8s version: v1.22.6

Flux version

flux: v0.31.4 helm-controller: v0.22.2 kustomize-controller: v0.26.3 notification-controller: v0.24.1 source-controller: v0.25.10

Git provider

github

Container Registry provider

No response

Additional context

No response

Maintenance Acknowledgement

Code of Conduct

klinch0 commented 2 years ago

after a while, flux does its job, the only problem is that I can't do it right away

yebyen commented 2 years ago

This is the Flux v1 repo, (you are using Flux v2)

It sounds like you need to find the Revision (vs the default Chartversion) reconciliation strategy

Please check out the flux-e2e guide for GitRepository based helmrelease and review this section, it may have the answer to your issue:

https://fluxcd.io/docs/flux-e2e/#using-a-gitrepository-backed-or-s3-backed-helmrelease

If this doesn't solve it, please provide further information as it's not clear what error there was - you just said there was a problem but didn't include any error message. Is the issue just that helmrelease needs to undergo another reconcile interval before things start working because the helm chart wasn't ready yet?

klinch0 commented 2 years ago

The problem is that flux updates the release after a change in the git repo, BUT it doesn't do that when the command is called

flux reconcile helmrelease releaseName

I expect that after running this command, flux will immediately update the release according to the changes made to git, but this does not happen and I have to wait for the release update interval to pass

kingdonb commented 2 years ago

flux reconcile helmrelease releaseName will not have any effect before the GitRepository reconcile interval happens.

It will not reconcile through the source unless you call it --with-source

$ flux reconcile helmrelease kube-oidc-proxy --with-source
► annotating GitRepository tremolo-kube-oidc-proxy in flux-system namespace
✔ GitRepository annotated
◎ waiting for GitRepository reconciliation
✔ fetched revision ingress-v1/11f113de3dafd3e6be7a4d28d68664e78c4ca2a2
► annotating HelmRelease kube-oidc-proxy in flux-system namespace
✔ HelmRelease annotated
◎ waiting for HelmRelease reconciliation
✔ applied revision 0.3.2

This should help 👍 if you want to speed things up in general, you should try instrumenting your sources with a Webhook Receiver

klinch0 commented 2 years ago

Thk!