81 lines
3.6 KiB
YAML
81 lines
3.6 KiB
YAML
# RASCUNHO — tenants/plataforma/65-runtime-core.yaml (commit A). Nao aplicar daqui.
|
|
#
|
|
# runtime-core no tenant `plataforma`: configuracao + cadastro (e, por ser o mesmo
|
|
# processo, organizacao, documentos, agenda e retencao — esses quatro nascem VAZIOS
|
|
# no banco da plataforma; ver docs/migrar-plataforma-para-runtimes.md §3).
|
|
#
|
|
# DIFERENCAS em relacao ao molde (moldes/consolidado/70-runtime-core.yaml) — todas
|
|
# de proposito; copiar o molde sem elas quebra:
|
|
# * banco: o Postgres PROPRIO do namespace (`postgres:5432/athleticmap`, usuario
|
|
# `atm`, sslmode=require), e nao o PgBouncer/pg-compartilhado. E onde ja estao
|
|
# os schemas cadastro (V014) e configuracao (V009). Sem initContainer espera-banco.
|
|
# * Keycloak: realm `athleticmap` da plataforma, emissor auth-PLATAFORMA. O molde
|
|
# usa auth.athleticmap.com/realms/athleticmap-N: aqui daria 401 em tudo.
|
|
# * ATM_KC_ADMIN_ENABLED=false e SEM `kc-admin-secret`: o Secret nao existe neste
|
|
# namespace (conferido 07/10) e o secretKeyRef obrigatorio do molde deixaria o
|
|
# pod em CreateContainerConfigError. Efeito: criar/editar funcionario aqui nao
|
|
# cria/atualiza login no Keycloak (fica PENDENTE). Decisao do dono (§7).
|
|
# * ATM_PLATAFORMA_TOKEN ausente: a propria plataforma nao pede e-mail de acesso
|
|
# a si mesma; o acesso por e-mail fica PENDENTE, o cadastro nao falha.
|
|
# * Service SEM o rotulo athleticmap.io/metricas: as metricas continuam saindo
|
|
# pelos Services servico-cadastro/servico-configuracao (ServiceMonitor
|
|
# athleticmap-servicos), e o rotulo duplicaria as series.
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: runtime-core
|
|
namespace: plataforma-prod
|
|
labels:
|
|
app: runtime-core
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels: { app: runtime-core }
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: runtime-core
|
|
athleticmap.io/contexto: runtime-core
|
|
spec:
|
|
containers:
|
|
- name: runtime-core
|
|
image: docker.io/library/runtime-core:1.35-limites-cadastro
|
|
imagePullPolicy: Never
|
|
ports: [{ containerPort: 8083 }]
|
|
env:
|
|
- { name: SPRING_DATASOURCE_URL, value: "jdbc:postgresql://postgres:5432/athleticmap?sslmode=require" }
|
|
- { name: SPRING_DATASOURCE_USERNAME, value: "atm" }
|
|
- name: SPRING_DATASOURCE_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef: { name: db-credentials, key: password }
|
|
- { name: SPRING_DATASOURCE_HIKARI_MAXIMUM_POOL_SIZE, value: "10" }
|
|
- { 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_KC_ADMIN_ENABLED, value: "false" }
|
|
resources:
|
|
requests: { cpu: 50m, memory: 384Mi }
|
|
limits: { cpu: "1", memory: 768Mi }
|
|
readinessProbe:
|
|
httpGet: { path: /actuator/health/readiness, port: 8083 }
|
|
initialDelaySeconds: 25
|
|
periodSeconds: 10
|
|
failureThreshold: 30
|
|
livenessProbe:
|
|
httpGet: { path: /actuator/health/liveness, port: 8083 }
|
|
initialDelaySeconds: 90
|
|
periodSeconds: 20
|
|
failureThreshold: 6
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: runtime-core
|
|
namespace: plataforma-prod
|
|
labels:
|
|
app: runtime-core
|
|
spec:
|
|
selector: { app: runtime-core }
|
|
ports: [{ name: http, port: 80, targetPort: 8083 }]
|