feat(gateway-api): ADR-060 Fase 1.1 — chart a HTTPRoute (Traefik + Gateway API)
All checks were successful
__APP_NAME__ — build & deploy / ¿Credenciales de build listas? (push) Successful in 1s
__APP_NAME__ — build & deploy / Calidad + build + push (push) Has been skipped
__APP_NAME__ — build & deploy / ¿Cluster del tenant listo? (push) Has been skipped
__APP_NAME__ — build & deploy / Helm upgrade --install (push) Has been skipped

Sincronizado desde repo IDP templates/ (CHART-SYNC-IDP-GITEA-DRIFT). Reemplaza el
Ingress (rke2-ingress-nginx, EOL marzo 2026) por HTTPRoute (Gateway API) adjunto al
Gateway tenant-gateway que crea stack-deployer (§3c). NetworkPolicy egress kube-system
-> traefik-system. FQDN DOT (ADR-082) preservado.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
ilopez
2026-06-11 21:58:56 -05:00
parent 5eead4f23f
commit 632ad1d507
5 changed files with 69 additions and 55 deletions

View File

@@ -0,0 +1,37 @@
{{- if .Values.httpRoute.enabled }}
# HTTPRoute (gateway.networking.k8s.io/v1) — ADR-060 Fase 1.
# El cluster tenant usa Traefik Proxy + Gateway API (reemplaza rke2-ingress-nginx,
# EOL marzo 2026, sin parches de seguridad). El recurso `Gateway` `tenant-gateway`
# (ns apps) lo crea stack-deployer por tenant (ADR-060 D7 / §3c de su spec); este
# HTTPRoute se le adjunta vía parentRefs.
#
# Lo que NO vive aquí (separación de capas — ADR-060 D6):
# - TLS: lo termina el listener HTTPS del Gateway, que referencia el Secret
# `tenant-wildcard-tls` (cert-manager local del cluster, ADR-060 Fase 2). El
# HTTPRoute solo declara el hostname.
# - force-ssl-redirect (HTTP->HTTPS): config global de Traefik Proxy
# (ports.web.redirectTo.websecure) en el bundle traefik-bootstrap.
# - proxy-body-size: config global de Traefik (transport); Middleware per-route
# solo si se necesita granularidad futura.
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: {{ .Release.Name }}
labels:
{{- include "app.labels" . | nindent 4 }}
spec:
parentRefs:
- name: {{ .Values.httpRoute.gatewayName | default "tenant-gateway" }}
namespace: {{ .Release.Namespace }}
sectionName: https
hostnames:
- {{ .Values.httpRoute.host | quote }}
rules:
- matches:
- path:
type: PathPrefix
value: /
backendRefs:
- name: {{ .Release.Name }}
port: {{ .Values.service.port }}
{{- end }}

View File

@@ -1,35 +0,0 @@
{{- if .Values.ingress.enabled }}
# Ingress estándar networking.k8s.io/v1 con ingressClassName=nginx.
# Razón: el cluster tenant nace con rke2-ingress-nginx por default —
# instalar Traefik añade footprint e inconsistencia respecto al control
# plane (donde Traefik sí está). NGINX Ingress es más portable y permite
# que el tenant siga su exit plan sin lock-in.
# Decisión: APERTURA COVE Sesión 3 (2026-05-19) — ADR-053 §11.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name }}
labels:
{{- include "app.labels" . | nindent 4 }}
annotations:
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/proxy-body-size: {{ .Values.ingress.proxyBodySize | default "10m" | quote }}
spec:
ingressClassName: {{ .Values.ingress.className | default "nginx" }}
tls:
- hosts:
- {{ .Values.ingress.host | quote }}
secretName: {{ .Values.ingress.tlsSecretName | default "apps-wildcard-tls" }}
rules:
- host: {{ .Values.ingress.host | quote }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}
port:
number: {{ .Values.service.port }}
{{- end }}

View File

@@ -1,8 +1,9 @@
{{- if .Values.networkPolicy.enabled }}
# NetworkPolicy mínima del shape: bajo deny-all-default del namespace, permite:
# - Ingress: rke2-ingress-nginx (web-backend público) + Prometheus (scrape de /metrics).
# - Ingress: Traefik Proxy (web-backend público) + Prometheus (scrape de /metrics).
# - Egress: DNS, Harbor (pull en startup), ns-addons del tenant (BD).
# Nota: el cluster tenant usa rke2-ingress-nginx en kube-system, NO Traefik.
# Nota: el cluster tenant usa Traefik Proxy + Gateway API en ns traefik-system
# (ADR-060 Fase 1; reemplaza rke2-ingress-nginx que corría en kube-system).
# Materializada como Helm hook (pre-install/pre-upgrade, weight "-8") para que
# este disponible ANTES de que el Job Alembic (hook weight 0) ejecute su
# InitContainer wait-for-secret — el InitContainer hace REST API call al
@@ -37,12 +38,12 @@ spec:
policyTypes: [Ingress, Egress]
ingress:
# Tráfico HTTP desde rke2-ingress-nginx (Ingress estándar).
# El controller corre en kube-system por default en RKE2.
# Tráfico HTTP desde Traefik Proxy (Gateway API, ADR-060 Fase 1).
# El controller corre en ns traefik-system (lo instala el bundle traefik-bootstrap).
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {{ .Values.networkPolicy.ingressControllerNamespace | default "kube-system" }}
kubernetes.io/metadata.name: {{ .Values.networkPolicy.ingressControllerNamespace | default "traefik-system" }}
ports:
- protocol: TCP
port: 8000