apiVersion: "v1"
kind: "Route"
metadata:
  name: "{{obj_name}}"
{% if labels is defined%}
  labels:
{% for key, value in labels.iteritems() %}
    {{key}}: {{value}}
{% endfor %}
{% endif %}
spec:
  host: {{ route_host }}
  tls:
    caCertificate: |
{% for line in tls_ca_cert.split('\n') %}
      {{ line }}
{% endfor %}
    destinationCACertificate: |
{% for line in tls_dest_ca_cert.split('\n') %}
      {{ line }}
{% endfor %}
    termination: reencrypt
  to:
    kind: Service
    name: {{ service_name }}
