Helm-operator: Extend `chartFileRef` to support files from Helm repository chart sources

Created on 21 Feb 2020  路  3Comments  路  Source: fluxcd/helm-operator

for this usage:

spec:
  # chart: ...
  valuesFrom:
  - chartFileRef:
      # path within the helm chart (from git repo) where environment-prod.yaml is located
      path: overrides/environment-prod.yaml # mandatory
      # If set to true successful retrieval of the values file is no
      # longer mandatory
      optional: true     

What does this path represent exactly. The comment implies that the yaml file is relative within the chart itself (i.e. embedded in the chart?).

OR

Does this mean a path relative from the location of the helm release kind: HelmRelease yaml file that this is declared in? i.e. in the same flux bound git repo that this release is in?

basically its confusing to me.

So for this example below where is overrides/environment-prod.yaml expected to live?

Inside the chart itself?

In the git repo this helm release yaml lives in?

---
apiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
  name: myapp
  namespace: my-apps
  annotations:
    fluxcd.io/automated: "false"
spec:
  releaseName: myapp1
  chart:
    repository: https://raw.githubusercontent.com/bitsofinfo/appdeploy/master/repo
    name: appdeploy
    version: 1.1.15
  valuesFrom:
  - chartFileRef:
      path: overrides/environment-prod.yaml 
      optional: true     
  values:
    image:
      tag: 7.2
enhancement help wanted

Most helpful comment

Hello @hiddeco , looks like i faced the same issue using flux + helm-operator, we have multiple-cluster setup and I am trying splitup kind: HelmRelease config for different clusters for example prometheus-operator has huge list of values and huge list of different custom rule which painful safe and modify in one file.
It would be nice if chartFileRef would be able to use valuesfile from git repo.

All 3 comments

Hello,

From my understanding, since Flux HelmOperator does not clone GitOps repo (HelmOperator doesn't have any arguments about Gitops repo) means that values.yaml cannot be retrieved from repo (relative path).

This means that environment-prod.yaml file should be located at chart itself - this is not "very" gitops. Currently, i'm using valuesFrom configMapKeyRef and seems to work - i need to 'split' helm release spec from values.

It is expected to be a file path relative to the path of the chart.

The reason only Git is supported for now is that we do not untar the chart before installing it, which is a requirement to be able to make use of the file. Changing this should not be much work, it just was less easy to achieve until recently.

Hello @hiddeco , looks like i faced the same issue using flux + helm-operator, we have multiple-cluster setup and I am trying splitup kind: HelmRelease config for different clusters for example prometheus-operator has huge list of values and huge list of different custom rule which painful safe and modify in one file.
It would be nice if chartFileRef would be able to use valuesfile from git repo.

Was this page helpful?
0 / 5 - 0 ratings