Two IngressRoutes (web → http-to-https redirect, websecure → app) covering all configured hosts. Certificate covers all hosts as SANs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
51 lines
1.6 KiB
YAML
51 lines
1.6 KiB
YAML
{{- if .Values.ingressRoute.enabled }}
|
|
{{- $hostMatch := "" -}}
|
|
{{- range $i, $h := .Values.ingressRoute.hosts -}}
|
|
{{- if eq $i 0 -}}
|
|
{{- $hostMatch = printf "Host(`%s`)" $h -}}
|
|
{{- else -}}
|
|
{{- $hostMatch = printf "%s || Host(`%s`)" $hostMatch $h -}}
|
|
{{- end -}}
|
|
{{- end }}
|
|
---
|
|
apiVersion: traefik.io/v1alpha1
|
|
kind: IngressRoute
|
|
metadata:
|
|
name: {{ include "ezscale-website.fullname" . }}-https
|
|
labels: {{- include "ezscale-website.labels" . | nindent 4 }}
|
|
spec:
|
|
entryPoints: [websecure]
|
|
routes:
|
|
- kind: Rule
|
|
match: {{ $hostMatch }}
|
|
middlewares:
|
|
{{- if .Values.ingressRoute.middlewares.cloudflarewarp.enabled }}
|
|
- name: {{ .Values.ingressRoute.middlewares.cloudflarewarp.name }}
|
|
namespace: {{ .Values.ingressRoute.middlewares.cloudflarewarp.namespace }}
|
|
{{- end }}
|
|
services:
|
|
- name: {{ include "ezscale-website.fullname" . }}
|
|
port: {{ .Values.service.port }}
|
|
tls:
|
|
secretName: {{ .Values.ingressRoute.tls.secretName }}
|
|
---
|
|
apiVersion: traefik.io/v1alpha1
|
|
kind: IngressRoute
|
|
metadata:
|
|
name: {{ include "ezscale-website.fullname" . }}-http
|
|
labels: {{- include "ezscale-website.labels" . | nindent 4 }}
|
|
spec:
|
|
entryPoints: [web]
|
|
routes:
|
|
- kind: Rule
|
|
match: {{ $hostMatch }}
|
|
middlewares:
|
|
{{- if .Values.ingressRoute.middlewares.httpToHttps.enabled }}
|
|
- name: {{ .Values.ingressRoute.middlewares.httpToHttps.name }}
|
|
namespace: {{ .Values.ingressRoute.middlewares.httpToHttps.namespace }}
|
|
{{- end }}
|
|
services:
|
|
- name: {{ include "ezscale-website.fullname" . }}
|
|
port: {{ .Values.service.port }}
|
|
{{- end }}
|