I have got several namespaces (iso, dev, sandbox, etc.) which correspond to my different environments. For each environment and thus namespace, there is an associated db. When I deploy my pod with Helm, I would like to inject the namespace inside a value to get the appropriate password .
In my values file I have something that looks like this :
db:
iso: passwordISO
dev: passwordDEV
sandbox: passwordSANDBOX
spec: passwordSPEC
val: passwordVAL
and in my consumer_config file I have this :
db_host: DB_HOST-{{ .Release.Namespace }}
db_port: DB_PORT
db_name: DB_NAME
db_user: DB_PORT
db_password: {{ .Values.db.iso }}
I already tried to use the {{- include }}
pattern but with no success. I also tried {{ .Values.db.{{ .Release.Namespace }}}}
giving me the following error unexpected <.> in operand
Any insight on how to do this or any workaround ?