From 37c9c468e8ecbe9a8056c9df28bec26b037c764e Mon Sep 17 00:00:00 2001 From: ATM Platform Date: Tue, 16 Jun 2026 22:52:17 +0000 Subject: [PATCH] feat(piloto): servico-configuracao (bounded context) + rota /api/configuracao --- tenants/piloto/30-apps-stubs.yaml | 1 + tenants/piloto/70-servico-configuracao.yaml | 59 +++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 tenants/piloto/70-servico-configuracao.yaml diff --git a/tenants/piloto/30-apps-stubs.yaml b/tenants/piloto/30-apps-stubs.yaml index 99e347c..cab9569 100644 --- a/tenants/piloto/30-apps-stubs.yaml +++ b/tenants/piloto/30-apps-stubs.yaml @@ -142,6 +142,7 @@ spec: - host: piloto.athleticmap.influxdigital.com.br http: paths: + - { path: /api/configuracao, pathType: Prefix, backend: { service: { name: servico-configuracao, 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/70-servico-configuracao.yaml b/tenants/piloto/70-servico-configuracao.yaml new file mode 100644 index 0000000..d01570f --- /dev/null +++ b/tenants/piloto/70-servico-configuracao.yaml @@ -0,0 +1,59 @@ +# Bounded context "configuracao" como app proprio (ADR-0002): Deployment/pod +# medivel = centro de custo. Schema proprio "configuracao" no Postgres do silo +# (criado pelo Flyway). Roteado em /api/configuracao no ingress do tenant. +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: servico-configuracao + namespace: piloto-prod + labels: + app: servico-configuracao + athleticmap.io/contexto: configuracao +spec: + replicas: 1 + selector: { matchLabels: { app: servico-configuracao } } + template: + metadata: + labels: + app: servico-configuracao + athleticmap.io/contexto: configuracao + spec: + containers: + - name: servico-configuracao + image: docker.io/library/servico-configuracao:1.0 + imagePullPolicy: Never + ports: [{ containerPort: 8083 }] + env: + - { name: SPRING_DATASOURCE_URL, value: "jdbc:postgresql://postgres:5432/athleticmap" } + - { name: SPRING_DATASOURCE_USERNAME, value: "atm" } + - name: SPRING_DATASOURCE_PASSWORD + valueFrom: + secretKeyRef: { name: db-credentials, key: password } + - { 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: 150m, memory: 320Mi } + limits: { cpu: "1", memory: 768Mi } + readinessProbe: + httpGet: { path: /api/configuracao/health, port: 8083 } + initialDelaySeconds: 25 + periodSeconds: 10 + failureThreshold: 30 + livenessProbe: + httpGet: { path: /actuator/health/liveness, port: 8083 } + initialDelaySeconds: 60 + periodSeconds: 20 + failureThreshold: 6 +--- +apiVersion: v1 +kind: Service +metadata: + name: servico-configuracao + namespace: piloto-prod + labels: + app: servico-configuracao +spec: + selector: { app: servico-configuracao } + ports: [{ name: http, port: 80, targetPort: 8083 }]