In Flux 2, how to apply a manual update of a HelmRelease?

595 views Asked by At

How do I manually trigger the FluxCD (v2) Helm Controller to re-apply a named HelmRelease, without flux restoring that HelmRelease to match the version stored in git?

Normally (for GitOps), we would want flux to maintain our infrastructure (kubernetes cluster resources) so as to stay in sync with our code (git repo) and to remediate any drift that occurs. But occasionally for debugging it is useful to quickly test a series of changes (by directly editing a cluster resource) without making any commits in git. For other kinds of resource we can do this by temporarily suspending flux reconciliation, but for HelmReleases how do we force the FluxCD Helm Controller to make downstream resources match the HelmRelease?

1

There are 1 answers

0
benjimin On

In flux 2, one way to manually trigger a reconciliation (without needing to make a commit, e.g. to remove any drift) is to use the flux CLI to first suspend and then resume reconciliation of the resource (i.e., of the Kustomization or HelmRelease).

Typically, a HelmRelease might be deployed from the repo via a Kustomization. In that case, you could try suspending the ks, live editing the hr, then even suspending and resuming reconciliation of the hr only.

Rather than relying solely on live edits for debugging, a different approach is to reconfigure the resource to be synced from a private repo branch. The experimental changes can then be performed by pushing to that branch, and afterward the resource can be restored to sync from the original repo again (and the private branch can be deleted, or squashed into a pull request).