chore: build
This commit is contained in:
@@ -5,6 +5,16 @@ app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Condition Traefik sur le nom d'hôte : l'hôte par défaut, plus les domaines
|
||||
personnalisés du client (extraHosts) — ex. Host(`a.vitrine-omnex.club`) || Host(`boutique.client.fr`).
|
||||
*/}}
|
||||
{{- define "ingressroute.hostRule" -}}
|
||||
{{- $hosts := list (printf "Host(`%s`)" .Values.host) -}}
|
||||
{{- range .Values.extraHosts }}{{ $hosts = append $hosts (printf "Host(`%s`)" .) }}{{ end -}}
|
||||
{{- join " || " $hosts -}}
|
||||
{{- end }}
|
||||
|
||||
{{- define "ingressroute.backendService" -}}
|
||||
{{- .Values.backend.serviceName | default (printf "%s-backend-vitrine-backend" .Release.Namespace) }}
|
||||
{{- end }}
|
||||
|
||||
@@ -18,7 +18,7 @@ spec:
|
||||
routes:
|
||||
# API backend — WAF + headers + rate limit (middlewares partagés, définis
|
||||
# dans le namespace du Traefik commun, référencés cross-namespace).
|
||||
- match: Host(`{{ .Values.host }}`) && (PathPrefix(`/api/`))
|
||||
- match: ({{ include "ingressroute.hostRule" . }}) && PathPrefix(`/api/`)
|
||||
kind: Rule
|
||||
priority: 20
|
||||
middlewares:
|
||||
@@ -29,7 +29,7 @@ spec:
|
||||
port: {{ .Values.backend.servicePort }}
|
||||
|
||||
# Fichiers uploadés — WAF désactivé dans les règles Coraza pour ce path
|
||||
- match: Host(`{{ .Values.host }}`) && PathPrefix(`/uploads/`)
|
||||
- match: ({{ include "ingressroute.hostRule" . }}) && PathPrefix(`/uploads/`)
|
||||
kind: Rule
|
||||
priority: 15
|
||||
middlewares:
|
||||
@@ -40,7 +40,7 @@ spec:
|
||||
port: {{ .Values.backend.servicePort }}
|
||||
|
||||
# Frontend SPA — WAF + headers + rate limit
|
||||
- match: Host(`{{ .Values.host }}`)
|
||||
- match: {{ include "ingressroute.hostRule" . }}
|
||||
kind: Rule
|
||||
priority: 1
|
||||
middlewares:
|
||||
|
||||
@@ -2,6 +2,12 @@
|
||||
# (calculé par le control-plane : <namespace>.<domaine vitrine>).
|
||||
host: ""
|
||||
|
||||
# Domaines personnalisés du client (ex. boutique.client.fr), servis EN PLUS de
|
||||
# `host`. Gérés par le control-plane (POST /projects/:id/domain). Le DNS doit
|
||||
# pointer vers le cluster et un certificat couvrant le domaine doit être
|
||||
# déclaré dans le WAF (deploy/chart-gestion/waf-cluster, tls.extra).
|
||||
extraHosts: []
|
||||
|
||||
# Namespace où tourne le Traefik partagé et ses Middlewares (waf-chain,
|
||||
# rate-limit, coraza-waf, security-headers) — voir deploy/chart-gestion/traefik.
|
||||
traefikNamespace: traefik
|
||||
|
||||
Reference in New Issue
Block a user