overlay-staging/ingress.yaml
View on GitHub ↗ (opens in a new tab)yaml
# Per-branch deploys rewrite the staging host into {slug}.staging.example.com.
# Keep the host exactly as it appears in the workflow's `staging-domains` input
# so that rewrite matches.
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: app-http
labels:
app.kubernetes.io/component: ingress
spec:
entryPoints:
- web
routes:
- match: Host(`staging.example.com`) && PathPrefix(`/.well-known/acme-challenge`)
kind: Rule
priority: 100
services:
- name: app
port: 80
- match: Host(`staging.example.com`)
kind: Rule
priority: 10
services:
- name: app
port: 80
middlewares:
- name: redirect-to-https
---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: app-https
labels:
app.kubernetes.io/component: ingress
spec:
entryPoints:
- websecure
routes:
- match: Host(`staging.example.com`)
kind: Rule
services:
- name: app
port: 80
middlewares:
- name: staging-basic-auth
- name: staging-noindex
tls:
secretName: app-staging-tls