feat: put API replicas behind HAProxy

HAProxy 3.4 is the only published entry point; api runs as
API_REPLICAS replicas without ports, found through Docker DNS and
checked on /health/ready. Retries only on connection failure, LB errors
in the contract error format, resource limits and per-service secrets.
Adds scripts/stop-one.sh, LB-aware restart.sh, make replicas /
instances / lb_stats and replica tests driven by EXPECT_REPLICAS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-10 18:05:05 +03:00
co-authored by Claude Opus 5.5
parent 8e15e02898
commit ab71c3b51e
31 changed files with 1295 additions and 240 deletions
+3 -2
View File
@@ -70,8 +70,9 @@ testpaths = ["student-tests"]
# каталог с дефисом не пакет: хелперы импортируются как модули
pythonpath = ["student-tests"]
# проверки отказов (маркер fault) — только make failure_checks: там
# pytest -m fault перекрывает этот -m
addopts = "-v -rP --strict-markers -m 'not fault'"
# pytest -m fault перекрывает этот -m. -rsP: вывод прошедших тестов и
# причины пропуска (тесты реплик против одного процесса)
addopts = "-v -rsP --strict-markers -m 'not fault'"
markers = [
"spec(capability, scenario): сценарий основного спека, который проверяет тест",
"fault: проверка отказа хранилища; нужен стенд make failure_checks и его hook",