188 lines
11 KiB
YAML
188 lines
11 KiB
YAML
# RASCUNHO — tenants/plataforma/95-frontend-spa.yaml (commit B). Nao aplicar daqui.
|
|
#
|
|
# frontend-spa 2.85 -> 2.124-conectar e servico-bff 1.98 -> 2.23-inscricao-externa,
|
|
# as MESMAS imagens dos quatro tenants e do molde em 07/10/2026.
|
|
#
|
|
# O que muda, e por que:
|
|
# * nginx do SPA 2.124: `/api/` responde 404 (so passam /bff, os publicos da
|
|
# captacao e o webhook Asaas). O 2.85 repassava QUALQUER /api ao BFF — era o
|
|
# buraco fechado na borda pelo 31-ingress-api-fechada (05/10). O 31- continua.
|
|
# * ATM_API_CORE/OPERACAO_URL apontam para os runtimes, como no escolinha. O
|
|
# ATM_API_SAUDE_URL fica no BFF (nao ha runtime-saude aqui) — o render-config
|
|
# avisa "2 de 3 ATM_API_*_URL diferem"; e esperado, so os contextos de saude
|
|
# caem no destino generico. Alternativa sem aviso: nao definir nenhum dos tres.
|
|
# * BFF: URLs dos 13 contextos (como nos tenants). Os que nao existem aqui
|
|
# (saude, nutricao, pedagogico, assistencia-social) dao erro so na tela deles —
|
|
# igual a hoje com o 1.98.
|
|
# * ATM_MAQUINA_*: o BFF 2.x le a matriz de permissoes com o client `operacao`.
|
|
# ATM_MAQUINA_HOST_PUBLICO = auth-PLATAFORMA. O padrao do BFF e auth.athleticmap.com;
|
|
# com ele o token de maquina sai com `iss` diferente do ATM_ISSUER dos runtimes
|
|
# e toda leitura de maquina da 401 (a matriz cai no padrao/nega).
|
|
# * SEM consentimento-selo, fcm-credenciais e desafio: nao existem neste namespace;
|
|
# o BFF sobe e so registra aviso (mesmo comportamento de hoje).
|
|
# * Volume `publico` e os ConfigMaps frontend-publico-* INALTERADOS: sao a landing,
|
|
# /contratar, /preparando, /minha-conta e /painel-do-dono, publicados a parte.
|
|
# * strategy Recreate NAO: rolling padrao, com a cota do 00-quota.yaml. Se a cota
|
|
# nao for subida, trocar para `strategy: { type: Recreate }` (~40 s de 503 no SPA
|
|
# e nas paginas publicas servidas por este nginx, inclusive a landing).
|
|
---
|
|
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
|
|
image: docker.io/library/frontend-spa:2.137-painel-titulares
|
|
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" }
|
|
- { name: ATM_PLANO, value: "institucional" }
|
|
- { name: ATM_API_CORE_URL, value: "http://runtime-core.plataforma-prod.svc.cluster.local" }
|
|
- { name: ATM_API_OPERACAO_URL, value: "http://runtime-operacao.plataforma-prod.svc.cluster.local" }
|
|
- { 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
|
|
image: docker.io/library/servico-bff:2.33-inicio-banner
|
|
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_DOCUMENTOS_URL, value: "http://servico-documentos" }
|
|
- { name: ATM_ADMINISTRATIVO_URL, value: "http://servico-administrativo" }
|
|
- { name: ATM_ASSISTENCIA_SOCIAL_URL, value: "http://servico-assistencia-social" }
|
|
- { name: ATM_PEDAGOGICO_URL, value: "http://servico-pedagogico" }
|
|
- { name: ATM_NUTRICAO_URL, value: "http://servico-nutricao" }
|
|
- { name: ATM_AGENDA_URL, value: "http://servico-agenda" }
|
|
- { 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" }
|
|
- { name: ATM_PLANO, value: "institucional" }
|
|
- { name: ATM_TRANSCRICAO_URL, value: "http://servico-voz.plataforma-prod.svc:8091" }
|
|
- { name: ATM_MAQUINA_TOKEN_URL, value: "http://keycloak:8080/realms/athleticmap/protocol/openid-connect/token" }
|
|
- { name: ATM_MAQUINA_HOST_PUBLICO, value: "auth-plataforma.athleticmap.com" }
|
|
- name: ATM_MAQUINA_SEGREDO
|
|
valueFrom:
|
|
secretKeyRef: { name: operacao-credentials, key: client-secret, optional: true }
|
|
- { name: GARMIN_FRONTEND_REDIRECT, value: "https://plataforma.athleticmap.com/integracoes/garmin" }
|
|
resources:
|
|
requests: { cpu: 50m, 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: "contratar.css", path: "contratar.css" }
|
|
- { key: "contratar.html", path: "contratar.html" }
|
|
- { key: "contratar.js", path: "contratar.js" }
|
|
- { key: "convite.css", path: "convite.css" }
|
|
- { key: "convite.html", path: "convite.html" }
|
|
- { key: "convite.js", path: "convite.js" }
|
|
- { key: "desafio.js", path: "desafio.js" }
|
|
- { key: "excluir-conta.css", path: "excluir-conta.css" }
|
|
- { key: "excluir-conta.html", path: "excluir-conta.html" }
|
|
- { key: "excluir-conta.js", path: "excluir-conta.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-c4.css", path: "painel-c4.css" }
|
|
- { key: "painel-c4.js", path: "painel-c4.js" }
|
|
- { key: "painel-markdown.js", path: "painel-markdown.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 }]
|