0
votes

I have the following files

mychart/templates/configmap.yaml

apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ .Values.env.{{lle.dev}} }}-configmap
data:
  myvalue: "Hello World"

mychart/values.yaml

env:
  lle.dev: ABC
  lle.qa: CDE

How do I access the values in the helm template? nested curly braces are also not allowed. Also the below didn't work

name: {{ .Values.env.lle.dev }}-configmap

Reason being it is considering lle, dev as a separate sub keys for env and not as a single key.

1
This is a duplicate question. Please see the answeredbighead
@edbighead I did not find the answer for my problem.k_vishwanath
You can access values with {{ .Values.env.lle.dev }}edbighead
it won't work. I tried it already.k_vishwanath

1 Answers

0
votes

Is there a reason you are trying to prefix your variables with lle? If not, you can rewrite your values.yaml file in the following way:

env:
  lle: 
    dev: ABC
    qa: CDE

Then you will be able to access your variables as in name: {{ .Values.env.lle.dev }}-configmap