Skip to content

Agones Factorio Relay

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 typed GameEvents 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 the irc-gateway service, so this is the single integration point the game needs.
  • ClickHouse writer — inserts snapshots, player events, and rotation rows into gameops.factorio_* (schema in packages/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).

┌──────────────────────────────────────────────────────────┐
│ 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_* │
└──────────────────────────────────────────────────────────┘
EnvDefaultNotes
FACTORIO_CONSOLE_LOG/shared/log/console.logTailable shared volume mounted from the same emptyDir as the factorio container
FACTORIO_RCON_ADDR127.0.0.1:27015Same-pod loopback; RCON server lives in the factorio container
FACTORIO_RCON_PASSWORD(required)Mounted from SealedSecret
IRC_SERVERirc.kbve.com
IRC_PORT6697TLS
IRC_USE_TLStrue
IRC_NICKfactorio-bot
IRC_CHANNEL#generalSingle channel for v1. Multi-channel routing is Phase 3c+ scope
IRC_PASSWORD(unset)NickServ identify
FACTORIO_SERVER_IDfactorio-defaultStamps every ClickHouse row; later: factorio-vanilla-1, factorio-pvp-1, etc.
FACTORIO_SCENARIO_DEFAULTkbveFallback 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_DATABASEgameops
  • Tracking issue #11138
  • Schema PR — packages/data/ch/schemas/factorio.sql
  • Sibling Phase 0 image — kbve/agones-factorio