<p>I am trying to configure TLS using edge termination on openshift, am passing the TLS certificates and private key in values.yaml and referring it in route.yaml file, when I execute the helm chart the creation of the route fails due to improper indentation and newlines introduced while copying the certificate from values.yaml to the route.yaml file.</p>
<p>Below are the values.yaml file from which am referring the certificate in the route.yaml file. What is the better way to do this? how can I pass the tls cert and private key from values.yaml with proper indentation.</p>
<p>Values.yaml</p>
<pre><code>route:
  Enabled: true
  annotations:
    haproxy.router.openshift.io/cookie_name: SESSION_XLD
    haproxy.router.openshift.io/disable_cookies: &quot;false&quot;
    haproxy.router.openshift.io/rewrite-target: /
  path: /
  hosts:
    - www.example.com
  tls:
    key:
      -----BEGIN CERTIFICATE-----
      [...]
      -----END CERTIFICATE-----
    certificate:
      -----BEGIN CERTIFICATE-----
      [...]
      -----END CERTIFICATE-----
    caCertificate:
      -----BEGIN CERTIFICATE-----
      [...]
      -----END CERTIFICATE-----
    insecureEdgeTerminationPolicy: Redirect
</code></pre>
<p>route.yaml</p>
<pre><code>{{- if $.Values.route.tls }}
  tls:
    termination: edge
  {{- with $.Values.route.tls }}
    key: |
      {{ .key }}
    certificate: |
      {{ .certificate }}
    caCertificate: |
      {{ .caCertificate }}
    insecureEdgeTerminationPolicy: {{ .insecureEdgeTerminationPolicy }}
  {{- end }}
{{- end }}
</code></pre>

<p>How about try to pass the each certificate to <code>route.yaml</code> with <code>|</code> for preserving the indentation in <code>Values.yaml</code> either as follows ?</p>
<pre><code>  tls:
    key: | &lt;--- add
      -----BEGIN CERTIFICATE-----
      [...]
      -----END CERTIFICATE-----
    certificate: | &lt;--- add
      -----BEGIN CERTIFICATE-----
      [...]
      -----END CERTIFICATE-----
    caCertificate: | &lt;--- add
      -----BEGIN CERTIFICATE-----
      [...]
      -----END CERTIFICATE-----
</code></pre>
