ff08677d12 feat(connectivity_tester): new stack for synthetic connectivity checks (#39)
## Summary

New Swarm stack `connectivity_tester` — a long-running Python service that
probes the cluster's connectivity every 10 minutes and logs structured
PASS/FAIL per check.

## What's in the box

- `connectivity_tester/Dockerfile` — python:3.12-slim base
- `connectivity_tester/app.py` — main loop: read env, run round, sleep, repeat
- `connectivity_tester/endpoints.py` — `EXPECTED_INTERNAL`, `EXPECTED_EXTERNAL`, `NEGATIVE` lists
- `connectivity_tester/stack-compose.yml` — Swarm stack with `mode: global` (one task per node)

## Behaviour

- One round every `PERIOD_SECONDS` (default 600).
- Per round: TCP probes against the three allow-lists + the negative-list.
- Negative-list endpoints (cloud metadata services etc.) MUST NOT respond.
  If they do → log `ERROR LEAK`, container keeps running.
- `EXTRA_ENDPOINTS` env var accepts comma-separated `host:port` pairs for ad-hoc checks.

## Placement

`mode: global` — Swarm schedules one task on each node. No node pinning.

Networks: `hermes_proxy` overlay (for internal DNS resolution) + `default`
(for egress via squid).

## Acceptance

- After deploy, `docker service logs connectivity_tester_connectivity-tester`
  shows one round per 10 minutes.
- Logs visible at info level in normal conditions (squid, hermes-gateway,
  etc. all PASS).
- Any unexpected reachability or unreachable internal endpoint triggers
  ERROR-level log within `CHECK_TIMEOUT_S`.

## Related

- Org1/hermes-voice-gateway#3 (Path B: build custom voice-gateway) — blocked by Org1/hermes-voice-gateway#5 (connectivity testing container)
- Org1/hermes-voice-gateway#5 — this PR resolves the blocker

## Verification checklist

- [ ] Stack `connectivity_tester` shows up in `docker stack ls`
- [ ] `docker service ps connectivity_tester_connectivity-tester` shows one task per node (odroid, rudolf-T, xu4)
- [ ] Logs show first round within 30 seconds of start
- [ ] `docker service logs --tail 50 connectivity_tester_connectivity-tester` shows PASS for at least squid:3128 and hermes-gateway:8000
- [ ] Negative-list (169.254.169.254) is unreachable (PASS OK-NEG)

---------

Co-authored-by: brencher_bot <rudolfss13@gmail.com>
Co-authored-by: hermes <hermes@rudolf.keenetic.link>
Reviewed-on: admin/ansible#39
Co-authored-by: hermes <rudolfss13+hermes@gmail.com>
2026-09-20 13:26:07 +02:00
x
2026-08-05 11:10:16 +02:00
2020-12-02 23:35:47 +03:00
2025-05-16 23:19:05 +02:00
2023-03-11 20:55:38 +01:00
2020-12-02 23:35:47 +03:00
2017-06-08 23:08:24 +03:00
2018-05-02 23:12:40 +03:00
2020-12-02 23:35:47 +03:00
2021-08-19 00:16:56 +03:00
2023-03-11 20:55:38 +01:00
2025-06-02 23:56:25 +02:00
2020-12-03 00:22:50 +03:00
2020-12-02 23:35:47 +03:00
2017-11-28 22:58:00 +03:00
2025-06-02 23:56:25 +02:00
2020-12-02 23:35:47 +03:00
2020-12-02 23:35:47 +03:00
2020-12-02 23:35:47 +03:00
S
Description
No description provided
11 MiB
Languages
Python 46.4%
Jinja 32.6%
Shell 14.4%
Dockerfile 6.6%