Files
mtusi2026lab7-fork/infra/README.md

19 lines
2.0 KiB
Markdown
Raw Permalink 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.
# Инфраструктура (lab7)
Топология — корневой `compose.yaml`; роль → сервис → версия → health → volume → сеть/порт → credentials — таблица в `REPORT.md`.
| Каталог | Что внутри |
| --- | --- |
| `haproxy/haproxy.cfg` | LB: внешний TLS `:8443`, mTLS к репликам API (identity `lb`), лимиты, JSON-ошибки |
| `haproxy/broker-gate.cfg` | mTLS-gate брокера: CA + CRL + allowlist CN `api`/`worker`, backend — Redis на loopback |
| `haproxy/otel-gate.cfg` | mTLS-gate Collector: OTLP только `api`/`worker`, метрики только `prometheus` |
| `postgres/` | entrypoint (ключ TLS в tmpfs 0600, uid 70), `pg_hba.conf` (только hostssl + SCRAM), роли (initdb) |
| `redis/cache.sh`, `redis/broker.sh` | TLS/ACL кэша сессий и ACL брокера (producer/consumer), ACL-файл в tmpfs с SHA-256 паролей |
| `openbao/` | `server.hcl` (не dev, file storage, TLS), `agent-api.hcl`/`agent-worker.hcl` (AppRole + шаблоны), `policies/` |
| `otel/collector.yaml` | Collector на loopback за gate, mTLS к Loki/Tempo, scrub атрибутов |
| `prometheus/` | scrape Collector по mTLS, `web.yml` (TLS + клиентский cert), `client.yml` (healthcheck), rules lab6 |
| `loki/`, `tempo/` | `http_tls_config` с `RequireAndVerifyClientCert`, внутренний gRPC на 127.0.0.1 |
| `grafana/` | provisioning data sources с mTLS (`$__file{}`), dashboard lab6 |
Bootstrap (идемпотентно, повторный запуск безопасен): `scripts/init_secrets.py` → `scripts/pki.py init` → `scripts/bao.py init|unseal|configure` → `docker compose up -d` (`migrate`, `s3-init` — one-shot). Всё вместе: `python scripts/ops.py up`. Restart hook перезапускает все хранилища с volumes (и OpenBao с unseal оператором); failover hook останавливает только заданную API-реплику.