title: How to read a value from json through Helm charts
body: <p>I have defined value in a json file.</p>
  
  <pre><code>cat templates/encrypt.json
  {"encrypt": "cg8StVXbQJ0gPvMd9o7yrg=="}
  </code></pre>
  
  <p>The value has to be passed to the yaml file as below</p>
  
  <pre><code>-config-file={{ tpl (.Files.Get "encrypt.json") . | b64enc }}  \
  </code></pre>
  
  <p>Below is the helm chart snippet</p>
  
  <pre><code>exec /bin/consul agent \
              -node="${NODE}" \
              -advertise="${POD_IP}" \
              -bind=0.0.0.0 \
              -client=0.0.0.0 \
              {{- if .Values.client.grpc }}
              -hcl="ports { grpc = 8502 }" \
              {{- end }}
              -config-dir=/consul/config \
              {{- range .Values.client.extraVolumes }}
              {{- if .load }}
              -config-dir=/consul/userconfig/{{ .name }} \
              {{- end }}
              {{- end }}
              -datacenter={{ .Values.global.datacenter }} \
              -data-dir=/consul/data \
              -config-file={{ tpl (.Files.Get "encrypt.json") . | b64enc }}  \
              {{- if (.Values.client.join) and (gt (len .Values.client.join) 0) }}
  </code></pre>
  
  <p>When I run my health charts, I get the below error.</p>
  
  <pre><code>Error: unable to decode "": Object 'Kind' is missing in '{"encrypt":"cg8StVXbQJ0gPvMd9o7yrg=="}'
  </code></pre>