Agones Factorio Relay
Overview
Section titled “Overview”Rust binary that runs as a sidecar container in the Factorio Agones GameServer pod (apps/kube/agones/factorio/, landing in Phase 1 / 3b). It exists so the factorio container itself can stay vanilla — no Agones SDK plumbing, no chat-bridge logic, no telemetry — and lifecycle work happens out-of-process where it can be iterated without rebuilding the 1+ GB Factorio image.
Three roles, one process:
- Log tail — reads
/shared/log/console.log(written by the factorio container via--console-log) and emits typedGameEvents for[CHAT] / [JOIN] / [LEAVE] / [COMMAND] / [STATS]markers. - IRC bridge — forwards
[CHAT]plus join/leave events to the configured channel (default#general) on the existing kbve IRC network. IRC → Discord is already wired by theirc-gatewayservice, so this is the single integration point the game needs. - ClickHouse writer — inserts snapshots, player events, and rotation rows into
gameops.factorio_*(schema inpackages/data/ch/schemas/factorio.sql). 14-day raw TTL, 90-day rotation history.
Phase 3a (this entry) ships the crate scaffold so the image builds and publishes. The IRC, RCON, and ClickHouse modules are stubbed and log only. Real impl lands in Phase 3c (IRC + RCON wiring) and Phase 4d (ClickHouse insert + scenario.lua [STATS] emitter).
Architecture (target — Phase 3c+)
Section titled “Architecture (target — Phase 3c+)”┌──────────────────────────────────────────────────────────┐│ GameServer Pod ││ ││ ┌──────────────┐ ┌────────────────┐ ┌──────────────┐ ││ │ factorio │ │ factorio-relay │ │ agones-sdk │ ││ │ │ │ │ │ (injected) │ ││ │ udp:34197 ←──┼──┼─→ rcon 27015 │ │ │ ││ │ rcon:27015 ──┼─→│ 127.0.0.1 │ │ http:9358 │ ││ │ │ │ │ │ grpc:9357 │ ││ │ writes → │ │ reads → │ │ │ ││ │ /shared/log/ │ │ /shared/log/ │ │ │ ││ │ console.log │ │ console.log │ │ │ ││ └──────┬───────┘ └────────┬───────┘ └──────────────┘ ││ │ │ ││ └────emptyDir: /shared/log────┘ ││ ││ IRC out ←──── factorio-relay ────→ irc.kbve.com:6697 ││ CH writes ←─── factorio-relay ───→ gameops.factorio_* │└──────────────────────────────────────────────────────────┘Runtime knobs
Section titled “Runtime knobs”| Env | Default | Notes |
|---|---|---|
FACTORIO_CONSOLE_LOG | /shared/log/console.log | Tailable shared volume mounted from the same emptyDir as the factorio container |
FACTORIO_RCON_ADDR | 127.0.0.1:27015 | Same-pod loopback; RCON server lives in the factorio container |
FACTORIO_RCON_PASSWORD | (required) | Mounted from SealedSecret |
IRC_SERVER | irc.kbve.com | |
IRC_PORT | 6697 | TLS |
IRC_USE_TLS | true | |
IRC_NICK | factorio-bot | |
IRC_CHANNEL | #general | Single channel for v1. Multi-channel routing is Phase 3c+ scope |
IRC_PASSWORD | (unset) | NickServ identify |
FACTORIO_SERVER_ID | factorio-default | Stamps every ClickHouse row; later: factorio-vanilla-1, factorio-pvp-1, etc. |
FACTORIO_SCENARIO_DEFAULT | kbve | Fallback when a [STATS] line doesn’t include scenario |
CLICKHOUSE_URL | (unset) | When unset, the ClickHouse writer is disabled; the relay still bridges IRC ↔ RCON |
CLICKHOUSE_USER | (unset) | |
CLICKHOUSE_PASSWORD | (unset) | |
CLICKHOUSE_DATABASE | gameops |
- Tracking issue #11138
- Schema PR —
packages/data/ch/schemas/factorio.sql - Sibling Phase 0 image —
kbve/agones-factorio