180 lines
9.8 KiB
YAML
180 lines
9.8 KiB
YAML
# SPA Angular (shell OIDC + admin de catalogos + cadastro de Atleta) consumindo
|
|
# o BFF. Substitui o stub estatico nginx/configMap. Roteado em / no ingress.
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: frontend-spa
|
|
namespace: plataforma-prod
|
|
labels:
|
|
app: frontend-spa
|
|
athleticmap.io/contexto: frontend
|
|
spec:
|
|
replicas: 1
|
|
selector: { matchLabels: { app: frontend-spa } }
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: frontend-spa
|
|
athleticmap.io/contexto: frontend
|
|
athleticmap.io/bff-aqui: "true"
|
|
spec:
|
|
containers:
|
|
- name: frontend-spa
|
|
# Tag alinhada com o tenant `escolinha`, que e o mais atual do
|
|
# cluster. A que estava aqui vinha do molde defasado deste
|
|
# repositorio, e nenhum tenant real a usava mais.
|
|
#
|
|
# O preco disso apareceu no primeiro deploy: com
|
|
# `servico-financeiro:1.0`, o Flyway aplicou UMA migracao (V001) e
|
|
# parou — a imagem foi construida antes de V002..V007 existirem, e a
|
|
# tabela `plano_financeiro` nem chegou a ser criada. "Imagem
|
|
# presente no no" nao e o mesmo que "imagem atual".
|
|
image: docker.io/library/frontend-spa:2.83-lp-medicao
|
|
imagePullPolicy: Never
|
|
ports: [{ containerPort: 80 }]
|
|
env:
|
|
- { name: ATM_KC_URL, value: "https://auth-plataforma.athleticmap.com" }
|
|
- { name: ATM_REALM, value: "athleticmap" }
|
|
- { name: ATM_CLIENT, value: "spa" }
|
|
- { name: ATM_TENANT, value: "plataforma" }
|
|
# Plano do tenant, lido pela BarreiraDePlano (P3.7). Sem esta
|
|
# variavel o servico nasce Bronze e responde 403 no que e pago.
|
|
- { name: ATM_PLANO, value: "institucional" }
|
|
# P4.6 — o roteamento interno do nginx, com FQDN.
|
|
#
|
|
# O `resolver` do nginx NAO aplica os `search` do /etc/resolv.conf:
|
|
# `servico-bff` sozinho nao resolve, e a resposta e 502. Medido aqui
|
|
# em 2026-09-22, no log do proprio pod:
|
|
# "servico-bff could not be resolved (3: Host not found)",
|
|
# request: "POST /api/plataforma/provisionamentos"
|
|
#
|
|
# Os quatro tenants foram corrigidos mais cedo no mesmo dia; o
|
|
# plataforma ficou de fora, e so apareceu porque ele NAO tem
|
|
# catch-all /api — entao uma rota sem linha propria cai no frontend,
|
|
# e e ali que o defeito estava esperando.
|
|
#
|
|
# Aqui NAO ha runtime consolidado: os tres apontam para o BFF, que e
|
|
# o que `render-config.sh` ja faria por padrao — a diferenca e o FQDN.
|
|
# P4.6 fechado 2026-09-26: o BFF e o SEGUNDO CONTAINER deste
|
|
# mesmo pod (ver o container 'servico-bff' abaixo) — sem
|
|
# Deployment proprio. `127.0.0.1` porque os dois containers
|
|
# do pod compartilham a rede. O Service `servico-bff` continua
|
|
# existindo, so com o `selector` mudado para o rotulo
|
|
# `athleticmap.io/bff-aqui` deste pod — quem aponta direto para ele
|
|
# (o webhook do Garmin do escolinha, e o Prometheus) nao
|
|
# precisou de nenhuma edicao.
|
|
- { name: ATM_BFF_URL, value: "http://127.0.0.1:8083" }
|
|
- { name: ATM_API_URL, value: "http://servico-bff.plataforma-prod.svc.cluster.local" }
|
|
resources:
|
|
requests: { cpu: 50m, memory: 64Mi }
|
|
limits: { cpu: 200m, memory: 128Mi }
|
|
volumeMounts:
|
|
- name: publico
|
|
mountPath: /usr/share/nginx/html/publico
|
|
readOnly: true
|
|
readinessProbe:
|
|
httpGet: { path: /, port: 80 }
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
- name: servico-bff
|
|
# Tag alinhada com o tenant `escolinha`, que e o mais atual do
|
|
# cluster. A que estava aqui vinha do molde defasado deste
|
|
# repositorio, e nenhum tenant real a usava mais.
|
|
#
|
|
# O preco disso apareceu no primeiro deploy: com
|
|
# `servico-financeiro:1.0`, o Flyway aplicou UMA migracao (V001) e
|
|
# parou — a imagem foi construida antes de V002..V007 existirem, e a
|
|
# tabela `plano_financeiro` nem chegou a ser criada. "Imagem
|
|
# presente no no" nao e o mesmo que "imagem atual".
|
|
image: docker.io/library/servico-bff:1.98-barreira-de-plano
|
|
imagePullPolicy: Never
|
|
ports: [{ containerPort: 8083 }]
|
|
env:
|
|
- { name: ATM_CONFIG_URL, value: "http://servico-configuracao" }
|
|
- { name: ATM_CADASTRO_URL, value: "http://servico-cadastro" }
|
|
- { name: ATM_ORGANIZACAO_URL, value: "http://servico-organizacao" }
|
|
- { name: ATM_PLANEJAMENTO_URL, value: "http://servico-planejamento" }
|
|
- { name: ATM_CAMPEONATO_URL, value: "http://servico-campeonato" }
|
|
- { name: ATM_SAUDE_URL, value: "http://servico-saude" }
|
|
- { name: ATM_FINANCEIRO_URL, value: "http://servico-financeiro" }
|
|
- { name: ATM_JWK_SET_URI, value: "http://keycloak:8080/realms/athleticmap/protocol/openid-connect/certs" }
|
|
- { name: ATM_ISSUER, value: "https://auth-plataforma.athleticmap.com/realms/athleticmap" }
|
|
- { name: ATM_TENANT, value: "plataforma" }
|
|
# Plano do tenant, lido pela BarreiraDePlano (P3.7). Sem esta
|
|
# variavel o servico nasce Bronze e responde 403 no que e pago.
|
|
- { name: ATM_PLANO, value: "institucional" }
|
|
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
|
|
|
|
volumes:
|
|
- name: publico
|
|
projected:
|
|
sources:
|
|
- configMap:
|
|
name: frontend-publico-texto
|
|
items:
|
|
- { key: "_estilo.css", path: "_estilo.css" }
|
|
- { key: "consentimento.js", path: "consentimento.js" }
|
|
- { key: "fontes--fontes.css", path: "fontes/fontes.css" }
|
|
- { key: "lp-escolinhas.css", path: "lp-escolinhas.css" }
|
|
- { key: "lp-escolinhas.html", path: "lp-escolinhas.html" }
|
|
- { key: "lp-escolinhas.js", path: "lp-escolinhas.js" }
|
|
- { key: "minha-conta.css", path: "minha-conta.css" }
|
|
- { key: "minha-conta.html", path: "minha-conta.html" }
|
|
- { key: "minha-conta.js", path: "minha-conta.js" }
|
|
- { key: "painel.css", path: "painel.css" }
|
|
- { key: "painel.html", path: "painel.html" }
|
|
- { key: "painel.js", path: "painel.js" }
|
|
- { key: "planos-modulos.json", path: "planos-modulos.json" }
|
|
- { key: "preparando.html", path: "preparando.html" }
|
|
- { key: "preparando.js", path: "preparando.js" }
|
|
- { key: "privacidade.html", path: "privacidade.html" }
|
|
- { key: "termos.html", path: "termos.html" }
|
|
- configMap:
|
|
name: frontend-publico-binario
|
|
items:
|
|
- { key: "fontes--Barlow-400-latin-ext.woff2", path: "fontes/Barlow-400-latin-ext.woff2" }
|
|
- { key: "fontes--Barlow-400-latin.woff2", path: "fontes/Barlow-400-latin.woff2" }
|
|
- { key: "fontes--Barlow-500-latin-ext.woff2", path: "fontes/Barlow-500-latin-ext.woff2" }
|
|
- { key: "fontes--Barlow-500-latin.woff2", path: "fontes/Barlow-500-latin.woff2" }
|
|
- { key: "fontes--Barlow-600-latin-ext.woff2", path: "fontes/Barlow-600-latin-ext.woff2" }
|
|
- { key: "fontes--Barlow-600-latin.woff2", path: "fontes/Barlow-600-latin.woff2" }
|
|
- { key: "fontes--Barlow-700-latin-ext.woff2", path: "fontes/Barlow-700-latin-ext.woff2" }
|
|
- { key: "fontes--Barlow-700-latin.woff2", path: "fontes/Barlow-700-latin.woff2" }
|
|
- { key: "fontes--IBMPlexMono-500-latin-ext.woff2", path: "fontes/IBMPlexMono-500-latin-ext.woff2" }
|
|
- { key: "fontes--IBMPlexMono-500-latin.woff2", path: "fontes/IBMPlexMono-500-latin.woff2" }
|
|
- { key: "fontes--Poppins-500-latin-ext.woff2", path: "fontes/Poppins-500-latin-ext.woff2" }
|
|
- { key: "fontes--Poppins-500-latin.woff2", path: "fontes/Poppins-500-latin.woff2" }
|
|
- { key: "fontes--Poppins-600-latin-ext.woff2", path: "fontes/Poppins-600-latin-ext.woff2" }
|
|
- { key: "fontes--Poppins-600-latin.woff2", path: "fontes/Poppins-600-latin.woff2" }
|
|
- { key: "fontes--Poppins-700-latin-ext.woff2", path: "fontes/Poppins-700-latin-ext.woff2" }
|
|
- { key: "fontes--Poppins-700-latin.woff2", path: "fontes/Poppins-700-latin.woff2" }
|
|
- { key: "fontes--Poppins-800-latin-ext.woff2", path: "fontes/Poppins-800-latin-ext.woff2" }
|
|
- { key: "fontes--Poppins-800-latin.woff2", path: "fontes/Poppins-800-latin.woff2" }
|
|
- { key: "img--hero-escolinha.jpg", path: "img/hero-escolinha.jpg" }
|
|
- { key: "img--logo-athletic-map.png", path: "img/logo-athletic-map.png" }
|
|
- { key: "produto-dashboard.webp", path: "produto-dashboard.webp" }
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: frontend-spa
|
|
namespace: plataforma-prod
|
|
labels:
|
|
app: frontend-spa
|
|
spec:
|
|
selector: { app: frontend-spa }
|
|
ports: [{ name: http, port: 80, targetPort: 80 }]
|