Using FluxCD with OCI Helm Charts: Handling Tags in HelmRelease #5113
-
Hi! I'm working on using FluxCD to manage and deploy Helm charts from an OCI repository. My workflow doesn’t use Git directly. Instead, CI pipelines build and publish Helm charts to an OCI repository. A HelmRelease resource in the cluster monitors for changes and applies updates as necessary. I want to use tags from the OCI repository (e.g., prod) to determine the appropriate version of the Helm chart, for example:
This command properly adds a 'prod' tag to the chart, which gave me hope that this approach would work. Here’s my current YAML configuration:
When I apply this configuration, it fails with the error:
If I manually change the ref.tag value in the OCIRepository resource to a specific version (e.g., 1.2.3), it works as expected. The issue seems to be that the HelmRelease interprets the ref.tag value (e.g., prod) as the chart version, even though the version in the Chart.yaml from the OCI repository is correct. A possible workaround To bypass this issue, I started building separate -prod and -dev variants of the chart and updated the OCIRepository to filter using semver:
This works but comes with drawbacks:
An alternative option would be to just do away with chart versioning overall and just build 0.0.0-prod and 0.0.0-dev instead but this also comes with obvious drawbacks. Question Is there a better approach within the FluxCD ecosystem to handle this scenario? Ideally, I’d like to use OCI tags (e.g., prod, dev) for dynamic Helm chart management without introducing additional complexity like environment-specific chart variants. Any insights or suggestions would be greatly appreciated! Edit: in the original version of this post there was an error in the yaml manifests. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Change:
to:
|
Beta Was this translation helpful? Give feedback.
If you try to install the tag
prod
using the helm CLI it will give the same error, that's what I mean. helm-controller does the same as the helm CLI.