In the values.yaml we have the below env values and they are refered by templates/deployment.yaml {{- toYaml .Values.env | nindent 12 }}
env:
- name: APPLICATION_PORT
valueFrom:
configMapKeyRef:
name: application-properties
key: application_port
- name: POSTGRES_AUTH_URL
valueFrom:
configMapKeyRef:
name: application-properties
key: postgres_business_auth_url
- name: POSTGRES_DATA_URL
valueFrom:
configMapKeyRef:
name: application-properties
key: postgres_verification_data_url
Trying to change the above and make a template of the ConfigMap name without any success, by receiving the following error:
cannot load values.yaml: error converting YAML to JSON: yaml: invalid map key: map[interface {}]interface {}{"tpl .Values.myConfigMapName .":interface {}(nil)}
myConfigMapName: application-properties
env:
- name: APPLICATION_PORT
valueFrom:
configMapKeyRef:
name: {{ tpl .Values.myConfigMapName . }}
key: application_port
- name: POSTGRES_AUTH_URL
valueFrom:
configMapKeyRef:
name: {{ tpl .Values.myConfigMapName . }}
key: postgres_business_auth_url
- name: POSTGRES_DATA_URL
valueFrom:
configMapKeyRef:
name: {{ tpl .Values.myConfigMapName . }}
key: postgres_verification_data_url
How can I consume a variable from values.yaml and use it within values.yaml ?