Rolling out Helm chart from a Git repository source's primary branch #4648
-
As the title suggests, I'm attempting to have my Helm charts perform an upgrade when the Helm release's Git repository source's primary branch is updated. To better describe my situation, I'll attempt to write out some example mocks for the assets involved. First up, let's assess my Git repository. I have a single repository containing one or more Helm charts. I have set up versioning automation for the Git repository. New release pull requests are created automatically, and after merging them, the Helm chart version and app version are updated accordingly and a new Git tag with a semantic version is created for the Git repository's primary branch. I've set up a Git repository source resource for Flux to consume, as mocked below: apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: git-source
namespace: flux-system
spec:
interval: 10m
ref:
branch: main
timeout: 1m
url: ssh://git@github.com/example/charts I've also set up a Helm release resource for Flux to consume that uses the previously mentioned Git source resource as its source for the Helm chart to install/upgrade: apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: helm-release
namespace: flux-system
spec:
chart:
spec:
chart: charts/example
interval: 12h
sourceRef:
kind: GitRepository
name: git-source
interval: 1h
releaseName: example
targetNamespace: default My Helm charts are versioned however, and I think that causes Flux to roll out my Helm chart on a version that was tagged, but not my Helm chart on the latest commit of the primary branch. Or rather, it appears as if it occasionally happens that Flux rolls out the tagged version, but not the primary branch one, even if my Git repository source resource is up to date with the latest commit of the primary branch. Am I missing some information on what it is exactly what Flux wants to roll out, and are there other ways to resolve this problem? In the end I always want Flux to roll out the Helm chart of the latest commit on the primary branch. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You need to set |
Beta Was this translation helpful? Give feedback.
You need to set
chart.spec.reconcileStrategy
toRevision
, docs here: https://fluxcd.io/flux/components/source/helmcharts/#reconcile-strategy