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
.