3

The standard practice in helm charts is to use {{ template "<chartname>.fullname" . }} for the service name, where the <chartname>.fullname template expands effectively to .Release.Name-.Chart.name. The later can be overridden by .Values.nameOverride, but the former, or the full value, can't. And the former is either administrator-specified or random.

So how do I tell the service I am creating chart for where to connect to its dependencies? The .Release.Name prefix infects both DNS and the environment variables, so I can't use either as is.

For example if I set dependency to stable/mariadb, it will create service like nutty-narwhal-mariadb and provide environment variables NUTTY_NARWHAL_MARIADB_SERVICE_HOST=10.108.77.204 and NUTTY_NARWHAL_MARIADB_SERVICE_PORT=3306. But that's not helpful, because the service I am creating does not know what the prefix is.

Note that the template generated by current helm create does include .Values.fullnameOverride, but the existing charts in main repository like stable/mariadb don't have it, so I can't simply set mariadb.fullnameOverride in my values.yaml.

Jan Hudec
  • 285
  • 1
  • 4
  • 13

1 Answers1

1

Normally your dependencies would be aggregated under the same "umbrella" chart resulting in a single .Release.Name for all of them, meaning that you will be able to point to them in your chart using stuff like .Release.Name-<subchart>. If for some reason you don't want to do it like this and you deploy your dependencies before you deploy your main chart, then you should be able to point them at the location of dependencies by their provisioned name, as you should get it when you installed them.