Configuration Guide
How runtime configuration works — Valkey config, environment variables, and multi-instance deployment.
Two Layers
| Layer | Stored in | Contains | Changes require |
|---|---|---|---|
| Connection | .env file | DB URLs, cache URLs, broker | Container restart |
| Business | Valkey cache | Topics, table names | Nothing (hot reload) |
Environment Variables
| Variable | Description |
|---|---|
| FUNCTION_TARGET | Function name = Valkey config key |
| DATABASE_URL | PostgreSQL connection |
| CACHE_URL | Valkey connection |
| MQTT_BROKER | MQTT broker URL |
Valkey Config Pattern
docker exec fnkit-cache valkey-cli SET fnkit:config:uns-state \
'{"table":"uns_state","topics":["v1.0/.../cnc-01/status"]}'Config cached in-memory for 30 seconds. Change topics without redeploying.
Which Functions Use Valkey Config?
| Function | Config Key |
|---|---|
| uns-log | fnkit:config:uns-log |
| uns-state | fnkit:config:uns-state |
| uns-productivity | fnkit:config:uns-productivity |
Others don't need Valkey config: uns-sim (config.yaml), uns-framework (env), uns-cache, uns-stoppage, uns-input, uns-kpi.