0

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.

k_vishwanath
  • 1,326
  • 2
  • 20
  • 28

1 Answers1

0

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

edbighead
  • 5,607
  • 5
  • 29
  • 35