From 46916f842145b1743f0e9f07f41900aa136f596e Mon Sep 17 00:00:00 2001 From: deploy Date: Thu, 18 Jun 2026 15:37:15 +0000 Subject: [PATCH] documentos: novo servico de anexos (ADR fronteira) + rota /api/documentos nos 3 tenants --- tenants/acme/30-apps-stubs.yaml | 1 + tenants/acme/81-servico-documentos.yaml | 53 +++++++++++++++++++++++ tenants/demo/30-apps-stubs.yaml | 1 + tenants/demo/81-servico-documentos.yaml | 53 +++++++++++++++++++++++ tenants/piloto/30-apps-stubs.yaml | 1 + tenants/piloto/81-servico-documentos.yaml | 53 +++++++++++++++++++++++ 6 files changed, 162 insertions(+) create mode 100644 tenants/acme/81-servico-documentos.yaml create mode 100644 tenants/demo/81-servico-documentos.yaml create mode 100644 tenants/piloto/81-servico-documentos.yaml diff --git a/tenants/acme/30-apps-stubs.yaml b/tenants/acme/30-apps-stubs.yaml index 99e1d1c..66cd14e 100644 --- a/tenants/acme/30-apps-stubs.yaml +++ b/tenants/acme/30-apps-stubs.yaml @@ -61,6 +61,7 @@ spec: - { path: /api/campeonato, pathType: Prefix, backend: { service: { name: servico-campeonato, port: { number: 80 } } } } - { path: /api/saude, pathType: Prefix, backend: { service: { name: servico-saude, port: { number: 80 } } } } - { path: /api/financeiro, pathType: Prefix, backend: { service: { name: servico-financeiro, port: { number: 80 } } } } + - { path: /api/documentos, pathType: Prefix, backend: { service: { name: servico-documentos, port: { number: 80 } } } } - { path: /api, pathType: Prefix, backend: { service: { name: backend, port: { number: 80 } } } } - { path: /, pathType: Prefix, backend: { service: { name: frontend-spa, port: { number: 80 } } } } - host: auth-acme.athleticmap.influxdigital.com.br diff --git a/tenants/acme/81-servico-documentos.yaml b/tenants/acme/81-servico-documentos.yaml new file mode 100644 index 0000000..48f53f1 --- /dev/null +++ b/tenants/acme/81-servico-documentos.yaml @@ -0,0 +1,53 @@ +# Bounded context "documentos" (servico de anexos centralizado, ADR-0002 + decisao 2026-06-18). +# Schema proprio "documentos"; roteado em /api/documentos no ingress do tenant. +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: servico-documentos + namespace: acme-prod + labels: { app: servico-documentos, athleticmap.io/contexto: documentos } +spec: + replicas: 1 + selector: { matchLabels: { app: servico-documentos } } + template: + metadata: + labels: { app: servico-documentos, athleticmap.io/contexto: documentos } + spec: + containers: + - name: servico-documentos + image: docker.io/library/servico-documentos: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-acme.athleticmap.influxdigital.com.br/realms/athleticmap" } + - { name: ATM_TENANT, value: "acme" } + resources: + requests: { cpu: 100m, memory: 300Mi } + limits: { cpu: "1", memory: 640Mi } + readinessProbe: + httpGet: { path: /api/documentos/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-documentos + namespace: acme-prod + labels: { app: servico-documentos } +spec: + selector: { app: servico-documentos } + ports: [{ name: http, port: 80, targetPort: 8083 }] diff --git a/tenants/demo/30-apps-stubs.yaml b/tenants/demo/30-apps-stubs.yaml index dfe0fd9..ba5a69d 100644 --- a/tenants/demo/30-apps-stubs.yaml +++ b/tenants/demo/30-apps-stubs.yaml @@ -61,6 +61,7 @@ spec: - { path: /api/campeonato, pathType: Prefix, backend: { service: { name: servico-campeonato, port: { number: 80 } } } } - { path: /api/saude, pathType: Prefix, backend: { service: { name: servico-saude, port: { number: 80 } } } } - { path: /api/financeiro, pathType: Prefix, backend: { service: { name: servico-financeiro, port: { number: 80 } } } } + - { path: /api/documentos, pathType: Prefix, backend: { service: { name: servico-documentos, port: { number: 80 } } } } - { path: /api, pathType: Prefix, backend: { service: { name: backend, port: { number: 80 } } } } - { path: /, pathType: Prefix, backend: { service: { name: frontend-spa, port: { number: 80 } } } } - host: auth-demo.athleticmap.influxdigital.com.br diff --git a/tenants/demo/81-servico-documentos.yaml b/tenants/demo/81-servico-documentos.yaml new file mode 100644 index 0000000..95f0ae9 --- /dev/null +++ b/tenants/demo/81-servico-documentos.yaml @@ -0,0 +1,53 @@ +# Bounded context "documentos" (servico de anexos centralizado, ADR-0002 + decisao 2026-06-18). +# Schema proprio "documentos"; roteado em /api/documentos no ingress do tenant. +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: servico-documentos + namespace: demo-prod + labels: { app: servico-documentos, athleticmap.io/contexto: documentos } +spec: + replicas: 1 + selector: { matchLabels: { app: servico-documentos } } + template: + metadata: + labels: { app: servico-documentos, athleticmap.io/contexto: documentos } + spec: + containers: + - name: servico-documentos + image: docker.io/library/servico-documentos: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-demo.athleticmap.influxdigital.com.br/realms/athleticmap" } + - { name: ATM_TENANT, value: "demo" } + resources: + requests: { cpu: 100m, memory: 300Mi } + limits: { cpu: "1", memory: 640Mi } + readinessProbe: + httpGet: { path: /api/documentos/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-documentos + namespace: demo-prod + labels: { app: servico-documentos } +spec: + selector: { app: servico-documentos } + ports: [{ name: http, port: 80, targetPort: 8083 }] diff --git a/tenants/piloto/30-apps-stubs.yaml b/tenants/piloto/30-apps-stubs.yaml index d18b5a2..21d3d60 100644 --- a/tenants/piloto/30-apps-stubs.yaml +++ b/tenants/piloto/30-apps-stubs.yaml @@ -61,6 +61,7 @@ spec: - { path: /api/campeonato, pathType: Prefix, backend: { service: { name: servico-campeonato, port: { number: 80 } } } } - { path: /api/saude, pathType: Prefix, backend: { service: { name: servico-saude, port: { number: 80 } } } } - { path: /api/financeiro, pathType: Prefix, backend: { service: { name: servico-financeiro, port: { number: 80 } } } } + - { path: /api/documentos, pathType: Prefix, backend: { service: { name: servico-documentos, port: { number: 80 } } } } - { path: /api, pathType: Prefix, backend: { service: { name: backend, port: { number: 80 } } } } - { path: /, pathType: Prefix, backend: { service: { name: frontend-spa, port: { number: 80 } } } } - host: auth-piloto.athleticmap.influxdigital.com.br diff --git a/tenants/piloto/81-servico-documentos.yaml b/tenants/piloto/81-servico-documentos.yaml new file mode 100644 index 0000000..2383d24 --- /dev/null +++ b/tenants/piloto/81-servico-documentos.yaml @@ -0,0 +1,53 @@ +# Bounded context "documentos" (servico de anexos centralizado, ADR-0002 + decisao 2026-06-18). +# Schema proprio "documentos"; roteado em /api/documentos no ingress do tenant. +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: servico-documentos + namespace: piloto-prod + labels: { app: servico-documentos, athleticmap.io/contexto: documentos } +spec: + replicas: 1 + selector: { matchLabels: { app: servico-documentos } } + template: + metadata: + labels: { app: servico-documentos, athleticmap.io/contexto: documentos } + spec: + containers: + - name: servico-documentos + image: docker.io/library/servico-documentos: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: 100m, memory: 300Mi } + limits: { cpu: "1", memory: 640Mi } + readinessProbe: + httpGet: { path: /api/documentos/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-documentos + namespace: piloto-prod + labels: { app: servico-documentos } +spec: + selector: { app: servico-documentos } + ports: [{ name: http, port: 80, targetPort: 8083 }]