Поставить реплики API за HAProxy и описать остановку одной из них.

Внешний порт остаётся только у балансировщика, миграции применяются один раз, а stop-one оставляет выбранную реплику остановленной.
This commit is contained in:
2026-11-07 12:46:37 +03:00
parent 3601ca5443
commit fd54119d3f
8 changed files with 301 additions and 1 deletions
+35
View File
@@ -0,0 +1,35 @@
global
log stdout format raw local0 info
maxconn 200
defaults
log global
mode http
option httplog
timeout connect 2s
timeout client 10s
timeout server 10s
timeout http-request 5s
timeout check 2s
timeout queue 2s
retries 1
resolvers docker
nameserver dns 127.0.0.11:53
resolve_retries 3
timeout resolve 1s
timeout retry 1s
hold valid 1s
accepted_payload_size 8192
frontend fe_http
bind *:8080
default_backend be_api
backend be_api
balance roundrobin
option httpchk
http-check send meth GET uri /health/ready ver HTTP/1.1 hdr host api
http-check expect status 200
default-server inter 1s fall 2 rise 1
server-template srv 8 api:8080 check resolvers docker init-addr none resolve-prefer ipv4