feat: update traefik field for multiple hosts

This commit is contained in:
Loïc Kalbermatter 2024-06-10 15:49:20 +02:00
parent 6060312074
commit fc8252ee23
Signed by: PulseDev
GPG Key ID: 0516267FEC58F5F3
3 changed files with 7 additions and 4 deletions

View File

@ -41,6 +41,7 @@ Helm Chart for Stalwart Mail Server - Secure & Modern All-in-One Mail Server (IM
| service.ports.submission | int | `587` | | | service.ports.submission | int | `587` | |
| service.type | string | `"NodePort"` | | | service.type | string | `"NodePort"` | |
| traefik.enabled | bool | `false` | | | traefik.enabled | bool | `false` | |
| traefik.hosts | list | `[]` | |
| traefik.ports.http | string | `"websecure"` | | | traefik.ports.http | string | `"websecure"` | |
| traefik.ports.imaps | string | `"imaps"` | | | traefik.ports.imaps | string | `"imaps"` | |
| traefik.ports.smtps | string | `"smtps"` | | | traefik.ports.smtps | string | `"smtps"` | |

View File

@ -1,5 +1,5 @@
{{- if .Values.traefik.enabled }} {{- if .Values.traefik.enabled }}
{{- range $port,$entryport := .Values.traefik.ports }} {{- range $port, $entryport := .Values.traefik.ports }}
--- ---
apiVersion: traefik.io/v1alpha1 apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP kind: IngressRouteTCP
@ -9,13 +9,15 @@ spec:
entryPoints: entryPoints:
- {{ $entryport }} - {{ $entryport }}
routes: routes:
- match: HostSNI(`{{ $.Values.traefik.host }}`) {{- range $host := .Values.traefik.hosts }}
- match: HostSNI(`{{ $host }}`)
services: services:
- name: {{ include "stalwart-mail.fullname" $ }} - name: {{ include "stalwart-mail.fullname" $ }}
port: {{ $port }} port: {{ $port }}
proxyProtocol: proxyProtocol:
version: 2 version: 2
{{- end }}
tls: tls:
passthrough: true passthrough: true
{{- end }} {{- end }}
{{- end }}{{/* end-if .enabled */}} {{- end }}

View File

@ -34,7 +34,7 @@ ingress:
traefik: traefik:
enabled: false enabled: false
#host: "mail.example.com" hosts: []
ports: ports:
http: websecure http: websecure
imaps: imaps imaps: imaps