feat(helm): Traefik IngressRoute + cert-manager Certificate

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>
This commit is contained in:
2026-04-26 22:55:52 -04:00
parent b0f0cd2c16
commit 7238095a77
2 changed files with 66 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
{{- if .Values.ingressRoute.enabled }}
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ .Values.ingressRoute.tls.secretName }}
labels: {{- include "ezscale-website.labels" . | nindent 4 }}
spec:
secretName: {{ .Values.ingressRoute.tls.secretName }}
issuerRef:
kind: ClusterIssuer
name: {{ .Values.ingressRoute.tls.issuerName }}
dnsNames:
{{- range .Values.ingressRoute.hosts }}
- {{ . | quote }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,50 @@
{{- 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 }}