Поднять API в нескольких репликах за HAProxy и добавить скрипты отказа реплики и rolling update

This commit is contained in:
2026-11-02 17:20:38 +03:00
parent 951fd0d517
commit c5cdcb3377
9 changed files with 312 additions and 10 deletions
+10 -1
View File
@@ -34,7 +34,7 @@ test-failover:
# ---------------------------------------------------------------------------
EVIDENCE_DIR ?= evidence
.PHONY: build vet unit secrets up down destroy logs concurrency explain
.PHONY: build vet unit secrets up down destroy logs concurrency explain instances rollout
build:
go build -o bin/server ./cmd/server
@@ -63,6 +63,15 @@ destroy:
logs:
docker compose logs
# Which container answers under which X-Instance-Id.
instances:
sh scripts/instances.sh
# Replaces every API replica with one built from the current sources, without
# downtime; restore a replica stopped by stop-one with `docker compose start api`.
rollout:
sh scripts/rollout.sh
concurrency:
go run ./tools/concurrency --base-url "$(BASE_URL)" --output "$(EVIDENCE_DIR)/concurrency.json"