From fc8252ee23871569dc0f6a95c48b8d3c0971cda0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Kalbermatter?= Date: Mon, 10 Jun 2024 15:49:20 +0200 Subject: [PATCH] feat: update traefik field for multiple hosts --- README.md | 1 + templates/traefik.yaml | 8 +++++--- values.yaml | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3e85b18..235021a 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ Helm Chart for Stalwart Mail Server - Secure & Modern All-in-One Mail Server (IM | service.ports.submission | int | `587` | | | service.type | string | `"NodePort"` | | | traefik.enabled | bool | `false` | | +| traefik.hosts | list | `[]` | | | traefik.ports.http | string | `"websecure"` | | | traefik.ports.imaps | string | `"imaps"` | | | traefik.ports.smtps | string | `"smtps"` | | diff --git a/templates/traefik.yaml b/templates/traefik.yaml index 1be77ef..46b7275 100644 --- a/templates/traefik.yaml +++ b/templates/traefik.yaml @@ -1,5 +1,5 @@ {{- if .Values.traefik.enabled }} -{{- range $port,$entryport := .Values.traefik.ports }} +{{- range $port, $entryport := .Values.traefik.ports }} --- apiVersion: traefik.io/v1alpha1 kind: IngressRouteTCP @@ -9,13 +9,15 @@ spec: entryPoints: - {{ $entryport }} routes: - - match: HostSNI(`{{ $.Values.traefik.host }}`) + {{- range $host := .Values.traefik.hosts }} + - match: HostSNI(`{{ $host }}`) services: - name: {{ include "stalwart-mail.fullname" $ }} port: {{ $port }} proxyProtocol: version: 2 + {{- end }} tls: passthrough: true {{- end }} -{{- end }}{{/* end-if .enabled */}} +{{- end }} diff --git a/values.yaml b/values.yaml index 7ca8d22..18f5bef 100644 --- a/values.yaml +++ b/values.yaml @@ -34,7 +34,7 @@ ingress: traefik: enabled: false - #host: "mail.example.com" + hosts: [] ports: http: websecure imaps: imaps