title: Escaping helm yml for deployment
body: <p>I am trying to figure out how to escape these pieces of a yml file in order to use with helm.  </p>
  
  <pre><code>            - name: SYSLOG_TAG
                value: '{{ index .Container.Config.Labels "io.kubernetes.pod.namespace" }}[{{ index .Container.Config.Labels "io.kubernetes.pod.name" }}]'
              - name: SYSLOG_HOSTNAME
                value: '{{ index .Container.Config.Labels "io.kubernetes.container.name" }}'
  </code></pre>
  
  <p>The yml file is a DaemonSet for sending logs to papertrail with instructions here for a standard kubernetes manual deployment <a href="https://help.papertrailapp.com/kb/configuration/configuring-centralized-logging-from-kubernetes/" rel="nofollow noreferrer">https://help.papertrailapp.com/kb/configuration/configuring-centralized-logging-from-kubernetes/</a> .  Here is a link to the full yml file <a href="https://help.papertrailapp.com/assets/files/papertrail-logspout-daemonset.yml" rel="nofollow noreferrer">https://help.papertrailapp.com/assets/files/papertrail-logspout-daemonset.yml</a> .    </p>
  
  <p>I found some answers on how to escape the curly braces and quotes, but still can't seem to get it to work.  It would be easiest if there was some way to just get helm to not evaluate each entire value.  </p>
  
  <p>The last I tried was this, but still results in an error.   </p>
  
  <pre><code>              value: ''"{{" index .Container.Config.Labels \"io.kubernetes.pod.namespace\" "}}"["{{" index .Container.Config.Labels \"io.kubernetes.pod.name\" "}}"]''
              - name: SYSLOG_HOSTNAME
                value: ''"{{" index .Container.Config.Labels \"io.kubernetes.container.name\" "}}"''
  </code></pre>
  
  <p>This is the error:</p>
  
  <pre><code>Error: UPGRADE FAILED: YAML parse error on templates/papertrail-logspout-daemonset.yml: error converting YAML to JSON: yaml: line 21: did not find expected key
  </code></pre>
  
  <p>I can hardcode values for both of these and it works fine.  I don't quite understand how these env variables work, but what happens is that logs are sent to papertrail for each pod in a node with the labels from each of those pods.  Namespace, pod name, and container name.   </p>
  
  <pre><code>          env:
              - name: ROUTE_URIS
                value: "{{ .Values.backend.log.destination }}"
  {{ .Files.Get "files/syslog_vars.yaml" | indent 13 }}
  </code></pre>