How to use helm value in value?

5/21/2020

Is it possible to use helm value in value, for example:

db:
  addr: acid-keycloak-db
  user: kcadmin
  secret: {{ user }}.{{ addr }}.credentials.postgresql.acid.zalan.do  

the output should be:

db:
  addr: acid-keycloak-db
  user: kcadmin
  secret: kcadmin.acid-keycloak-db.credentials.postgresql.acid.zalan.do   
-- zero_coding
kubernetes
kubernetes-helm

1 Answer

5/21/2020

values.yaml

db:
  addr: acid-keycloak-db
  user: kcadmin
  secret: "{{ .Values.db.user }}.{{ .Values.db.addr }}.credentials.postgresql.acid.zalan.do"

In .yaml file where the secret will be used

{{tpl .Values.db.sec . }}
-- hoque
Source: StackOverflow