Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Templated values in HelmRelease #368

Closed
fllaca opened this issue Apr 11, 2020 · 5 comments
Closed

Templated values in HelmRelease #368

fllaca opened this issue Apr 11, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@fllaca
Copy link
Contributor

fllaca commented Apr 11, 2020

Describe the feature
In the same way values are injected from configMaps or secrets, it would be really useful that you could specify a section of templated values that will be rendered from other values previously specified.

An example of the proposed spec:

---
apiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
  name: prometheus
  namespace: monitoring
spec:
  releaseName: prometheus
  chart:
    name: prometheus
    version: 10.4.0
    repository: https://kubernetes-charts.storage.googleapis.com
  valuesFrom:
  - secretKeyRef:
      name: alertmanager-secrets
  values:
    environment_name: env
  templatedValues:
    values:
      ingress:
        host_name: "prometheus.{{ .Values.environment_name }}.my.company.com"
    valuesFrom:
       - configMapKeyRef:
            name: config-map-containing-more-templated-values

This is basically the same as helm/helm#2492, but moving it to the Flux Helm Operator layer instead. The solution proposed in that issue is basically adapting your helm chart and using "tpl" function, but in the case of complex charts (like big "composite" charts) this is not always easily feasible.

Not sure if this feature makes sense as part of the Helm operator, just dropping the idea here.

Thanks for this great project!

@fllaca fllaca added blocked needs validation In need of validation before further action enhancement New feature or request labels Apr 11, 2020
@fllaca fllaca changed the title Templated values in Helm Release Templated values in HelmRelease Apr 12, 2020
@hiddeco
Copy link
Member

hiddeco commented Apr 20, 2020

The combination of .spec.valuesFrom and .spec.values in a HelmRelease is nothing more than merging the values provided there together and passing them to Helm as you would pass a -f values.yaml to helm [install|upgrade].

As long as Helm does not offer an option to inject this, it will not be supported by the Helm Operator as we rely directly on Helm's templating engine (and utilities) to make releases.

@hiddeco hiddeco removed the blocked needs validation In need of validation before further action label Apr 20, 2020
@fllaca
Copy link
Contributor Author

fllaca commented May 19, 2020

Thanks @hiddeco , makes total sense. Closing this issue

@fllaca fllaca closed this as completed May 19, 2020
@airtonix
Copy link

sorry to bring this up again, but can we achieve this anothe way: generate the configmap from which we derive the values?

@kingdonb
Copy link
Member

@airtonix Have you seen https://fluxcd.io/flux/guides/helmreleases/#refer-to-values-in-configmaps-generated-with-kustomize by any chance?

BTW, this repo is for Helm Operator, and will likely be archived soon:

@airtonix
Copy link

airtonix commented Oct 2, 2022

my bad

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants