From 36242ea35c0ebca808aa88d68ee33fb46d1d3bd3 Mon Sep 17 00:00:00 2001 From: ATM Platform Date: Tue, 16 Jun 2026 23:48:55 +0000 Subject: [PATCH] feat(piloto): servico-bff (agregador) + rota /bff --- tenants/piloto/30-apps-stubs.yaml | 1 + tenants/piloto/90-servico-bff.yaml | 55 ++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 tenants/piloto/90-servico-bff.yaml diff --git a/tenants/piloto/30-apps-stubs.yaml b/tenants/piloto/30-apps-stubs.yaml index d356525..0a1f2e0 100644 --- a/tenants/piloto/30-apps-stubs.yaml +++ b/tenants/piloto/30-apps-stubs.yaml @@ -144,6 +144,7 @@ spec: paths: - { path: /api/configuracao, pathType: Prefix, backend: { service: { name: servico-configuracao, port: { number: 80 } } } } - { path: /api/cadastro, pathType: Prefix, backend: { service: { name: servico-cadastro, port: { number: 80 } } } } + - { path: /bff, pathType: Prefix, backend: { service: { name: servico-bff, port: { number: 80 } } } } - { path: /api, pathType: Prefix, backend: { service: { name: backend, port: { number: 80 } } } } - { path: /, pathType: Prefix, backend: { service: { name: frontend, port: { number: 80 } } } } - host: auth-piloto.athleticmap.influxdigital.com.br diff --git a/tenants/piloto/90-servico-bff.yaml b/tenants/piloto/90-servico-bff.yaml new file mode 100644 index 0000000..fbef03f --- /dev/null +++ b/tenants/piloto/90-servico-bff.yaml @@ -0,0 +1,55 @@ +# BFF (Backend-for-Frontend) — ponto unico da SPA; agrega configuracao + cadastro +# com token relay. Stateless (sem banco). Roteado em /bff no ingress do tenant. +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: servico-bff + namespace: piloto-prod + labels: + app: servico-bff + athleticmap.io/contexto: bff +spec: + replicas: 1 + selector: { matchLabels: { app: servico-bff } } + template: + metadata: + labels: + app: servico-bff + athleticmap.io/contexto: bff + spec: + containers: + - name: servico-bff + image: docker.io/library/servico-bff:1.0 + imagePullPolicy: Never + ports: [{ containerPort: 8083 }] + env: + - { name: ATM_CONFIG_URL, value: "http://servico-configuracao" } + - { name: ATM_CADASTRO_URL, value: "http://servico-cadastro" } + - { name: ATM_JWK_SET_URI, value: "http://keycloak:8080/realms/athleticmap/protocol/openid-connect/certs" } + - { name: ATM_ISSUER, value: "https://auth-piloto.athleticmap.influxdigital.com.br/realms/athleticmap" } + - { name: ATM_TENANT, value: "piloto" } + resources: + requests: { cpu: 100m, memory: 256Mi } + limits: { cpu: 500m, memory: 512Mi } + readinessProbe: + httpGet: { path: /bff/health, port: 8083 } + initialDelaySeconds: 20 + periodSeconds: 10 + failureThreshold: 30 + livenessProbe: + httpGet: { path: /actuator/health/liveness, port: 8083 } + initialDelaySeconds: 50 + periodSeconds: 20 + failureThreshold: 6 +--- +apiVersion: v1 +kind: Service +metadata: + name: servico-bff + namespace: piloto-prod + labels: + app: servico-bff +spec: + selector: { app: servico-bff } + ports: [{ name: http, port: 80, targetPort: 8083 }]