{{- if .Values.traefik.enabled }} {{- range $port,$config := .Values.traefik.ports }} --- apiVersion: traefik.io/v1alpha1 kind: IngressRouteTCP metadata: name: {{ include "stalwart-mail.fullname" $ }}-{{ $port }} spec: entryPoints: - {{ $config.entrypoint }} routes: - match: {{ $config.match | default (printf "HostSNI(`%s`)" $.Values.traefik.host) | quote }} services: - name: {{ include "stalwart-mail.fullname" $ }} port: {{ $port }} {{- if $config.proxyProtocol }} proxyProtocol: version: 2 {{- end }} {{- if $config.passthroughTLS }} tls: passthrough: true {{- end }} {{- end }} {{- end }}{{/* end-if .enabled */}}