# Каталог IaC-компонентов и репозиториев Карта ответственности: **какой репозиторий за что отвечает** в инфраструктуре `gitlab.sarex.io` и **из чего состоит** этот репозиторий (`infra/iac`). - Источники: GitLab-группа `infra` (209 проектов, включая подгруппы) + содержимое `infra/iac`. - Дата среза: **2026-08-05**. - Все ссылки — на `https://gitlab.sarex.io`. Пометки достоверности: | Знак | Значение | |---|---| | ✅ | структура/назначение проверены — репозиторий открыт и прочитан | | ◻️ | назначение выведено из имени, описания в GitLab и веток; **требует подтверждения** | --- ## 1. Слои IaC и где они живут ``` ┌─ Железо / VM ─────────────────────────────────────────────────────────────┐ │ ansible-playbooks, ansible-patroni-cluster, ansible-minio-cluster, │ │ tools/ansible-vm-preparing, astra-linux, hardware, intervpc-vpn-tunnel │ ├─ Кластер Kubernetes ──────────────────────────────────────────────────────┤ │ kubespray, k8s-provision │ ├─ Облачные и k8s-ресурсы (namespace/БД/S3/секреты/топики) ─────────────────┤ │ terraform, terraform-contour, terraform-contour-mirror, │ │ sarex-terraform-provider │ ├─ GitOps: состояние кластеров ─────────────────────────────────────────────┤ │ ★ iac (Flux v2, этот репозиторий) iac-gpn (ArgoCD) poc/iac (архив) │ ├─ Поставка отдельных компонентов через GitLab CI (ветка = контур) ─────────┤ │ vault, redis, kafka, postgresql, istio-config, keycloak, … (~60 репо) │ ├─ Библиотеки чартов ───────────────────────────────────────────────────────┤ │ universal-helm-chart, common-charts, chart-museum │ ├─ Эксплуатация, аудит, наблюдаемость ──────────────────────────────────────┤ │ k8s-changelog, cluster-maintenance, k8s-hustler, harvester, backups/* │ └───────────────────────────────────────────────────────────────────────────┘ ``` **Главный водораздел.** В инфраструктуре сосуществуют **две модели доставки**: 1. **GitOps (Flux)** — `infra/iac`. Один репозиторий, множество кластеров, состояние декларируется в `clusters/<кластер>/`, Flux сам подтягивает изменения. 2. **Push-деплой (GitLab CI)** — по репозиторию на компонент, чарт лежит в `.helm/`, **ветка = контур/окружение** (`stage`, `preprod`, `contour`, `infra`, `brusnika-prod`, …). Проверено на [vault](https://gitlab.sarex.io/infra/vault), [redis](https://gitlab.sarex.io/infra/redis), [istio-config](https://gitlab.sarex.io/infra/istio-config), [kube-prometheus-stack](https://gitlab.sarex.io/infra/kube-prometheus-stack), [gitlab-runner](https://gitlab.sarex.io/infra/gitlab-runner). ✅ Для ряда компонентов (Vault, Redis, Kafka, PostgreSQL, Istio, Keycloak, Zitadel, OpenObserve, Superset, Trino, GoAlert, GlitchTip, argo-*, otel-*) **существуют оба источника**. См. раздел [6. Перекрытия](#6-перекрытия-и-как-выбирать-источник-истины). --- ## 2. Ядро IaC — репозитории верхнего уровня | Репозиторий | Зона ответственности | Ключевое содержимое | |---|---|---| | ★ [infra/iac](https://gitlab.sarex.io/infra/iac) ✅ | **Основной GitOps-монорепозиторий (Flux v2).** Декларативное состояние 9 кластеров: инфраструктурные компоненты + прикладные сервисы | `clusters/`, `infrastructure/` (36), `apps/` (37), `inventory.yaml`, `docs/apps/` | | [infra/terraform](https://gitlab.sarex.io/infra/terraform) ✅ | **Ресурсы Yandex Cloud и Kubernetes**: namespaces, PostgreSQL БД/пользователи, S3-бакеты, Valkey/Redis-пользователи, Kafka-топики, RabbitMQ, k8s-секреты. Единый источник правды — `infrastructure.yaml`, секреты через SOPS | `live/prod` (Terragrunt), `modules/`: `k8s-namespace`, `k8s-secret`, `k8s-secrets`, `kafka-topics-yc`, `rabbitmq`, `yc-database`, `yc-s3`, `yc-valkey-user` | | [infra/terraform-contour](https://gitlab.sarex.io/infra/terraform-contour) ✅ | Тот же подход **для изолированного контура**: namespaces и секреты из Vault | `live/{namespace,vault-secrets}`, `modules/{k8s-namespace,vault-platform-secrets}` | | [infra/terraform-contour-mirror](https://gitlab.sarex.io/infra/terraform-contour-mirror) ✅ | **Зеркало `infra/terraform` для контура** (ветка `contour`, единственная). Тот же README и структура + `Dockerfile` для запуска в закрытом периметре | `live/`, `modules/`, `scripts/`, `Dockerfile` | | [infra/sarex-terraform-provider](https://gitlab.sarex.io/infra/sarex-terraform-provider) ✅ | **Внутренние Terraform-провайдеры**, генерируемые из OpenAPI-спек продуктовых API (например `workspaces-api`). В публичный реестр не публикуются — ставятся через dev overrides | `providers/`, `internal/`, `examples/`, `Makefile` | | [infra/iac-gpn](https://gitlab.sarex.io/infra/iac-gpn) ✅ | **GitOps-контур ГПН на ArgoCD** (не Flux): `root.yaml` + app-of-apps, конфигмапы бэкендов, образ `terraform-contour-stronghold` | `argocd/{root.yaml,apps}`, `infrastructure/*-configmaps`, `images/` | | [infra/poc/iac](https://gitlab.sarex.io/infra/poc/iac) ✅ | **Предшественник/PoC** текущего Flux-репозитория. Последняя активность 2026-02-16 — считать архивом | `clusters/`, `apps/`, `infra/`, `GUIDE.md` | --- ## 3. Провижининг: от железа до кластера | Репозиторий | Отвечает за | |---|---| | [infra/kubespray](https://gitlab.sarex.io/infra/kubespray) ✅ | Форк upstream Kubespray — **развёртывание самих кластеров Kubernetes** на VM | | [infra/k8s-provision](https://gitlab.sarex.io/infra/k8s-provision) ✅ | **Первичная обвязка свежего кластера**: `namespaces`, `cert_manager`, `istio` (+`ISTIO.md`), `ingress`, `dashboard`, `prometheus`, `postgres`/`ya_postgres`, `rabbitmq`, `pvc`, `gitlab`, `teamcity`, `migration` | | [infra/ansible-playbooks](https://gitlab.sarex.io/infra/ansible-playbooks) ✅ | Зонтичный Ansible-репозиторий: каталоги `minio/`, `patroni/` | | [infra/ansible-patroni-cluster](https://gitlab.sarex.io/infra/ansible-patroni-cluster) ✅ | **PostgreSQL HA на VM через Patroni** (`site.yml`, `roles/`, `inventory/`, `test.yml`) | | [infra/ansible-minio-cluster](https://gitlab.sarex.io/infra/ansible-minio-cluster) ✅ | **MinIO-кластер на VM** + сценарии проверок `fault-tolerance-test.yml`, `heal-test.yml` | | [infra/tools/ansible-vm-preparing](https://gitlab.sarex.io/infra/tools/ansible-vm-preparing) ✅ | Подготовка VM перед Ansible/Kubespray (Python-обвязка, `uv`). README — шаблонный, назначение по коду | | [infra/hardware](https://gitlab.sarex.io/infra/hardware) ◻️ | Учёт/конфигурация физического оборудования | | [infra/astra-linux](https://gitlab.sarex.io/infra/astra-linux) ◻️ | Сборка/настройка образов Astra Linux для импортозамещённых контуров | | [infra/intervpc-vpn-tunnel](https://gitlab.sarex.io/infra/intervpc-vpn-tunnel) ◻️ | VPN-туннель между VPC | | [infra/cluster-maintenance](https://gitlab.sarex.io/infra/cluster-maintenance) ◻️ | Регламентные операции обслуживания кластеров | --- ## 4. Компонентные репозитории (`.helm/` + GitLab CI, ветка = контур) Формат ниже: **компонент → репозиторий**. Столбец «в `iac`» показывает, есть ли одноимённый компонент в этом монорепозитории (`infrastructure/<имя>`). ### 4.1 Сеть, Ingress, Service Mesh | Компонент | Репозиторий | в `iac` | |---|---|---| | Istio (base/pilot/gateway) | [infra/istio](https://gitlab.sarex.io/infra/istio) `infra` | ✔ `istio-base`, `istio-pilot`, `istio-gateway` | | Istio: Gateway/VirtualService/AuthPolicy/EnvoyFilter | [infra/istio-config](https://gitlab.sarex.io/infra/istio-config) ✅ ветки `stage`,`preprod`,`contour`,`infra`,`master` | ✔ `istio-config` | | Istio для контура НН | [infra/istio-nn](https://gitlab.sarex.io/infra/istio-nn) ◻️ | — | | cert-manager | [infra/cert-manager](https://gitlab.sarex.io/infra/cert-manager) ◻️ | ✔ `cert-manager` | | nginx (ingress для Django) | [infra/ingress-nginx-django](https://gitlab.sarex.io/infra/ingress-nginx-django) ◻️ | — | | nginx с Kerberos / hardened nginx | [infra/nginx-krb](https://gitlab.sarex.io/infra/nginx-krb), [infra/secure-nginx](https://gitlab.sarex.io/infra/secure-nginx) ◻️ | — | ### 4.2 Identity, доступ, безопасность | Компонент | Репозиторий | в `iac` | |---|---|---| | Keycloak | [infra/keycloak](https://gitlab.sarex.io/infra/keycloak) ◻️ | ✔ `keycloak` | | Zitadel | [infra/zitadel](https://gitlab.sarex.io/infra/zitadel) ◻️ | ✔ `zitadel` | | Zitadel auth proxy | [infra/zitadel-auth-proxy](https://gitlab.sarex.io/infra/zitadel-auth-proxy) ◻️ | — | | OpenLDAP | [infra/openldap](https://gitlab.sarex.io/infra/openldap) `contour` ◻️ | ✔ `openldap` | | HashiCorp Vault | [infra/vault](https://gitlab.sarex.io/infra/vault) ✅ `contour` | ✔ `vault`, `vault-unseal` | | SpiceDB (авторизация) | [infra/spicedb](https://gitlab.sarex.io/infra/spicedb) ◻️ | — | | OAuth2-фасад / gatekeeper | [infra/oauth2-facade](https://gitlab.sarex.io/infra/oauth2-facade), [infra/gogatekeeper](https://gitlab.sarex.io/infra/gogatekeeper) ◻️ | — | | Фильтрация JWKS | [infra/jwks-key-filter](https://gitlab.sarex.io/infra/jwks-key-filter) ◻️ | — | | Django ↔ Keycloak (библиотека) | [infra/django-keycloak](https://gitlab.sarex.io/infra/django-keycloak) ✅ | — | | Сканирование секретов / образов | [infra/gitleaks](https://gitlab.sarex.io/infra/gitleaks), [infra/clair](https://gitlab.sarex.io/infra/clair), [infra/sec/report](https://gitlab.sarex.io/infra/sec/report) ◻️ | — | ### 4.3 Данные и хранилища | Компонент | Репозиторий | в `iac` | |---|---|---| | PostgreSQL | [infra/postgresql](https://gitlab.sarex.io/infra/postgresql) ветки `contour`,`contour-13`,`preprod`,`stronghold` ✅ | ✔ `postgresql` | | PostgreSQL 16 (контур WB) | [infra/wb/postgresql16](https://gitlab.sarex.io/infra/wb/postgresql16) ◻️ | — | | pg_partman / TimescaleDB / CockroachDB | [infra/postgres-pgpartman](https://gitlab.sarex.io/infra/postgres-pgpartman), [infra/timescaledb](https://gitlab.sarex.io/infra/timescaledb), [infra/cockroachdb](https://gitlab.sarex.io/infra/cockroachdb) ◻️ | — | | Redis | [infra/redis](https://gitlab.sarex.io/infra/redis) ✅ `contour` | ✔ `redis` | | MinIO (в k8s) | [infra/minio-standalone](https://gitlab.sarex.io/infra/minio-standalone) `contour` ◻️ | ✔ `minio` | | ClickHouse (+оператор) | [infra/clickhouse](https://gitlab.sarex.io/infra/clickhouse), [infra/clickhouse-operator](https://gitlab.sarex.io/infra/clickhouse-operator) ◻️ | — | | OpenSearch (+оператор) | [infra/opensearch](https://gitlab.sarex.io/infra/opensearch), [infra/opensearch-operator](https://gitlab.sarex.io/infra/opensearch-operator) ◻️ | — | | S3-прокси | — (только в `iac`) | ✔ `s3-proxy` | ### 4.4 Брокеры и обмен сообщениями | Компонент | Репозиторий | в `iac` | |---|---|---| | Kafka | [infra/kafka](https://gitlab.sarex.io/infra/kafka) ветки `stage`,`preprod`,`brusnika-*` ✅ | ✔ `kafka` | | Kafka standalone (контур НН) | [infra/kafka-nn](https://gitlab.sarex.io/infra/kafka-nn) ◻️ | — | | Strimzi/Kafka-оператор | [infra/kafka-operator](https://gitlab.sarex.io/infra/kafka-operator) ◻️ | — | | Kafka exporter | [infra/kafka-exporter](https://gitlab.sarex.io/infra/kafka-exporter) ◻️ | ✔ `kafka-exporter` | | Маршрутизация между Kafka-кластерами | [infra/kafka-router](https://gitlab.sarex.io/infra/kafka-router) ✅ | — | | Kafka → Vector мост | [infra/kafka-vector-bridge](https://gitlab.sarex.io/infra/kafka-vector-bridge) ◻️ | — | | RabbitMQ (+оператор, контур НН) | [infra/rabbitmq](https://gitlab.sarex.io/infra/rabbitmq), [infra/rabbitmq-cluster-operator](https://gitlab.sarex.io/infra/rabbitmq-cluster-operator), [infra/rabbitmq-nn](https://gitlab.sarex.io/infra/rabbitmq-nn) ◻️ | ✔ `rabbitmq` | ### 4.5 Наблюдаемость | Компонент | Репозиторий | в `iac` | |---|---|---| | kube-prometheus-stack | [infra/kube-prometheus-stack](https://gitlab.sarex.io/infra/kube-prometheus-stack) ✅ `infra` | ✔ `prometheus-stack` | | prometheus-stack (описан как «A complete monitoring stack for Kubernetes») | [infra/prometheus-stack](https://gitlab.sarex.io/infra/prometheus-stack) `stage` | ✔ `prometheus-stack` | | Алерты и дашборды для Prometheus/Grafana | [infra/prometheus-stsack-resources](https://gitlab.sarex.io/infra/prometheus-stsack-resources) *(опечатка в имени — так в GitLab)* | — | | VictoriaMetrics stack / cluster | [infra/vm-stack](https://gitlab.sarex.io/infra/vm-stack), [infra/vm-cluster](https://gitlab.sarex.io/infra/vm-cluster) ◻️ | ✔ `vmstack` | | Экспортеры: node / postgres / blackbox | [infra/node-exporter](https://gitlab.sarex.io/infra/node-exporter), [infra/postgres-exporter](https://gitlab.sarex.io/infra/postgres-exporter), [infra/blackbox-exporter](https://gitlab.sarex.io/infra/blackbox-exporter) ◻️ | ✔ `postgres-exporter` | | OpenObserve | [infra/openobserve](https://gitlab.sarex.io/infra/openobserve) ветка `contour/cps` ✅ | ✔ `openobserve` | | Loki / SigNoz | [infra/loki](https://gitlab.sarex.io/infra/loki), [infra/signoz](https://gitlab.sarex.io/infra/signoz) ◻️ | — | | Sentry / GlitchTip | [infra/sentry](https://gitlab.sarex.io/infra/sentry), [infra/glitchtip](https://gitlab.sarex.io/infra/glitchtip) `contour/cps` ◻️ | ✔ `glitchtip` | | GoAlert (+ исходники, + Telegram-релей) | [infra/goalert](https://gitlab.sarex.io/infra/goalert), [infra/goalert-source](https://gitlab.sarex.io/infra/goalert-source), [infra/goalert-telegram-relay](https://gitlab.sarex.io/infra/goalert-telegram-relay) ◻️ | ✔ `goalert` | | OpenTelemetry collector / operator | [infra/opentelemetry-collector](https://gitlab.sarex.io/infra/opentelemetry-collector), [infra/opentelemetry-operator](https://gitlab.sarex.io/infra/opentelemetry-operator) ◻️ | ✔ `opentelemetry-collector`, `opentelemetry-operator` | | eBPF-экспортер OTel | [infra/otel-ebpf-exporter](https://gitlab.sarex.io/infra/otel-ebpf-exporter) ◻️ | — | | Конвейер телеметрии: OTel → Kafka → ClickHouse | [infra/otel-kafka-processor](https://gitlab.sarex.io/infra/otel-kafka-processor), [infra/otel-kafka-clickhouse-worker](https://gitlab.sarex.io/infra/otel-kafka-clickhouse-worker) ◻️ | — | | SDK-обвязки инструментирования | [infra/otel/django-otel-tools](https://gitlab.sarex.io/infra/otel/django-otel-tools), [infra/otel/fastapi-otel-tools](https://gitlab.sarex.io/infra/otel/fastapi-otel-tools), [infra/golang-fiber-otel-tools](https://gitlab.sarex.io/infra/golang-fiber-otel-tools), [infra/golang-net-http-otel-tools](https://gitlab.sarex.io/infra/golang-net-http-otel-tools), [infra/django-instrumented](https://gitlab.sarex.io/infra/django-instrumented), [infra/djano-autoinstrumentation](https://gitlab.sarex.io/infra/djano-autoinstrumentation) ◻️ | — | | PMM, Trickster, отчёты по Prometheus | [infra/pmm](https://gitlab.sarex.io/infra/pmm), [infra/trickster](https://gitlab.sarex.io/infra/trickster), [infra/prometheus-report](https://gitlab.sarex.io/infra/prometheus-report) ◻️ | — | | SIEM-шиппер (+UI) | [infra/siem-shiper](https://gitlab.sarex.io/infra/siem-shiper), [infra/siem-shiper-frontend](https://gitlab.sarex.io/infra/siem-shiper-frontend) ◻️ | — | ### 4.6 Платформа, аналитика, BPM | Компонент | Репозиторий | в `iac` | |---|---|---| | Kubernetes Dashboard | [infra/dashboard](https://gitlab.sarex.io/infra/dashboard) ◻️ | ✔ `dashboard` | | local-path-provisioner | [infra/local-path-provisioner-nn](https://gitlab.sarex.io/infra/local-path-provisioner-nn) ◻️ | ✔ `local-path-provisioner` | | Camunda (+ модели процессов) | [infra/camunda](https://gitlab.sarex.io/infra/camunda) `camunda-prod`, [infra/camunda-processes](https://gitlab.sarex.io/infra/camunda-processes) ◻️ | ✔ `camunda` | | Argo Workflows / Argo Events | [infra/argo-workflows](https://gitlab.sarex.io/infra/argo-workflows), [infra/argo-events](https://gitlab.sarex.io/infra/argo-events) ◻️ | ✔ `argo-workflows`, `argo-events` | | Superset / Trino | [infra/superset](https://gitlab.sarex.io/infra/superset), [infra/trino](https://gitlab.sarex.io/infra/trino) ◻️ | ✔ `superset`, `trino` | | Jupyter, BI-эксперименты, ETL, ГИС | [infra/jupyter-notebook](https://gitlab.sarex.io/infra/jupyter-notebook), [infra/bi-test](https://gitlab.sarex.io/infra/bi-test), [infra/etl](https://gitlab.sarex.io/infra/etl), [infra/sarex-gis](https://gitlab.sarex.io/infra/sarex-gis) ◻️ | — | | Mailer | [infra/mailer](https://gitlab.sarex.io/infra/mailer) ◻️ | — | ### 4.7 CI/CD и Git-инфраструктура | Компонент | Репозиторий | |---|---| | GitLab Runner | [infra/gitlab-runner](https://gitlab.sarex.io/infra/gitlab-runner) ✅ (`.helm` + CI) | | Gitea (Git-зеркала для изолированных контуров) | [infra/gitea](https://gitlab.sarex.io/infra/gitea) ◻️ — см. §5, Flux в закрытых контурах читает `iac` именно из Gitea | | ChartMuseum (реестр Helm-чартов) | [infra/chart-museum](https://gitlab.sarex.io/infra/chart-museum) ◻️ | | Базовые Docker-образы | [infra/base-images](https://gitlab.sarex.io/infra/base-images) ◻️ | | Миграция и утилиты GitLab | [infra/gitlab-migrator](https://gitlab.sarex.io/infra/gitlab-migrator), [infra/gitlab-tools](https://gitlab.sarex.io/infra/gitlab-tools) ◻️ | ### 4.8 Библиотеки чартов | Репозиторий | Отвечает за | |---|---| | [infra/universal-helm-chart](https://gitlab.sarex.io/infra/universal-helm-chart) ✅ | Универсальный чарт (`.helm/`), на который ссылаются HelmRelease в `iac` (`openobserve`, `glitchtip` — `chart: universal-chart`) | | [infra/common-charts](https://gitlab.sarex.io/infra/common-charts) ✅ | Общие чарты, сейчас — `universal-static-site` | | [infra/helm-values-extractor](https://gitlab.sarex.io/infra/helm-values-extractor) ◻️ | Извлечение `values` из работающих релизов (ветка `draft-script`) | | [infra/poc/itworksonmyhelm](https://gitlab.sarex.io/infra/poc/itworksonmyhelm), [infra/wb/helm-of-business](https://gitlab.sarex.io/infra/wb/helm-of-business) ◻️ | Эксперименты/контурные наборы чартов | --- ## 5. Что внутри `infra/iac` ### 5.1 Кластеры и откуда Flux их читает Точка входа Flux — `clusters/<кластер>/`. Источник (`gotk-sync.yaml`) различается: кластеры в периметре Yandex Cloud смотрят прямо в GitLab, изолированные контуры — в **зеркало Gitea**. | Кластер | Git-источник Flux | Состав | |---|---|---| | `yc-infra-prod` | `gitlab.sarex.io/infra/iac` | argo-workflows, argo-events, postgresql, pg-sanitizer, vault, vault-unseal, yc-pg-dumper | | `yc-k8s-test` | `gitlab.sarex.io/infra/iac` | `bootstrap-jobs`, состав задаётся в `kustomization.yaml` кластера | | `yc-k8s-test-02` | `gitlab.sarex.io/infra/iac` | istio (base/pilot/gateway/config), dashboard, local-path-provisioner, minio, rabbitmq, kafka, redis, camunda, postgresql, zitadel, keycloak, vault | | `yc-cps-prod` | `gitea.cloud.cps.sarex.lonsdaleites.ru/sarex/iac` | vault, istio, gitea-istio | | `yc-ecp` | `gitea.invest.cps.sarex.lonsdaleites.ru/sarex/iac` | cert-manager, istio-config, dashboard, vault; apps: measurements, django, s3-proxy, s3-proxy-bim | | `brusnika-prod` | `gitea.prod.brusnika.sarex.lonsdaleites.ru/sarex/iac` | istio, vault, zitadel, minio, openobserve, vmstack, otel operator/collector, goalert, экспортеры, failed-pod-cleanup | | `brusnika-stage` | `gitea.stage.brusnika.sarex.lonsdaleites.ru/sarex/iac` | то же без minio | | `wb` | `gitea-srx.wb.ru/sarex/iac` | istio-config, openobserve, vmstack, otel, goalert, экспортеры, superset, trino | | `d8-ugmk-prod` | `10.222.255.165:3000/infra/iac` (Gitea) | только `istio-ingress` | | `contour` | — (шаблон: `apps.yaml`, `infrastructure.yaml`, `helm-repositories.yaml`) | эталонная точка входа из README | ### 5.2 `infrastructure/` — 36 компонентов `argo-events` · `argo-workflows` · `camunda` · `cert-manager` · `dashboard` · `example-infra` · `failed-pod-cleanup` · `glitchtip` · `goalert` · `istio-base` · `istio-config` · `istio-gateway` · `istio-pilot` · `kafka` · `kafka-exporter` · `keycloak` · `local-path-provisioner` · `minio` · `openldap` · `openobserve` · `opentelemetry-collector` · `opentelemetry-operator` · `pg-sanitizer` · `postgres-exporter` · `postgresql` · `prometheus-stack` · `rabbitmq` · `redis` · `s3-proxy` · `superset` · `trino` · `vault` · `vault-unseal` · `vmstack` · `yc-pg-dumper` · `zitadel` Структура компонента: `base/` (namespace + HelmRelease/манифесты) + `patches/` + `kustomization.yaml`. ### 5.3 `apps/` — 37 прикладных сервисов > ⚠️ `apps/` — **только манифесты деплоя**. Исходный код сервисов живёт в других группах GitLab > (`platform`, `pdm`, `proc`, `planning`, `aero`, `generic`) — полная карта в **[§5.3.8](#538-где-лежит-код-приложений)**. > Образы приезжают из одного реестра: `cr.yandex/crp3ccidau046kdj8g9q/<сервис>:<тег>`. #### 5.3.1 Единый шаблон приложения ``` apps// ├── base/ # общий для всех кластеров слой │ ├── namespace.yaml # namespace = имя приложения │ ├── <компонент>.yaml # HelmRelease на universal-chart (по одному на процесс) │ └── kustomization.yaml ├── <кластер>/ # оверлей: brusnika-prod | brusnika-stage | d8-ugmk-prod | │ └── kustomization.yaml # yc-ecp | yc-k8s-test | dsinv ├── .env.example # ─┐ ├── CONFIGURATION.md # │ «паспорт сервиса» — документация рядом с деплоем ├── ENDPOINTS.md # │ └── openapi.yaml # ─┘ ``` Каждый процесс сервиса — отдельный `HelmRelease` на **общем чарте**: ```yaml chart: universal-chart # версия 0.1.9 (у 6 приложений осталась 0.1.7) sourceRef: HelmRepository/yc-oci-charts # OCI-реестр cr.yandex, ns flux-system values: global: { env: _default } # ключ окружения services: backend: image: { name: { _default: cr.yandex/…/bim-api:contour_f9f2a39-dirty } } deployment: { replicaCount: {_default: 1}, port: {_default: 8000}, probes: … } service: { name: {_default: backend-svc}, port: {_default: 80} } imagePullSecrets: { name: { _default: regcred } } envs: [ … ] podAnnotations: { _default: { vault.hashicorp.com/*: … } } ``` Особенности, общие почти для всех приложений: - **все значения обёрнуты в `_default`** — механизм пер-окруженческих переопределений `universal-chart` (`global.env` выбирает ключ); - **секреты не хранятся в git** — их подставляет **Vault Agent Injector** через `podAnnotations` (§5.3.5); - `traffic.sidecar.istio.io/excludeOutboundPorts: "8200"` — обращение к Vault мимо sidecar Istio; - поля `commitSha`/`gitlabUri`/`gitlabJobUrl`/`owner` в базовом слое пустые — заполняются CI. **Исключения:** `resources` и `subscriptions` описаны голыми `Deployment`+`Service`+`ServiceAccount` без `HelmRelease`; у `ams-sync` и `control-interface` в `base/` нет `Namespace`. #### 5.3.2 Состав приложений Обозначения кластеров: **B** `brusnika-prod` · **S** `brusnika-stage` · **U** `d8-ugmk-prod` · **E** `yc-ecp` · **T** `yc-k8s-test`. Код в скобках — **оверлей есть, но кластер его не подключает**. | Приложение | ns | Компоненты (HelmRelease) | Образы `…/crp3ccidau046kdj8g9q/` | Кластеры | |---|---|---|---|---| | `ams-sync` | — | `ams-sync` | `ams-sync` | S | | `attachments` | `attachments` | `attachments` | `att9` | (B) S U T | | `auth-flow` | `auth-flow` | `frontend` | `auth-flow-frontend` | (B) S U T | | `bim` | `bim` | `backend` | `bim-api` | B S U T | | `cde` | `cde` | **13**: `cde` + `cde-splitpdf`, `cde-flowscallback`, `cde-worker-{alert,copy,copyv2,create-versions,create-versionsv2,markings,markingsv2,sign,signv2,update-bundles}` | `cde`, `orchestrator`, 11 × `*-worker` | (B) (S) U T | | `checklists` | `checklists` | `checklists` | `checklists-backend` | B S U T | | `comparisons` | `comparisons` | `backend`, `frontend` + 2 ConfigMap | `comparisons_backend_prod`, `comparisons-frontend` | (B) (S) U T | | `contracts` | `contracts` | `contracts` | `contracts` | B S U T | | `control-interface` | — | `frontend` | `srx-admin` | B S U T | | `cross-section` | `cross-section` | `cross-section-static` | `cross-section-app` | (B) (S) U T | | `django` | `django` | `backend`, `celery`, `frontend`, `srx-admin-frontend`, `s3-proxy` + Deployment/Service `redis` + ConfigMap `django`/`nginx`/`uwsgi`/`zitadel` | `backend`, `sarex-frontend-dev`, `srx-admin`, `s3-proxy`, `redis` | B S U **E** T | | `document-link` | `document-link` | `frontend` | `document-link-frontend` | B S U (T) | | `documentations` | `documentations` | `documentations-api`, `-filestream`, `-hasher`, `-pdf-markings-amqp`, `pdm-api`, `frontend` + Deployment `redis` | `documentations`, `documentations-api-files`, `hasher`, `pdf-markings-amqp`, `pdmv2`, `documentation-frontend-app`, `redis` | B S U T | | `drawings` | `drawings` | `backend` | `drawings-api` | B S U T | | `eav` | `eav` | `backend` + ConfigMap | `eav` | B S U T | | `faas` | `faas` | `export-reviews` | `export-reviews` | (B) (S) U T | | `flows` | `flows` | `backend`, `celery`, `frontend` | `flows-backend`, `flows-backend_worker`, `flows-frontend` | B S U T | | `iam` | `iam` | `iam-backend` + ConfigMap | `iams` | (B) S U (T) | | `inspections` | `inspections` | `backend` | `sarex-inspections`, `notification:email` | B (S) U T | | `issues` | `issues` | `backend`, `celery`, `frontend` + Deployment/Service `redis` + ConfigMap | `issues`, `contour_issues-frontend`, `redis` | B S U T | | `mapper` | `mapper` | `backend` | `mapper` | B S U T | | `measurements` | `measurements` | `measurements` | `measurements` | B S U **E** T | | `message-hub` | `message-hub` | `message-hub` | `message-hub` | B S U T | | `notes` | `notes` | `backend`, `frontend` + ConfigMap | `notes-backend`, `notes-frontend` | B S U T | | `pm` | `pm` | `backend`, `celery`, `frontend`, `resources-static` + ConfigMap | `pm-backend`, `pm-frontend`, `resources-frontend` | B S U T | | `prescriptions` | `prescriptions` | `frontend` | `prescriptions-frontend` | (B) (S) U T | | `processing` | `processing` | `workflows-api`, `engine`, `engine-low`, `frontend` + Role/RoleBinding | `workflows-api_prod`, `workflows-engine`, `workflows-endigne_prod`, `workflows-frontend` | B S U T | | `projects` | `projects` | `frontend` | `project-frontend-app` | (B) S U T | | `remarks` | `remarks` | `frontend` | `remarks-frontend` | B S U T | | `resources` | `resources` | — *(Deployment + Service + SA + 2 ConfigMap)* | `sarex-resources` | B S T | | `reviews` | `reviews` | `frontend` | `reviews-frontend` | B S U T | | `rfi` | `rfi` | `backend`, `celery`, `frontend` | `rfi-backend`, `rfi-frontend` | B S U T | | `stamp-verification` | `stamp-verification` | `frontend` | `stamp-verification-frontend` | U T | | `subscriptions` | `subscriptions` | — *(Deployment + Service + SA)* | `subscriptions` | B S U T | | `system-log` | `system-log` | `api`, `worker` | `system-log_prod`, `system-log-worker_prod` | B S U T | | `transmittal` | `transmittal` | `backend`, `frontend`, `worker` | `transmittal-api`, `transmittal-frontend` | B S U T | | `workspaces` | `workspaces` | `backend`, `frontend` | `workspaces`, `workspaces-v2-frontend` | B S U T | **Как читать состав.** Типовой backend-сервис = `backend` (API) + `celery`/`worker` (асинхронные задачи) + `frontend` (статика). Девять приложений — **чисто фронтендовые**: `auth-flow`, `control-interface`, `cross-section`, `document-link`, `prescriptions`, `projects`, `remarks`, `reviews`, `stamp-verification`. Самое крупное — `cde` (13 релизов: оркестратор + 11 воркеров по типам операций над документами). #### 5.3.3 Где приложения реально разворачиваются | Кластер | Приложений подключено | Комментарий | |---|---|---| | `d8-ugmk-prod` | **35** | самый полный контур | | `yc-k8s-test` | **34** | тестовый, близок к полному | | `brusnika-stage` | **30** | | | `brusnika-prod` | **26** | | | `yc-ecp` | **2** | только `django` и `measurements` | | `wb`, `yc-cps-prod`, `yc-infra-prod`, `yc-k8s-test-02`, `contour` | **0** | приложений из `apps/` не деплоят: эти кластеры несут только `infrastructure/` | **Мёртвые и неподключённые оверлеи** — каталог существует, но ни один `clusters/*/kustomization.yaml` на него не ссылается, то есть Flux его не применяет: | Кластер | Неподключённые оверлеи | |---|---| | `brusnika-prod` | `attachments`, `auth-flow`, `cde`, `comparisons`, `cross-section`, `faas`, `iam`, `prescriptions`, `projects` | | `brusnika-stage` | `cde`, `comparisons`, `cross-section`, `faas`, `inspections`, `prescriptions` | | `yc-k8s-test` | `document-link`, `iam` | Отдельно **`dsinv/`** — оверлей у **25 приложений**, но **кластера `clusters/dsinv/` не существует** и никто на него не ссылается. Судя по содержимому (готовые `Deployment` с `SERVICE_URL=https://srx.wb.ru`) и по каталогу `snapshots/dsinv/`, это **материализованный снимок живого контура WB**, а не рабочий оверлей. Использовать как справочник «что реально крутится», не как источник деплоя. #### 5.3.4 Две несовместимые конвенции оверлеев ⚠️ | Кластер | Как устроен оверлей | Приложений | |---|---|---| | `d8-ugmk-prod`, `yc-k8s-test`, `dsinv` | ✅ **наследует `base`**: `resources: [../base]` + `patches:` | 35 / 36 / 25 | | `brusnika-prod`, `brusnika-stage`, `yc-ecp` | ⚠️ **самостоятельный**: `base` не подключается, `HelmRelease` скопирован целиком | 35 / 36 / 2 | Последствие — **тихий дрейф**. Пример: `apps/bim/base/backend.yaml` использует `universal-chart` **0.1.9**, а его полная копия `apps/bim/brusnika-prod/backend.yaml` — **0.1.7**. Правка в `base/` до контуров Брусники не доедет, и никакой ошибки при этом не возникнет. Это же объясняет разнобой версий чарта: 0.1.7 остался у `ams-sync`, `auth-flow`, `control-interface`, `cross-section`, `remarks`, `reviews`. #### 5.3.5 Секреты: Vault Agent Injector Пароли БД в git не лежат. Под получает их файлом от sidecar-инжектора Vault: ```yaml vault.hashicorp.com/agent-inject: "true" vault.hashicorp.com/agent-init-first: "true" vault.hashicorp.com/agent-pre-populate-only: "true" # только init-контейнер, без постоянного sidecar vault.hashicorp.com/auth-path: auth/kubernetes vault.hashicorp.com/role: bim # роль = имя приложения vault.hashicorp.com/agent-inject-secret-bim-postgresql: secrets/data/apps/bim/postgres vault.hashicorp.com/agent-inject-template-bim-postgresql: |- # → env-файл POSTGRES_ADDRESS={{ index .Data.data "host" }} … ``` Дальше контейнер стартует как `sh -ec 'set -a; . /vault/secrets/; set +a; exec ./httpserver'`. **Соглашение о путях:** `secrets/data/apps/<приложение>/postgres`; нестандартные — `documentations/hasher/{rabbitmq,s3}`, `documentations/marks-s3`. Соответствующие ServiceAccount называются `-vault`. Vault используют **26 приложений**. Больше всего инъекций — у `cde` (13), `documentations` (5), `django` и `processing` (по 3). **Не используют** ровно те, у кого нет БД: девять фронтендов (§5.3.2) плюс `ams-sync` и `faas`. > Сами БД, пользователи и бакеты, на которые ссылаются эти пути, создаются не здесь, > а в [infra/terraform](https://gitlab.sarex.io/infra/terraform) (`infrastructure.yaml`). #### 5.3.6 Документация рядом с манифестами Нетипичная и полезная особенность: в каталоге приложения лежит его «паспорт». | Файл | Что внутри | Покрытие | |---|---|---| | `CONFIGURATION.md` | все переменные окружения, как они разбираются в коде, и **откуда берутся при каждом способе запуска** (локально / docker-compose / Helm в репозитории приложения / IaC+Vault / GitLab CI); команды и точки входа процессов | 32 / 37 | | `ENDPOINTS.md` | **исходящие** HTTP-вызовы сервиса: библиотека клиента, таймауты, ретраи, проброс JWT, базовые хосты по окружениям, таблица методов и путей | 28 / 37 | | `openapi.yaml` | **входящие** эндпоинты — спецификация того, что сервис предоставляет (от 9 КБ у `mapper` до 101 КБ у `issues`) | 25 / 37 | | `.env.example` | образец переменных с комментариями | 32 / 37 | Многокомпонентные приложения используют префиксы вместо одного файла: у `documentations` — `api.*`, `api-v2.*`, `pdm.*`, `frontend.*`, `dps-message-hub.*`; у `processing` — `workflows-api.*`, `workflows-engine.*`, `workflows-frontend.*`; у `workspaces` — `ENDPOINTS-workspaces-frontend.md` и `ENDPOINTS-workspace-v2-frontend.md`. **Пробелы в документации:** - нет `CONFIGURATION.md`: `control-interface`, `cross-section`, `faas`, `remarks`, `reviews`; - нет `ENDPOINTS.md`: `attachments`, `checklists`, `drawings`, `eav`, `faas`, `measurements`, `resources`, `subscriptions`, `system-log`; - нет диаграммы в `docs/apps/`: `ams-sync`, `auth-flow`, `iam` *(остальные 34 покрыты)*. Дополняющий слой — [`docs/apps/`](./docs/apps/README.md): по mermaid-диаграмме на сервис с его зависимостями, сгруппированные по доменам — Платформа/Core, Управление проектом, Документы/CDE, Контроль качества, Полевые данные. #### 5.3.7 Внешние маршруты Правила Istio живут не в `apps/`, а в `infrastructure/istio-config/<кластер>` и в патчах кластеров. Пример готовой карты маршрутов (`yc-ecp`): | Путь | Сервис назначения | |---|---| | `/api`, `/admin/` | `backend-service.django` | | `/media/` | `s3-service.django` | | `/s3/` | `s3-bim-service.django` | | `/eav/api/`, `/eav/admin/` | `eav-service.eav` | | `/bim-gazpromcps/{api,files}/` | `bim-api-gazpromcps-service.bim` | | `/bim2-gazpromcps/api/` | `bim-backend-v2-service.bim` | | `/workflows/api/` | `workflows-backend-service.processing` | | `/projects/static/` | `projects-frontend-static-service.projects` | В контурах Брусники и WB прикладной трафик уходит одним правилом на `nginx-service.global-ingress` — пути до конкретных сервисов раскрываются уже там, **вне этого репозитория**. Через Istio там опубликованы только платформенные UI (Gitea, GoAlert, OpenObserve, Superset, Kubernetes Dashboard, Camunda, Jupyter). #### 5.3.8 Где лежит код приложений Исходники продуктовых сервисов — **вне группы `infra`**: 14 групп верхнего уровня, ~393 проекта. Ориентир по владению: | Группа | Домен | Что оттуда деплоится из `apps/` | |---|---|---| | [`platform`](https://gitlab.sarex.io/groups/platform) (95) | платформенное ядро, BIM, workflows, tracking | `bim`, `iam`, `mapper`, `contracts`, `eav`, `system-log`, `processing`, `control-interface`, `resources`, `ams-sync`, `auth-flow`, `cde` | | [`pdm`](https://gitlab.sarex.io/groups/pdm) (41) | документооборот, CDE, PDF | `documentations`, `attachments`, `transmittal`, `workspaces`, `document-link`, `stamp-verification`, `subscriptions`, `comparisons` | | [`proc`](https://gitlab.sarex.io/groups/proc) (24) | процессы и контроль качества | `inspections`, `issues`, `rfi`, `reviews`, `checklists`, `flows`, `remarks`, `prescriptions`, `faas` | | [`planning`](https://gitlab.sarex.io/groups/planning) (10) | планирование | `pm`, `projects`, `message-hub` | | [`aero`](https://gitlab.sarex.io/groups/aero) (50) | гео, полевые данные, обработка съёмки | `measurements`, `drawings`, `notes`, `cross-section` | | [`generic`](https://gitlab.sarex.io/groups/generic) (56) | сквозное: монолит, CI-шаблоны, утилиты | `django` | | [`algorithms`](https://gitlab.sarex.io/groups/algorithms) (82), [`render`](https://gitlab.sarex.io/groups/render) (16) | вычислительные библиотеки, конвертеры, рендер | напрямую не деплоятся — используются джобами и воркерами | | `ai`, `marketing`, `hackathon`, `product`, `algorithms1`, `planning1` | прочее / архив | — | **Карта «приложение → репозитории с кодом».** Ключ сопоставления — имя образа `cr.yandex/crp3ccidau046kdj8g9q/` и заголовок `CONFIGURATION.md` / `ENDPOINTS.md`. | `apps/` | Компонент (образ) | Репозиторий с кодом | |---|---|---| | `ams-sync` | `ams-sync` | [platform/ams-sync](https://gitlab.sarex.io/platform/ams-sync) ✅ *(смежный: [platform/ams](https://gitlab.sarex.io/platform/ams))* | | `attachments` | `att9` / `attachments` | [pdm/attachments](https://gitlab.sarex.io/pdm/attachments) ✅ | | `auth-flow` | `auth-flow-frontend` | [platform/auth-flow-frontend](https://gitlab.sarex.io/platform/auth-flow-frontend) ✅ | | `bim` | `bim-backend-v2` | [platform/bim-backend-v2](https://gitlab.sarex.io/platform/bim-backend-v2) ✅ | | | `bim-api` (legacy) | [platform/bim](https://gitlab.sarex.io/platform/bim) ◻️ — репозитория с именем `bim-api` нет, привязка по смыслу | | `cde` | `cde`, `orchestrator`, 11 × `*-worker` | [platform/cde-orchestration-demo](https://gitlab.sarex.io/platform/cde-orchestration-demo) ✅ | | | смежные | [pdm/cde-api](https://gitlab.sarex.io/pdm/cde-api), [generic/cde-v2-write-service](https://gitlab.sarex.io/generic/cde-v2-write-service), [generic/level-cde-migration](https://gitlab.sarex.io/generic/level-cde-migration) | | `checklists` | `checklists-backend` | [proc/checklists-backend](https://gitlab.sarex.io/proc/checklists-backend) ✅ | | `comparisons` | `comparisons-backend` | [pdm/comparisons-backend](https://gitlab.sarex.io/pdm/comparisons-backend) ✅, v2 → [pdm/comparisons-api-v2](https://gitlab.sarex.io/pdm/comparisons-api-v2) | | | `comparisons-frontend` | [platform/comparisons-frontend](https://gitlab.sarex.io/platform/comparisons-frontend) ✅ | | | движок сравнения | [platform/comparator](https://gitlab.sarex.io/platform/comparator), [algorithms/comparator-algorithms](https://gitlab.sarex.io/algorithms/comparator-algorithms), [render/comparator-bins](https://gitlab.sarex.io/render/comparator-bins), [algorithms/diff-pdf-algorithm](https://gitlab.sarex.io/algorithms/diff-pdf-algorithm) | | `contracts` | `contracts` | [platform/contracts](https://gitlab.sarex.io/platform/contracts) ✅ + [platform/contracts-frontend](https://gitlab.sarex.io/platform/contracts-frontend) ✅ | | `control-interface` | `srx-admin` | [platform/srx-admin](https://gitlab.sarex.io/platform/srx-admin) ✅ | | `cross-section` | `cross-section-app` | [aero/cross-section](https://gitlab.sarex.io/aero/cross-section) ✅ *(джоба: [aero/cross-secttions-to-dwg-job](https://gitlab.sarex.io/aero/cross-secttions-to-dwg-job))* | | `django` | `backend` | [generic/sarex-backend](https://gitlab.sarex.io/generic/sarex-backend) ✅ | | | `sarex-frontend-dev` | [generic/sarex-frontend](https://gitlab.sarex.io/generic/sarex-frontend) ✅ | | | `s3-proxy` | [generic/s3-proxy](https://gitlab.sarex.io/generic/s3-proxy) ✅ | | | `srx-admin` | [platform/srx-admin](https://gitlab.sarex.io/platform/srx-admin) ✅ | | `document-link` | `document-link-frontend` | [pdm/document-link-frontend](https://gitlab.sarex.io/pdm/document-link-frontend) ✅ | | `documentations` | `documentations` | [pdm/documentation-api](https://gitlab.sarex.io/pdm/documentation-api) ✅ | | | `documentations-api-files` (v2) | [pdm/documentation-api-v2](https://gitlab.sarex.io/pdm/documentation-api-v2) ✅ | | | `hasher` | [pdm/documentation-hasher](https://gitlab.sarex.io/pdm/documentation-hasher) ✅ | | | `pdf-markings-amqp` | [pdm/pdf-markings](https://gitlab.sarex.io/pdm/pdf-markings) ✅ | | | `pdmv2` | [pdm/pdm](https://gitlab.sarex.io/pdm/pdm) ✅ | | | `documentation-frontend-app` | [pdm/documentation-frontend](https://gitlab.sarex.io/pdm/documentation-frontend) ✅ | | | `dps-message-hub` | [pdm/dps_message_hub](https://gitlab.sarex.io/pdm/dps_message_hub) ✅ | | `drawings` | `drawings-api` | [aero/drawings-api](https://gitlab.sarex.io/aero/drawings-api) ✅ | | `eav` | `eav` | [platform/eav_python](https://gitlab.sarex.io/platform/eav_python) ✅ *(gRPC-ветка: [platform/eav](https://gitlab.sarex.io/platform/eav))* | | `faas` | `export-reviews` | [proc/export-reviews](https://gitlab.sarex.io/proc/export-reviews) ✅ *(в GitLab называется `flows-export`)* | | `flows` | `flows-backend`, `flows-backend_worker` | [proc/flows-backend](https://gitlab.sarex.io/proc/flows-backend) ✅ | | | `flows-frontend` | [proc/flows-frontend](https://gitlab.sarex.io/proc/flows-frontend) ✅ | | `iam` | `iams` | [platform/iams-v2](https://gitlab.sarex.io/platform/iams-v2) ✅ *(смежный: [platform/srx-rebac](https://gitlab.sarex.io/platform/srx-rebac))* | | `inspections` | `sarex-inspections` | [proc/inspections-backend](https://gitlab.sarex.io/proc/inspections-backend) ✅ — подтверждено аннотацией `gitlab-uri` | | | фронтенд | [proc/inspections-frontend](https://gitlab.sarex.io/proc/inspections-frontend) ✅ | | | `notification:email` | [generic/jobs/email-notification-task](https://gitlab.sarex.io/generic/jobs/email-notification-task) ✅ | | `issues` | `issues` | [proc/issues-backend](https://gitlab.sarex.io/proc/issues-backend) ✅ | | | `contour_issues-frontend` | [proc/issues-frontend](https://gitlab.sarex.io/proc/issues-frontend) ✅ | | | `crop-issue-pin-area` | [proc/crop-issue-pin-area-task](https://gitlab.sarex.io/proc/crop-issue-pin-area-task) ✅ | | | `docx-to-pdf`, `rendering-template` | [pdm/docx-to-pdf](https://gitlab.sarex.io/pdm/docx-to-pdf), [pdm/rendering-template](https://gitlab.sarex.io/pdm/rendering-template) ✅ | | | `webhook-caller` | [platform/webhook-caller](https://gitlab.sarex.io/platform/webhook-caller) ✅ | | `mapper` | `mapper` | [platform/mapper](https://gitlab.sarex.io/platform/mapper) ✅ | | `measurements` | `measurements` | [aero/measurements](https://gitlab.sarex.io/aero/measurements) ✅ | | `message-hub` | `message-hub` | [planning/message-hub](https://gitlab.sarex.io/planning/message-hub) ✅ | | `notes` | `notes-backend` / `notes-frontend` | [aero/notes-backend](https://gitlab.sarex.io/aero/notes-backend), [aero/notes-frontend](https://gitlab.sarex.io/aero/notes-frontend) ✅ | | `pm` | `pm-backend` / `pm-frontend` | [planning/pm-backend](https://gitlab.sarex.io/planning/pm-backend), [planning/pm-frontend](https://gitlab.sarex.io/planning/pm-frontend) ✅ | | | `resources-frontend` | [planning/resources-frontend](https://gitlab.sarex.io/planning/resources-frontend) ✅ | | `prescriptions` | `prescriptions-frontend` | [proc/prescriptions-frontend](https://gitlab.sarex.io/proc/prescriptions-frontend) ✅ | | `processing` | `workflows-api` | [platform/workflows-api](https://gitlab.sarex.io/platform/workflows-api) ✅ | | | `workflows-engine`, `kubernetes-engine` | [platform/workflows-engine](https://gitlab.sarex.io/platform/workflows-engine) ✅ | | | `workflows-frontend` | [platform/workflows-frontend](https://gitlab.sarex.io/platform/workflows-frontend) ✅ | | | смежные | [platform/workflows-backend](https://gitlab.sarex.io/platform/workflows-backend), [generic/workflows-tools](https://gitlab.sarex.io/generic/workflows-tools), [generic/processing/job_template](https://gitlab.sarex.io/generic/processing/job_template) | | `projects` | `project-frontend-app` / `projects-frontend` | [planning/projects-frontend](https://gitlab.sarex.io/planning/projects-frontend) ✅ *(API: [planning/projects-backend](https://gitlab.sarex.io/planning/projects-backend))* | | `remarks` | `remarks-frontend` | [proc/remarks-frontend](https://gitlab.sarex.io/proc/remarks-frontend) ✅ | | | `remarks-api`, `export-remarks` | ⚠️ [proc/remarks-api](https://gitlab.sarex.io/proc/remarks-api), [proc/export-remarks](https://gitlab.sarex.io/proc/export-remarks) — **помечены `_archived_`** в GitLab, но образы ещё встречаются в манифестах | | `resources` | `sarex-resources` | [platform/sarex-resources](https://gitlab.sarex.io/platform/sarex-resources) ✅ *(старая копия: [generic/sarex-resources1](https://gitlab.sarex.io/generic/sarex-resources1))* | | `reviews` | `reviews-frontend` | [proc/reviews-frontend](https://gitlab.sarex.io/proc/reviews-frontend) ✅ | | `rfi` | `rfi-backend` / `rfi-frontend` | [proc/rfi-backend](https://gitlab.sarex.io/proc/rfi-backend), [proc/rfi-frontend](https://gitlab.sarex.io/proc/rfi-frontend) ✅ | | `stamp-verification` | `stamp-verification-frontend` | [pdm/stamp-verification-frontend](https://gitlab.sarex.io/pdm/stamp-verification-frontend) ✅ | | `subscriptions` | `subscriptions` / `sarex-subscriptions` | [pdm/sarex-subscriptions](https://gitlab.sarex.io/pdm/sarex-subscriptions) ✅ | | `system-log` | `system-log` / `system-log-worker` | [platform/system-log](https://gitlab.sarex.io/platform/system-log), [platform/system-log-worker](https://gitlab.sarex.io/platform/system-log-worker) ✅ | | `transmittal` | `transmittal-api` / `transmittal-frontend` | [pdm/transmittal-api](https://gitlab.sarex.io/pdm/transmittal-api), [pdm/transmittal-frontend](https://gitlab.sarex.io/pdm/transmittal-frontend) ✅ | | `workspaces` | `workspaces` | [pdm/workspaces-api](https://gitlab.sarex.io/pdm/workspaces-api) ✅ | | | `workspaces-frontend-static` | [platform/workspaces-frontend](https://gitlab.sarex.io/platform/workspaces-frontend) ✅ | | | `workspaces-v2-frontend` | [platform/workspace-v2-frontend](https://gitlab.sarex.io/platform/workspace-v2-frontend) ✅ | **Как искать самому, если компонента нет в таблице.** Порядок надёжности: 1. Взять имя образа из `apps//base/*.yaml` — `cr.yandex/crp3ccidau046kdj8g9q/****:tag`. В большинстве случаев `` = `path` репозитория. 2. Открыть `apps//CONFIGURATION.md` — в первой строке стоит **настоящее имя проекта** (например `apps/eav` → «Конфигурация проекта eav-python» → `platform/eav_python`). 3. Искать по GitLab: `scope: projects`, термин ≥ 3 символов, матч идёт по `path_with_namespace` — поэтому запрос по имени группы (`proc`, `pdm`, `planning`) выдаёт всю группу целиком. 4. Если сервис уже работает в кластере — у его `Deployment` есть аннотации `gitlab-uri` и `gitlab-job`, проставляемые CI, с прямой ссылкой на репозиторий и джобу сборки. ⚠️ Имя образа **не всегда** совпадает с репозиторием: `att9` → `pdm/attachments`, `iams` → `platform/iams-v2`, `pdmv2` → `pdm/pdm`, `export-reviews` → `proc/export-reviews` (в GitLab отображается как `flows-export`), `sarex-inspections` → `proc/inspections-backend`. Суффиксы `_prod`, `contour_`, `-dev` в имени образа — артефакты веток CI, не часть имени проекта. Общий CI-конвейер для всех этих репозиториев — [generic/common-ci](https://gitlab.sarex.io/generic/common-ci) (подключается в `.gitlab-ci.yml` каждого сервиса), базовый образ — [generic/base-image](https://gitlab.sarex.io/generic/base-image). ### 5.4 Вспомогательное в репозитории | Путь | Назначение | |---|---| | `inventory.yaml` | Сгенерированный инвентарь prod: namespace → тип ресурса → имена (ConfigMap/Secret/Deployment/Service/EnvoyFilter) | | `snapshots/dsinv/` | Снимки живых манифестов (в `.gitignore`, локальный артефакт) | | `docs/apps/` | Диаграмма и описание по каждому бизнес-сервису | | `gitea-data/` | Локальные данные Gitea — рабочий артефакт, **не коммитить** | --- ## 6. Перекрытия и как выбирать источник истины Для ~20 компонентов существуют оба источника — каталог в `infra/iac` и отдельный репозиторий. Наблюдаемое правило (по факту содержимого, **стоит подтвердить с владельцами**): | Ситуация | Источник истины | |---|---| | Кластер перечислен в §5.1 (`yc-*`, `brusnika-*`, `wb`, `d8-ugmk-prod`) | **`infra/iac`**, ветка `master`. Правки в отдельном репозитории туда не доедут | | Контур деплоится GitLab CI (ветки `stage`, `preprod`, `contour`, `infra`, `contour/cps`, `stronghold`) | **Отдельный репозиторий компонента**, ветка = имя контура | | Контур ГПН | **`infra/iac-gpn`** (ArgoCD), не Flux | | Namespace, БД, S3-бакет, Kafka-топик, пользователь, k8s-секрет | **`infra/terraform`** (`infrastructure.yaml`) — не создавать вручную и не дублировать в Flux | | Изолированный контур без доступа к GitLab | `infra/iac` → зеркало **Gitea** → Flux. Пуш в GitLab обязателен, но недостаточен: нужно, чтобы зеркало обновилось | Особые случаи: - **`prometheus-stack` vs `kube-prometheus-stack`** — два разных репозитория с пересекающейся зоной; в `iac` компонент один (`prometheus-stack`). Требует ревизии. - **`terraform` vs `terraform-contour-mirror`** — README идентичны, `mirror` живёт только в ветке `contour` и активен (2026-08-04). Расхождение между ними — реальный риск дрейфа. - **`istio-config`** — самый «многоконтурный» репозиторий (7 веток) и одновременно компонент в `iac`. - **`poc/iac`** — архив; не путать с `infra/iac`. --- ## 7. Эксплуатация, аудит и данные | Репозиторий | Отвечает за | |---|---| | [infra/k8s-changelog](https://gitlab.sarex.io/infra/k8s-changelog) ✅ | Ежедневный снимок всех манифестов кластера в стабильную файловую структуру и коммит в git — **читаемый diff состояния кластера** для аудита и восстановления. Чистит `status`, `managedFields`, значения секретов | | [infra/harvester](https://gitlab.sarex.io/infra/harvester) ✅ | **Резервное копирование данных платформы Sarex** (документация, планирование, замечания, рабочие процессы). Kafka-download/sync приложения, манифесты, mkdocs | | [infra/scripts/extract-kuberntes-manifests-to-s3](https://gitlab.sarex.io/infra/scripts/extract-kuberntes-manifests-to-s3) ◻️ | Выгрузка манифестов кластера в S3 | | [infra/yc-pg-dumper](https://gitlab.sarex.io/infra/yc-pg-dumper) ◻️ (+ компонент `infrastructure/yc-pg-dumper`) | Дампы PostgreSQL в Yandex Cloud | | [infra/backups/*](https://gitlab.sarex.io/infra/backups) ◻️ | `frontend`, `workers`, `sendbox`, `collect-pdm-data-from-postgresql` — подсистема бэкапов | | [infra/postgresql-ddl-extractor](https://gitlab.sarex.io/infra/postgresql-ddl-extractor) ◻️ | Извлечение DDL из PostgreSQL | | [infra/k8s-hustler](https://gitlab.sarex.io/infra/k8s-hustler), [infra/revisor](https://gitlab.sarex.io/infra/revisor), [infra/peeping](https://gitlab.sarex.io/infra/peeping) ◻️ | Утилиты инспекции/ревизии кластера | | [infra/compnay-cleanup-kit](https://gitlab.sarex.io/infra/compnay-cleanup-kit) ◻️ | Очистка данных компании *(опечатка в имени — так в GitLab)* | | [infra/py-s3-size](https://gitlab.sarex.io/infra/py-s3-size), [infra/get_size_SOD](https://gitlab.sarex.io/infra/get_size_SOD), [infra/jobs/object-storage-size-by-project](https://gitlab.sarex.io/infra/jobs/object-storage-size-by-project) ◻️ | Учёт объёмов объектного хранилища | | [infra/s3-replication-poc](https://gitlab.sarex.io/infra/s3-replication-poc) ◻️ | Репликация S3 (PoC) | | [infra/wunderwaffe-operator](https://gitlab.sarex.io/infra/wunderwaffe-operator), [infra/wunderwaffe-tasks](https://gitlab.sarex.io/infra/wunderwaffe-tasks), [infra/wunderwaffe-dumpster](https://gitlab.sarex.io/infra/wunderwaffe-dumpster) ◻️ | Собственный k8s-оператор и его задачи | --- ## 8. Контуры заказчиков | Подгруппа / репозиторий | Контур | Содержимое | |---|---|---| | [infra/wb/*](https://gitlab.sarex.io/infra/wb) ◻️ | WB | `manifestos-k8s`, `postgresql16`, `helm-of-business`. Кластер `wb` в `iac` синхронизируется из `gitea-srx.wb.ru` | | [infra/gpnt/*](https://gitlab.sarex.io/infra/gpnt) ◻️ | ГПН, OpenShift | UBI-образы: `base`, `backend`, `nginx`, `postgres`, `rabbitmq`, `redis`, `comparator`; `gpnt-os` — «manifest and helm templates for openshift» | | [infra/gpnr/*](https://gitlab.sarex.io/infra/gpnr) ◻️ | ГПН-Р | `docker-packaging-gdal-builder`, `docker-packaging-potree-builder`, `u190001439_skzssrx*` | | [infra/severstal/*](https://gitlab.sarex.io/infra/severstal) ◻️ | Северсталь | UBI-образы + `ingress`, `provision` | | [infra/iac-gpn](https://gitlab.sarex.io/infra/iac-gpn) ✅ | ГПН | ArgoCD-монорепозиторий контура | | [infra/brusnika](https://gitlab.sarex.io/infra/brusnika), [infra/uralchem](https://gitlab.sarex.io/infra/uralchem), [infra/ugok](https://gitlab.sarex.io/infra/ugok), [infra/cps2](https://gitlab.sarex.io/infra/cps2) ◻️ | Брусника, Уралхим, УГОК, ЦПС | Контурные наборы (низкая активность — часть с 2025-01) | --- ## 9. Инструменты, скрипты, документация | Репозиторий | Отвечает за | |---|---| | [infra/kafka-router](https://gitlab.sarex.io/infra/kafka-router) ✅ | Проксирование сообщений между Kafka-кластерами по `TOPIC_MAPPING`, с фильтрацией по компании (FastStream) | | [infra/tools/sarex-cli-service](https://gitlab.sarex.io/infra/tools/sarex-cli-service) | Python-скрипт подъёма локального окружения разработчика *(описание из GitLab)* | | [infra/tools/sdk-python](https://gitlab.sarex.io/infra/tools/sdk-python) ◻️ | Внутренний Python SDK | | [infra/bash-scripts](https://gitlab.sarex.io/infra/bash-scripts), [infra/python-scripts](https://gitlab.sarex.io/infra/python-scripts), [infra/scripts/*](https://gitlab.sarex.io/infra/scripts), [d.emelin/infra-scripts](https://gitlab.sarex.io/d.emelin/infra-scripts) ◻️ | Разрозненные операционные скрипты | | [infra/transfer-tools](https://gitlab.sarex.io/infra/transfer-tools) ◻️ | Перенос данных между контурами | | [infra/docs/deploy](https://gitlab.sarex.io/infra/docs/deploy), [infra/docs/services](https://gitlab.sarex.io/infra/docs/services), [infra/kb](https://gitlab.sarex.io/infra/kb) ◻️ | Документация по деплою и сервисам, база знаний | | [infra/automations/terraform-deletion_scheduled-454](https://gitlab.sarex.io/infra/automations/terraform-deletion_scheduled-454) ◻️ | Автоматизация; судя по имени — запланированное удаление ресурсов. **Проверить перед любыми действиями** | | [infra/poc/*](https://gitlab.sarex.io/infra/poc) (~30 репозиториев) ◻️ | Песочница: `k8s-teleport`, `k8s-events`, `contour-storage`, `git-server`, `minikube`, `offline-sentry`, `offline-signoz`, `cdc`, `delta`, `trace-viewer`, `streaming-dump`, `system-tests`, `s3-*`, `unity/*` и др. **Не источник истины для прода** | --- ## 10. Как пользоваться каталогом **Меняю поведение компонента в кластере из §5.1** → `infra/iac`, `infrastructure/<компонент>/patches/` или оверлей кластера; проверка — `flux get kustomizations`, `flux get helmreleases -A`. **Меняю поведение компонента в CI-контуре** → соответствующий `infra/<компонент>`, **ветка контура**, каталог `.helm/`. **Выкатываю новую версию приложения** → `apps//`: тег образа в `base/<компонент>.yaml`, если кластер наследует базу (`d8-ugmk-prod`, `yc-k8s-test`), **и отдельно** в `apps//brusnika-*/`, `apps//yc-ecp/` — эти оверлеи базу не подключают (§5.3.4). Перед правкой сверься с §5.3.3: возможно, оверлей вообще не подключён к кластеру. **Нужен новый секрет для приложения** → положить в Vault по пути `secrets/data/apps//…` и добавить `vault.hashicorp.com/agent-inject-*` в `podAnnotations` (§5.3.5). В git секрет не кладём. **Ищу исходники сервиса по имени namespace или образа** → карта «приложение → репозиторий» в §5.3.8; там же порядок поиска, если компонента в таблице нет. **Нужен новый namespace / БД / бакет / топик / секрет** → `infra/terraform`, `infrastructure.yaml` (секреты — через SOPS, см. `SOPS.md`); для контура — `terraform-contour` / `terraform-contour-mirror`. **Нужен новый кластер** → `kubespray` → `k8s-provision` → `flux bootstrap --path=clusters/<имя>` в `infra/iac`. **Понять, что реально крутится в кластере** → `inventory.yaml` в этом репозитории и `infra/k8s-changelog` (git-история состояния). --- ### Открытые вопросы 1. Привести оверлеи `brusnika-prod`, `brusnika-stage`, `yc-ecp` к наследованию `../base` — сейчас это полные копии, которые молча расходятся с базой (§5.3.4). 2. Разобрать 17 неподключённых оверлеев приложений и 25 каталогов `dsinv/`: удалить или подключить (§5.3.3). 3. Выровнять версию `universal-chart` — шесть приложений остались на 0.1.7 при базовой 0.1.9. 4. Разграничить `prometheus-stack` и `kube-prometheus-stack` — какой из них актуален. 5. Зафиксировать регламент синхронизации `terraform` ↔ `terraform-contour-mirror`. 6. Для ~60 компонентных репозиториев определить, какие мигрируют в `infra/iac`, а какие остаются на CI-деплое; остальное — архивировать. 7. Закрыть пробелы в паспортах сервисов (§5.3.6) и подтвердить назначение репозиториев с ◻️.