Second version of Rosti's service discovery
  • Go 99%
  • Dockerfile 1%
Find a file
Adam Štrauch c41e068c89
All checks were successful
Tests / test (push) Successful in 57s
Build a dev image / build (push) Successful in 3m33s
Update base images in Dockerfile to Go 1.26 and Alpine 3.23
2026-05-09 00:56:15 +02:00
.gitea/workflows Update Go version to 1.26 and upgrade setup-go action to v6 in test workflow 2026-05-09 00:54:27 +02:00
.vscode Support for Prometheus SD 2024-12-22 13:40:50 +01:00
api Fix docs 2025-01-14 09:17:03 +01:00
cli Add environment variable configuration for Lobby2 and enhance refresher functionality 2026-05-09 00:53:05 +02:00
docs Fix docs 2025-01-14 09:17:03 +01:00
nodes Fix labels 2024-12-22 13:43:31 +01:00
refresher Add environment variable configuration for Lobby2 and enhance refresher functionality 2026-05-09 00:53:05 +02:00
.gitignore Support for Prometheus SD 2024-12-22 13:40:50 +01:00
Dockerfile Update base images in Dockerfile to Go 1.26 and Alpine 3.23 2026-05-09 00:56:15 +02:00
go.mod Initial commit 2024-12-08 02:30:07 +01:00
go.sum Initial commit 2024-12-08 02:30:07 +01:00
README.md Add environment variable configuration for Lobby2 and enhance refresher functionality 2026-05-09 00:53:05 +02:00
Taskfile.yml Support for Prometheus SD 2024-12-22 13:40:50 +01:00

Lobby 2 - simple service discovery

This is second version of my Lobby projects that doesn't require NATS. All clients uses single service discovery server that keeps track of their presence.

Each instance, except its liveness can share labels which describe what's hosted on this instance and that can used by others instances for various things. There is also a simple KV store for additional info.

Configuration

Lobby2 can be configured entirely through environment variables. When any of the node refresher variables below is present, the refresher runs in strict env mode and does not read or create the JSON files at CONFIG_PATH and NODE_PATH.

Master/API settings:

  • LISTEN - API listen address, default 0.0.0.0:1352
  • TOKEN - API bearer token
  • DUMP_PATH - path to the persisted nodes dump, default /var/lib/lobby2/nodes.json
  • DROP_AFTER_SECONDS - how long a node stays alive without refresh, default 60

Node refresher settings:

  • MASTER_HOST - master node host, required in env mode
  • MASTER_PROTO - master protocol, default http
  • MASTER_TOKEN - master token, required in env mode
  • MASTER_PORT - master port, default 1352
  • NODE_HOSTNAME - node hostname, defaults to the local hostname
  • NODE_LABELS - comma-separated labels, for example laptop,dev,amd64
  • NODE_KV - comma-separated key=value pairs, for example prometheus_host=fw.rosti.cz,prometheus_port=9999

Example env-only node setup:

export TOKEN='super-secret-api-token'
export MASTER_HOST='master.example.internal'
export MASTER_TOKEN='super-secret-master-token'
export MASTER_PROTO='https'
export MASTER_PORT='443'
export NODE_HOSTNAME='laptop-01'
export NODE_LABELS='laptop,workstation'
export NODE_KV='prometheus_host=fw.rosti.cz,prometheus_port=9999'

lobby2 node

If you do not set any of the node refresher env vars, Lobby2 keeps using the JSON files at CONFIG_PATH and NODE_PATH.