Nsen
Nsen

Reputation: 291

Use Release.Name in values.yaml in helm

I am trying to use stable/fluent-bit as a sub-chart in my chart. That chart has a value in values.yaml:

backend:
  es:
    host: elasticsearch

How can I set the value of backend.es.host as something like {Release.Name}-elasticsearch without making changes to the fluent-bit chart?

Upvotes: 12

Views: 10230

Answers (3)

stzov
stzov

Reputation: 176

You can pass the value to backend.es.host like so:

helm install releasename ./mychart/ --set fluent-bit.backend.es.host=releasename-elasticsearch

So the general rule is that you have to prepend the subchart name to the variable path.

Disclaimer: I did not test the specific case with the name having a dash in it but this definitely works with subcharts that their name doesn't include dashes. So if what I wrote does not work straight out of the box, it might need some tweaking on how to pass this specific subchart name.

Upvotes: 0

jacopo sarti
jacopo sarti

Reputation: 1

This should work:

{{ tpl .Release.Name }}-elasticsearch

Upvotes: -7

This should work:

{{ tpl .Release.Name . }}-elasticsearch

Upvotes: -2

Related Questions