47

I want to use the postgresql chart as a requirements for my Helm chart.

My requirements.yaml file hence looks like this:

dependencies:
  - name: "postgresql"
    version: "3.10.0"
    repository: "@stable"

In the postgreSQL Helm chart I now want to set the username with the property postgresqlUsername (see https://github.com/helm/charts/tree/master/stable/postgresql for all properties).

Where do I have to specify this property in my project so that it gets propagated to the postgreSQL dependency?

Harold L. Brown
  • 8,423
  • 11
  • 57
  • 109

1 Answers1

69

As described in https://v2.helm.sh/docs/chart_template_guide/#subcharts-and-global-values, in your parent (i.e. not the dependency) chart's values.yaml file, have a section that contains

postgresql:
  postgresUsername: ....
  postgresPassword: ....
  ...

That is, all values under the postgresql key will override the child (postgresql) chart's values.yaml values. Note that if you have aliased the postgresql dependency chart to another name in your requirements.yaml, you should use that other name instead of postgresql.

edit: The corresponding article in v3 is here https://helm.sh/docs/chart_template_guide/subcharts_and_globals/

jhanschoo
  • 1,236
  • 13
  • 15
  • 2
    There appears to be no way to use variables in this context, though. https://github.com/argoproj/argo-cd/issues/4447 – Gajus Sep 29 '20 at 01:07
  • @jhanschoo OMG thank you for the link to docs. I stumbled upon the page several times, but for some reason i did not make it to the part where they rewrite the subchart values, before. – Mailo Světel Dec 22 '20 at 14:40
  • https://github.com/helm/helm/blob/main/docs/chart_template_guide/subcharts_and_globals.md - 404 not found – Anton Patsev Apr 01 '21 at 12:16