route.j2 878 B

1234567891011121314151617181920212223242526272829303132333435
  1. apiVersion: v1
  2. kind: Route
  3. metadata:
  4. name: {{ name }}
  5. {% if labels is defined and labels %}
  6. labels:
  7. {% for k, v in labels.iteritems() %}
  8. {{ k }}: {{ v }}
  9. {% endfor %}
  10. {% endif %}
  11. spec:
  12. host: {{ host }}
  13. to:
  14. kind: {{ to.kind }}
  15. name: {{ to.name }}
  16. {% if tls is defined %}
  17. tls:
  18. termination: {{ tls.termination }}
  19. {% if tls.ca_certificate is defined and tls.ca_certificate | length > 0 %}
  20. CACertificate: |
  21. {{ tls.ca_certificate|indent(6, true) }}
  22. {% endif %}
  23. {% if tls.key is defined and tls.key | length > 0 %}
  24. key: |
  25. {{ tls.key|indent(6, true) }}
  26. {% endif %}
  27. {% if tls.certificate is defined and tls.certificate | length > 0 %}
  28. certificate: |
  29. {{ tls.certificate|indent(6, true) }}
  30. {% endif %}
  31. {% if tls.termination == 'reencrypt' %}
  32. destinationCACertificate: |
  33. {{ tls.destination_ca_certificate|indent(6, true) }}
  34. {% endif %}
  35. {% endif %}