chore: add traefik deployment and config generation

This commit is contained in:
Bert-Jan Fikse 2025-08-20 15:14:42 +02:00
parent aca6e8dac2
commit 5c5a0e9d51
Signed by: bert-jan
GPG key ID: C1E0AB516AC16D1A
6 changed files with 155 additions and 1 deletions

View file

@ -0,0 +1,30 @@
{% if use_static_services | default(false) %}
http:
routers:
{% for service in all_services %}
{{ service.name }}:
rule: "Host(`{{ service.domain }}`)"
service: {{ service.name }}-service
entryPoints:
{% if use_ssl | default(false) %}
- websecure
tls:
certResolver: letsencrypt
{% else %}
- web
{% endif %}
{% endfor %}
services:
{% for service in all_services %}
{{ service.name }}-service:
loadBalancer:
servers:
- url: "{{ service.upstream_protocol }}://{{ service.backend_host }}:{{ service.port }}"
{% if service.health_check is defined %}
healthCheck:
path: "{{ service.health_check }}"
interval: "30s"
{% endif %}
{% endfor %}
{% endif %}