iac/docs/apps/documentations.md
diamondrigido d318ea3f16 feat: дополнительные поддержка
1. outbox-relay для кафка
2. маршрутизация
2026-10-30 16:46:21 +02:00

70 lines
3.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# documentations
Хранилище документов. Namespace: `documentations`.
```mermaid
flowchart LR
GW[Istio Gateway]:::infra
PG[(PostgreSQL)]:::data
S3[S3 Proxy]:::infra
MinIO[(MinIO)]:::data
KC[Keycloak]:::idp
subgraph NS["ns: documentations"]
Frontend[deployment: frontend]:::comp
API[deployment: api]:::comp
Filestream[deployment: filestream<br/>upload/download]:::comp
PDM[deployment: pdm<br/>product data mgmt]:::comp
CDEAPI[deployment: cde-api<br/>новый CDE API]:::comp
Workers[deployments: cde-api-worker-*<br/>s32d x4, copy, move]:::comp
Relay[deployment: outbox-relay<br/>outbox → Kafka]:::comp
Frontend --> API
API --> Filestream
API --> PDM
CDEAPI --> API
Workers --> API
end
Zeebe[Camunda / Zeebe]:::infra
Kafka[Kafka]:::infra
CDEPG[(PostgreSQL, общий)]:::data
Valkey[(Valkey)]:::data
DocLink[document-link]:::peer
CDE[cde]:::peer
Transmittal[transmittal]:::peer
GW -->|/docs| Frontend
DocLink -->|REST| API
CDE -->|REST| API
Transmittal -->|REST| API
API --> PG
PDM --> PG
Filestream -->|files| S3 --> MinIO
API -. JWT .-> KC
CDEAPI --> CDEPG
CDEAPI --> Valkey
CDEAPI -->|files| S3
Workers --> CDEPG
Workers -->|jobs| Zeebe
Relay -->|poll outbox| CDEPG
Relay -->|events| Kafka
classDef comp fill:#ec4899,stroke:#9d174d,stroke-width:2px,color:#fff
classDef peer fill:#fce7f3,stroke:#9d174d,color:#000
classDef data fill:#10b981,stroke:#065f46,color:#fff
classDef infra fill:#0ea5e9,stroke:#075985,color:#fff
classDef idp fill:#f59e0b,stroke:#92400e,color:#fff
style NS fill:#fdf2f8,stroke:#ec4899,stroke-width:2px
```
## cde-api
`cde-api` — новый CDE API (Go) и 6 воркеров (`s32d-create-upload`, `s32d-process-workflows`, `s32d-publish-documents`, `s32d-handle-error`, `copy`, `move`), развёрнутых в ns `documentations`. Не путать с легаси-сервисом `cde` (`cde-svc.cde`, см. `cde.md`).
- Манифесты: `apps/documentations/base/cde-api*.yaml`, оверлеи — в каталогах контуров (`sarex-contour`, `yc-k8s-test` наследуют `base`; `d8-ugmk-prod`, `uralkal`, `vad` патчат `cde-api`; `ugok`, `brusnika-*`, `wb` — полные копии).
- Postgres, Valkey (`redis`) и S3 общие с documentations. Секреты — Vault Agent; путь `secrets/data/apps/cde-api/zeebe` нужно создать. В k8s-контурах (`ugok`, `brusnika-*`, `wb`) вместо Vault используются Secret'ы.
- `outbox-relay` (`apps/documentations/outbox-relay.CONFIGURATION.md`) — воркер transactional outbox: читает таблицу `outbox` в общей БД и публикует события cde-api в Kafka. Kafka — своя в каждом контуре; для vault-контуров нужен Vault-путь `secrets/data/kafka/apps/documentations`.
- CronJob'ы (`workspace-recovery`, `resource-id-backfill`, `sizer`) подготовлены в `apps/documentations/cronjobs/` как обычные `CronJob`, но не подключены.
- Подробности: `apps/documentations/cde-api.CONFIGURATION.md`, `cde-api.ENDPOINTS.md`, `cde-api.env.example`, `cde-api.openapi.yaml`.