Skip to content

Environment Variables

Every config key supported by Lakta can be set via an environment variable. This is useful for secrets, deployment-time overrides, and container environments.

Transform the dot-notation config key:

  1. Prefix with LAKTA_
  2. Convert to uppercase
  3. Replace . with _

Examples:

Config keyEnvironment variable
modules.grpc.server.default.portLAKTA_MODULES_GRPC_SERVER_DEFAULT_PORT
modules.db.pgx.primary.dsnLAKTA_MODULES_DB_PGX_PRIMARY_DSN
modules.otel.default.enabledLAKTA_MODULES_OTEL_DEFAULT_ENABLED
modules.http.fiber.default.portLAKTA_MODULES_HTTP_FIBER_DEFAULT_PORT

Environment variables override config file values but are overridden by CLI flags:

config file < environment variable < CLI flag
# kubernetes deployment
env:
- name: LAKTA_MODULES_DB_PGX_DEFAULT_DSN
valueFrom:
secretKeyRef:
name: db-secret
key: dsn
- name: LAKTA_MODULES_OTEL_DEFAULT_ENDPOINT
value: "http://otel-collector:4317"