Configuration model
Unkey services read configuration from a TOML file passed at startup. Environment variables can be referenced with${VAR} and are expanded before parsing. Defaults and validation run after parsing.
The config schema maps to svc/sentinel/config.go.
Full config example:
Field reference
Identifies this sentinel instance in logs, traces, and ClickHouse records. Auto-generated if
omitted.
Workspace this sentinel serves. Validation rejects empty values.
Environment this sentinel serves. Sentinel validates that resolved deployments belong to this
environment and returns 404 for mismatches.
Underlying cloud platform identifier (for example,
aws).Geographic region identifier (for example,
us-east-1). Used for instance selection (sentinel
only routes to instances in the same region) and as a label on metrics and traces.TCP port the HTTP server binds to. Range: 1-65535. Krane-managed deployments set this to
8040.MySQL configuration. Sentinel fails to start without a valid primary DSN.
ClickHouse analytics configuration. When omitted or when the URL is empty, sentinel uses a no-op
analytics backend and no request telemetry is recorded.
Redis configuration for rate limiting, usage limiting, and key caching. When omitted or when the
URL is empty, the middleware engine is disabled and sentinel operates in pass-through mode (no
policy evaluation).
Gossip-based distributed cache invalidation. When omitted, sentinel uses local-only caches and
relies on TTL expiration for data freshness. With gossip enabled, peer sentinel nodes broadcast
invalidation events for faster cache convergence.
Tracing, logging, and metrics configuration.
Environment variable injection
Krane renders the TOML configuration at apply time and injects it via theUNKEY_CONFIG_DATA environment variable. Database credentials, Redis URLs, and ClickHouse URLs come from Kubernetes Secrets in the sentinel namespace, which Krane templates into the TOML.
