- Python 63%
- Shell 22%
- HCL 15%
Hetzner deployment infrastructure #
Kamal application configs live in config/deploy.*.yml. bin/kamal loads ignored local .env and .kamal/secrets; secrets must never enter Git. bin/setup_vps currently configures the host with a shell script. Cloud resources and DNS are not yet managed declaratively here.
Frontend releases for the domain now use Cloudflare Workers: main/CV, Tincanban, Toss, Twang and Quitter. bin/worker SITE deploys captured/built static assets. Native backends and their volumes remain under Kamal; old frontend containers remain available for rollback.
Gonzo blog and shared analytics: deployment instructions.
bin/kamal gonzo-blog keeps the existing main-site service/domain; gonzo-sink
deploys the independent Roc collector. bin/gonzo-secrets creates their private
credentials once; .env.gonzo is loaded only for those two services.
Reflux workflow connections require ACIDREFLUX_TINCANBAN_APPLICATION_ORIGIN
and ACIDREFLUX_TINCANBAN_REACTION_IMAGE alongside its Identity settings. The
origin must match the Tincanban browser application; the image must be an approved
immutable reaction digest. Kamal forwards both settings to Reflux. The image
selects the executor for new connections; existing executors keep their stored
runtime configuration.
Production architecture #
Source locations, Worker contracts, data ownership and verified deployment boundaries: architecture. Import-first Hetzner/DNS code, provider lockfile, fresh-host cloud-init and plan checks: infra. The existing server is not imported yet; Hetzner credentials remain a placeholder until owner connects access. No production apply or resource replacement ran.
Sink analytics and diagnostics #
ClickHouse is a Kamal accessory declared in config/deploy.mesh-lighthouse.yml, pinned to an image version. It runs on the internal Kamal network without published host ports, with a persistent clickhouse-data directory, 1 CPU and 2 GiB memory limit. The memory headroom allows log aggregation alongside background merges and system logs.
Required local secret:
.env:CLICKHOUSE_PASSWORD=<generated password>.kamal/secrets:CLICKHOUSE_PASSWORD=$CLICKHOUSE_PASSWORD
Initialize once with bin/kamal mesh-lighthouse accessory boot clickhouse. Accessory upgrades require an explicit bin/kamal mesh-lighthouse accessory reboot clickhouse; ordinary application deploys do not update accessories. Removing this accessory can delete its data: do not use accessory removal for upgrades.
Current browser event intake is Roc sink /events at
analytics.meta-uber-engineer.dev; Rusty /telemetry is retired debug plumbing.
config/deploy.gonzo-sink.yml declares separate shared_analytics and
telemetry.events databases, the latter with 30-day TTL and independent writer/
admin credentials. Both telemetry passwords must be set together to enable it.
Frontend deployment supplies its public project/key, sampling and batching;
database credentials remain server-side. Configuration does not itself prove
live traffic or table contents; verify actual sink receipts/rows separately.
Rusty source releases come from bobishh/rusty main, with blind storage and
explicit public-board publication in one binary. Its GitHub CI checks formatting,
protocol/storage tests and real-process restart identity; Kamal deploys the checked
immutable image. Gonzo blog and Roc sink sources are tracked together in the private
bobishh/gonzo-yuppie (blog) and bobishh/tinsink (analytics) repositories on main. TinSink CI builds the production Linux
image and runs isolated API, persistence, ClickHouse SQL and browser acceptance.
No automated ClickHouse backup is configured yet. Diagnostic TTL is intentional; primary Lighthouse workspace storage needs separate backup and restore validation.
ClickHouse metric_log has thousands of columns. Its default 131072-row threshold
keeps smaller Wide parts on the horizontal merge path; production merges consumed
1.54 GiB and rejected OTel inserts at the container memory limit. The accessory
mounts config/clickhouse-system-logs.xml to use vertical merging for eligible
Wide parts regardless of row count. Collection, retention, data and the 2 GiB
container limit are unchanged. Existing tables need the same targeted setting:
SET max_query_size = 524288; ALTER TABLE system.metric_log MODIFY SETTING vertical_merge_algorithm_min_rows_to_activate = 0;.
The session query-size override only accommodates this existing 310 KiB table
metadata. Keep the config and table setting aligned so a later restart does not
rotate the table back to default settings. Rollback removes the config setting
and resets this table setting; no restart is needed for the live ALTER.
Infrastructure-as-code ownership #
Keep one owner per resource:
- OpenTofu: existing Hetzner server and ordinary DNS declarations in
infra/; networks, cloud firewalls, Primary IPs and external volumes await API inventory/import. - cloud-init: initial host packages, Docker prerequisites and disk mounts; replace
bin/setup_vpsafter parity validation. Later host changes require image/bootstrap updates and a controlled replacement or explicit migration. Ansible is excluded by preference. - Kamal: application releases, routing and accessory containers, including ClickHouse.
- SOPS with age: versioned encrypted secrets; runtime plaintext remains outside Git.
OpenTofu configuration and a fresh-host cloud-init template are implemented; production import, remote state, bootstrap parity and SOPS remain unfinished. Import existing cloud resources before any apply; first plan must show no resource mutations. Set up protected remote state, locking and recovery before managing production resources. Validate restores before declaring infrastructure reproducible.
Developer Kubernetes learning track #
The intended exercise is developer-facing release ownership, including Helm charts, CI releases, failure diagnosis and rollback. Use a separate single-node K3s environment first. tincanban and Lighthouse images can be reused; Kamal remains the current production release owner. Do not let Helm and Kamal manage the same production resources simultaneously.
Start with immutable commit image tags, startup/readiness probes, explicit resource limits, secret injection and CI rollout/rollback checks. A failed application rollout must preserve persistent data. Helm rollback does not undo database/data migrations; exercise those separately. Keep ClickHouse outside the initial cluster, then practice stateful migration and restore deliberately.
Saved diagnostic queries: config/sync-record.sql follows one opaque record ID; config/sync-health.sql aggregates stage durations and outcomes over ten minutes. Run through the private ClickHouse connection using server-side credentials.