Files
Donavan Fritz 49eac4f945 include https-redirect middleware on generated Ingresses
Adds https-redirect@file to the router.middlewares annotation so static
sites force HTTP → HTTPS automatically. The middleware is defined in
fritzlab/apps/sjc001/infra/traefik/manifests/dynamic-config.yaml and
uses redirectScheme (permanent 308). Safe with cert-manager HTTP-01:
the solver pod's Ingress is generated separately and doesn't pick up
this annotation, so /.well-known/acme-challenge/* on port 80 continues
to reach the solver directly.
2026-05-27 16:30:31 -05:00

42 lines
877 B
Django/Jinja

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ site_k8s }}
namespace: {{ namespace }}
{%- if site_type != "docker" %}
annotations:
traefik.ingress.kubernetes.io/router.middlewares: https-redirect@file,retry-upstream@file
{%- endif %}
spec:
ingressClassName: traefik
tls:
- hosts:
- {{ domain }}
{%- for alias in aliases %}
- {{ alias }}
{%- endfor %}
secretName: {{ site_k8s }}-tls
rules:
- host: {{ domain }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ site_k8s }}
port:
number: 80
{%- for alias in aliases %}
- host: {{ alias }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ site_k8s }}
port:
number: 80
{%- endfor %}