Files
cloud-ip-validator/rxprod-compose/sources/validator-agent.example.yaml
T
ayurishchevandClaude Opus 5.5 55d383bd34 control-api: reduce SQLite disk writes; add diagnostic mode
Disk writes:
- SQLite pragmas in DSN: wal_autocheckpoint=10000, journal_size_limit=64MB, cache_size=64MB
- migration 0013: drop redundant idx_checks_registry_cycle
- results batched: UpsertChecksIfOpen in one transaction; agent flushes every 5s and before complete
- heartbeat kept in memory, persisted on state change or every 60s; startup grace for stale sweeps

Diagnostic mode:
- POST /api/v1/admin/diagnostics/attach|detach, GET /api/v1/admin/diagnostics
- migration 0014: diagnostic_holds; validator state "diagnostic"
- held addresses are not queued, held validators skip sweeps, port release and delete

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 07:01:24 +03:00

60 lines
3.5 KiB
YAML
Raw 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.
# Validator-agent configuration. Runs on each validator VM. validator_id
# must match one of the control-api config's `validators[].validator_id`.
validator_id: "validator_01"
control_api_url: "http://control-api.internal:8080"
# Имя переменной окружения с токеном агентов control-api (тот же, что у
# prober; CONTROL_API_AGENT_TOKEN на стороне control-api). Нужен для записи
# результатов/событий; register/heartbeat/получение задания работают без него.
# Токен отправляется только в control-api — не на ip_echo_urls и не на цели
# проверок.
control_api_token_env: "CONTROL_API_AGENT_TOKEN"
poll_interval_seconds: 5
self_check:
timeout_seconds: 10
# Способы самопроверки в порядке приоритета (допустимо: ip_echo,
# control_api); по умолчанию [ip_echo]. Самопроверка успешна, если адрес
# подтвердил любой способ: пробуются по порядку, остановка на первом
# успешном, к следующему переходим и при отсутствии ответа, и при
# несовпадении адреса. Таймаут timeout_seconds действует на каждый способ
# отдельно (зависший первый способ не лишает второй времени). control_api спрашивает у control-api, с какого адреса он видит
# это соединение; рекомендуется [control_api, ip_echo], когда control-api
# стоит вне облака и валидатор ходит к нему напрямую (через внешнюю сеть).
# Ограничение: если control-api достижим по внутренней сети облака, он
# увидит частный адрес валидатора и control_api всегда даст несовпадение —
# тогда оставьте только ip_echo (или он сработает вторым в списке).
methods: [control_api, ip_echo]
# Used by the ip_echo method. Must be a resource genuinely outside the cloud project — OpenStack only
# applies floating-IP SNAT to traffic leaving via the external network,
# so anything reachable over the project's internal network (including
# control-api itself, if it's on the same internal network) would report
# this validator's private address instead, regardless of whether the
# floating IP is correctly attached. Tried in order; falls through to the
# next URL only on error/timeout, never on a genuine mismatch. Defaults
# to these two public services if omitted.
ip_echo_urls:
- "https://api.ipify.org"
- "https://ifconfig.me/ip"
checks:
https_timeout_seconds: 10
# Attempts per HTTPS URL (first + retries) and pause between them.
https_attempts: 3
https_retry_delay_seconds: 2
# Check results are sent to control-api in batches this often (and always
# before the address is reported complete).
results_flush_seconds: 5
# Background traceroute (IPv4) after an HTTPS check fails on all attempts;
# result goes to the address event log as "traceroute_result".
traceroute:
enabled: true
timeout_seconds: 90
max_hops: 30
poll_interval_seconds: 5
icmp_timeout_seconds: 5
icmp_count: 3
ssh:
enabled: false
timeout_seconds: 5