Rivergate

Deployment

Rivergate is self-hosted. Use Docker Compose to evaluate it locally and Helm to run it on Kubernetes against your own PostgreSQL and Redis.

Topology

ComponentNotes
APIStateless; run as many replicas as you need behind a load balancer.
WorkerRuns audit checkpoints, key rotation, lease expiry and revocation, and replacement schedules. Scale and permission it independently.
DashboardStatic assets served by their own container; proxies /api, /auth and /health to the API so browser sessions stay same-origin.
PostgreSQLThe durable store. Use a managed or externally operated instance for production.
RedisRequired for readiness and sign-in flow state. Holds nothing durable.
Key materialRoot-key files for API and worker; audit signing key for the worker only.

Migrations are not run at application startup. Compose runs a one-shot migration service first; Helm runs a pre-install and pre-upgrade migration job.

Docker Compose (local)

The Compose stack in rivergate-deployment is for development and evaluation. It runs the API, worker, dashboard, PostgreSQL and Redis with named volumes, health checks, a private network, non-root application containers and loopback-bound ports. It is not a high-availability profile.

make -C rivergate-deployment up          # initialize credentials on first run, start everything
make -C rivergate-deployment bootstrap-admin
make -C rivergate-deployment down

See the Quickstart for the full walkthrough.

Helm on Kubernetes

Two charts live in rivergate-helm:

Prepare

  1. Publish versioned application and dashboard images. The API image contains rivergate-server, rivergate-worker and rivergate-migrate.
  2. Provision PostgreSQL and Redis. The chart defaults to PostgreSQL verify-full and Redis TLS.
  3. Create the database Secret named by database.existingSecret, containing runtime username and password, and a separately privileged migration_username and migration_password.
  4. Create the Redis Secret named by redis.existingSecret, with its configured password key.
  5. Create the root-key Secret named by keyMaterial.rootKeySecret, holding the exact active marker and versioned root-key files.
  6. Create the audit signing Secret named by keyMaterial.auditSigningKeySecret.
  7. Decide publicURL, hosts, image tags, TLS ingress and any host:port entries for dynamic credential targets.
Keep secrets out of values

Never pass passwords, root keys or audit signing keys through --set, values files, ConfigMaps or source control. Use Kubernetes Secrets with etcd encryption, or an external secret or CSI provider.

Install

helm upgrade --install rivergate ./charts/rivergate \
  --namespace rivergate --create-namespace \
  --set publicURL=https://rivergate.example.com \
  --set ingress.enabled=true \
  --set ingress.host=rivergate.example.com \
  --set ingress.tls.secretName=rivergate-tls

To review manifests first:

helm lint charts/rivergate
helm template rivergate charts/rivergate --namespace rivergate

What the chart does

Configuration reference

Configuration comes from an optional JSON file named by RIVERGATE_CONFIG_FILE, validated at startup. Environment variables override file values. Validation errors name fields, never values. Passwords are read from files, never inline.

SettingPurpose
RIVERGATE_ENVdevelopment, test or production. Production tightens TLS requirements.
HTTP_ADDRAPI listen address.
DASHBOARD_URLPublic dashboard origin; used for redirects and cookies.
WORKER_HEALTH_ADDR · WORKER_HEALTH_URLWorker health listener, and the URL the API uses to read it. The URL must be HTTPS if set; leave empty unless you front the worker with an internal TLS proxy.
METRICS_ADDR · WORKER_METRICS_ADDRPrivate Prometheus listeners for the API and worker.
LOG_LEVEL · LOG_FORMATStructured logging (json by default).
ROOT_KEY_DIRDirectory of versioned root-key files. Required by API and worker.
AUDIT_SIGNING_KEY_FILEEd25519 signing key for the worker.
AUDIT_CHECKPOINT_INTERVALCheckpoint cadence as a Go duration. Default 5m.
DATABASE_HOST · DATABASE_PORT · DATABASE_NAME · DATABASE_USERPostgreSQL connection.
DATABASE_PASSWORD_FILEPath to the password file.
DATABASE_SSLMODEProduction requires verify-ca or verify-full.
REDIS_ADDR · REDIS_DB · REDIS_TLS · REDIS_PASSWORD_FILERedis connection.
DYNAMIC_CREDENTIAL_ALLOWED_TARGETSExact host:port list for dynamic PostgreSQL targets. Set on API and worker.
HTTP_READ_HEADER_TIMEOUT · HTTP_READ_TIMEOUT · HTTP_WRITE_TIMEOUT · HTTP_IDLE_TIMEOUT · SHUTDOWN_TIMEOUTServer timeouts as Go durations.
OTEL_EXPORTER_OTLP_*Optional OpenTelemetry export. See Observability.

An example file is config.example.json.

Database

Scaling and availability

Networking and TLS

Upgrading

  1. Back up PostgreSQL and the root-key and signing-key directories (see Backup and recovery).
  2. Review release notes and chart values changes.
  3. Apply Operator CRD changes first if they changed (see Operator upgrades).
  4. Run helm upgrade; the migration job runs before the new pods.
  5. Verify readiness, sign-in, a secret read and audit integrity.

When rotating the active root key, preserve every old version still needed to unwrap stored keys, update the root-key Secret, and roll both the API and worker pods. The key directory is copied once per pod, so a Secret update does not refresh a running pod. See root key rotation.