Commit 1ab04f01 authored by Simon Cornet's avatar Simon Cornet
Browse files

feat: add template for multiple traefik routes

parent f914ca5c
Loading
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -8,6 +8,11 @@ entryPoints:
          scheme: https
  websecure:
    address: ":443"
    transport:
      respondingTimeouts:
        readTimeout: 0
        writeTimeout: 0
        idleTimeout: 0

certificatesResolvers:
  transip:
@@ -25,16 +30,19 @@ providers:

http:
  routers:
    {{ traefik_router_service }}:
      rule: "Host(`{{ traefik_router_host }}`)"
{% for item in traefik_routes %}
    {{ item.service }}:
      rule: "Host(`{{ item.name }}`)"
      entryPoints:
        - websecure
      service: {{ traefik_router_service }}-svc
      service: {{ item.service }}-svc
      tls:
        certResolver: transip

{% endfor %}
  services:
    {{ traefik_router_service }}-svc:
{% for item in traefik_routes %}
    {{ item.service }}-svc:
      loadBalancer:
        servers:
          - url: "{{ traefik_backend_proto }}://{{ traefik_backend_host }}:{{ traefik_backend_port }}"
          - url: "{{ item.proto }}://{{ item.host }}:{{ item.port }}"
{% endfor %}