Skip to main content

Configuration

Synced from network-inventory-planning

This page is a copy of docs/docs/operations/configuration.md on develop, derived from that repository's code. Edit it there, then re-sync.

Every binary is configured only through environment variables. The tables below list every variable read by cmd/* and internal/* (non-test code), one table per binary. "Chart value" names the key in charts/network-inventory-planning/values.yaml that renders the variable, when the chart renders it at all.

network-inventory-planning (API, consumers, relay, tickers)​

Source: cmd/network-inventory-planning/main.go, internal/adapters/outbound/telemetry/telemetry.go.

VariableDefaultRequired?MeaningChart value
HTTP_ADDR:8080noListen address of the REST API.config.httpAddr
DATABASE_URLnonenoOLTP Postgres DSN. Unset = diagnostic mode: no migrations, no read models, no consumers; only /healthz and POST /v1/transfer-proposal-runs work and every other route answers 503. Set = migrate, open the pool (MaxConns 10, statement_timeout 5s) and ping, or refuse to boot.database.url / database.existingSecret + existingSecretKey
MIGRATIONS_PATHinternal/adapters/outbound/postgres/migrationsnoDirectory of the OLTP *.sql migrations. The image sets migrations (/app/migrations).(image ENV)
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDSN used only by the golang-migrate step: a direct (non-PgBouncer) connection, because migrate's session-scoped pg_advisory_lock does not survive transaction pooling (ADR 0006). The runtime pool never uses it.database.migrationsExistingSecretKey (secret key, optional: true)
KAFKA_BROKERSnonefor approval and KafkaComma-separated broker list. Unset: no outbox writer (so POST /v1/transfer-approvals answers 503 saga-unavailable), no consumers, no saga-health check, no scheduled rebalance.kafka.brokers (rendered only when kafka.enabled)
SITE_CAPABILITY_CONSUMER_GROUPnonenoConsumer group of the site-capability consumer on warehouse.facility.events. Empty = that consumer does not run.kafka.siteCapabilityConsumerGroup
SITE_SKU_DEMAND_CONSUMER_GROUPnonenoGroup of the site-sku-demand consumer on warehouse.order-management.events. Empty = off.kafka.siteSkuDemandConsumerGroup
CAPACITY_PLAN_CONSUMER_GROUPnonenoGroup of the capacity-plan consumer on warehouse.warehouse-planning.events. Empty = off.kafka.capacityPlanConsumerGroup
TRANSFER_REPLY_CONSUMER_GROUPnonenoGroup of the transfer-reply consumer on warehouse.inventory.events (allocation replies and destination facts). Empty = off, and approved transfers never leave ALLOCATING.kafka.transferReplyConsumerGroup
TRANSFER_FACT_CONSUMER_GROUPnonenoGroup of the transfer-fact consumer on warehouse.fulfillment.events. Empty = off, and allocated transfers never leave ALLOCATED.kafka.transferFactConsumerGroup
OUTBOX_RELAY_ENABLEDempty (off)noAny non-empty value starts the outbox relay (needs KAFKA_BROKERS). Empty: events stay as rows in outbox_events until a relay runs.config.outboxRelayEnabled (default "true")
OUTBOX_MAX_ATTEMPTS20noOutbox relay attempt cap (ADR 0016): a row that has failed this many sends is excluded from the relay's claims and logged at ERROR (outbox_id, topic, event_type, key). It stays in outbox_events with attempts and last_error until an operator re-arms it (UPDATE outbox_events SET attempts = 0 WHERE id = ..., see the Runbook); later rows, including rows with the same key, overtake it. 0 = unlimited (one poison row then blocks the relay forever). A negative or unparsable value logs a WARN and uses 20.config.outboxMaxAttempts (default "20")
PLANNING_MAX_STALENESS10mnoFreshness budget of every fact in the fail-closed planning snapshot (simulation, approval, scheduled rebalance). Must be a positive Go duration; anything else fails the boot.config.maxStaleness
TRANSFER_PICK_PATH_IDnonefor approvalProcess path id carried by the pick-leg WorkDemandReleased (ADR 0005). Unset: approval answers 503 config-incomplete.config.transferPickPathId
TRANSFER_PICK_CPT_OFFSET2hnoCPT horizon of the pick demand (release time + offset). An invalid or non-positive value is logged at WARN and the default is used.config.transferPickCptOffset
TRANSFER_DISPATCH_PATH_IDnonefor the dispatch legPath id of the dispatch-leg demand. Unset: a TransferPicked fact still moves the transfer to PICKED, but no dispatch demand is released (logged, committed past).config.transferDispatchPathId
TRANSFER_DISPATCH_CPT_OFFSET3hnoCPT horizon of the dispatch demand. Invalid → WARN and default.config.transferDispatchCptOffset
NIP_HEALTH_CHECK_INTERVAL5mnoTick of the saga-health (stuck transfer) check (ADR 0007). 0 disables it. An unparsable or negative value disables the check with an ERROR log (the process still starts). Also off when there is no outbox (no KAFKA_BROKERS).not rendered; use extraEnv
NIP_STUCK_THRESHOLDSALLOCATING=1h,PICKED=24h,IN_TRANSIT=72h (every other non-terminal state 24h)noComma-separated STATE=DURATION overrides merged over the defaults. An unknown state, bad duration or non-positive value disables the check with an ERROR log.not rendered; use extraEnv
NIP_REBALANCE_SCHEDULEnone (off)noInterval of the observe-only scheduled rebalance. Unset or 0 = off; invalid = off with an ERROR log. Needs the outbox.not rendered; use extraEnv
SERVICE_VERSIONdevnoservice.version resource attribute of traces and metrics.image tag or Chart.AppVersion
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noOTLP/gRPC endpoint (insecure) for traces and metrics (ADR 0012). Export never blocks startup.otel.endpoint (rendered when otel.enabled, default otel-collector.observability.svc.cluster.local:4317)
ENVIRONMENTlocalnodeployment.environment.name resource attribute.environment

The API process logs with Go's default slog logger. LOG_LEVEL sets its level: debug, info (default), warn/warning, error, case-insensitive; anything else is info. The chart does not render it for the API; use extraEnv.

mcp​

Source: cmd/mcp/main.go.

VariableDefaultRequired?MeaningChart value
MCP_ADDR:8090noListen address (Streamable HTTP at / and /mcp, plus GET /healthz).mcp.httpAddr
DATABASE_URLnonenoOLTP DSN. Unset: the server boots but every tool returns an isError result (read-side-unavailable or read-models-unavailable). Set: migrate, connect, ping or exit 1.same secret as the API
MIGRATIONS_PATHinternal/adapters/outbound/postgres/migrationsnoOLTP migrations directory.mcp.migrationsPath (migrations)
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDirect DSN for the migration step only.database.migrationsExistingSecretKey
PLANNING_MAX_STALENESS10mnoFreshness budget used by simulate_transfer_options. Invalid → exit 1.config.maxStaleness
LOG_LEVELinfonodebug, info, warn/warning, error (JSON logs on stdout).mcp.logLevel
OTEL_SERVICE_NAMEnetwork-inventory-planning-mcpnoservice.name of this binary's traces and metrics (OTLP export is configured by OTEL_EXPORTER_OTLP_ENDPOINT as for the API).not rendered; use extraEnv

a2a​

Source: cmd/a2a/main.go (loadBootConfig). Read-only: no Kafka, outbox relay or consumer, so none of those variables exist here.

VariableDefaultRequired?MeaningChart value
A2A_ADDR:8093noListen address (JSON-RPC at / and /a2a, the Agent Card at /.well-known/agent-card.json, GET /healthz).a2a.httpAddr
A2A_AGENT_URLnoneyesAbsolute http(s) URL of the JSON-RPC endpoint, advertised on the Agent Card. Missing or not absolute → exit 1 before telemetry and the listener.a2a.agentUrl (default http://<release>-a2a.<ns>.svc.cluster.local:8093/)
DATABASE_URLnoneyesOLTP DSN. Missing → exit 1. Migrate, connect, ping or exit 1.same secret as the API
MIGRATIONS_PATHinternal/adapters/outbound/postgres/migrationsnoOLTP migrations directory.a2a.migrationsPath (migrations)
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDirect DSN for the migration step only.database.migrationsExistingSecretKey
LOG_LEVELinfonodebug, info, warn/warning, error (JSON logs on stdout).a2a.logLevel
SERVICE_VERSIONdevnoAgent Card version and service.version of traces and metrics.not rendered; use extraEnv
OTEL_SERVICE_NAMEnetwork-inventory-planning-a2anoservice.name of this binary's traces and metrics.not rendered; use a2a.extraEnv

nip-projector​

Source: cmd/nip-projector/main.go (loadConfig).

VariableDefaultRequired?MeaningChart value
ANALYTICS_DATABASE_URLnoneyesRead-write DSN of the analytical database (direct Postgres: it also runs the analytical migrations). Missing → exit 1.analytics.database.projectorUrl or analytics.database.existingSecret
KAFKA_BROKERSnoneyesBrokers; the projector consumes warehouse.network-inventory-planning.analytics. Missing → exit 1.kafka.brokers
ANALYTICS_CONSUMER_GROUPnetwork-inventory-planning-analyticsnoThe projector's fixed consumer group. A new group id starts from the earliest offset and rebuilds the model.analytics.projector.consumerGroup
ANALYTICS_MIGRATIONS_PATHanalytics/migrationsnoAnalytical migrations directory (relative to /app in the image).analytics.migrationsPath
ADMIN_ADDR:8091noAdmin server (/healthz, /readyz).analytics.projector.adminAddr
LOG_LEVELinfonoLog level of the JSON logger.analytics.logLevel
OTEL_SERVICE_NAMEnetwork-inventory-planning-projectornoservice.name of this binary's traces and metrics (OTLP export is configured by OTEL_EXPORTER_OTLP_ENDPOINT as for the API).not rendered; use extraEnv

nip-reports​

Source: cmd/nip-reports/main.go (loadConfig).

VariableDefaultRequired?MeaningChart value
ANALYTICS_READER_DATABASE_URLnoneone of the twoReader DSN, ideally a read-only role. Wins over ANALYTICS_DATABASE_URL.analytics.database.reportsUrl (falls back to projectorUrl) or the existing secret
ANALYTICS_DATABASE_URLnoneone of the twoFallback DSN for single-role local runs. With neither set the process exits 1.—
HTTP_ADDR:8092noListen address of the reports server.analytics.reports.httpAddr
LOG_LEVELinfonoLog level.analytics.logLevel
OTEL_SERVICE_NAMEnetwork-inventory-planning-reportsnoservice.name of this binary's traces and metrics (OTLP export is configured by OTEL_EXPORTER_OTLP_ENDPOINT as for the API).not rendered; use extraEnv

The reports pool opens every connection with default_transaction_read_only = on regardless of the role.

Chart switches that are not environment variables​

ValueDefaultEffect
kafka.enabledfalseRenders KAFKA_BROKERS and the five group ids into the API Deployment.
mcp.enabledfalseRenders the mcp Deployment and Service.
a2a.enabledfalseRenders the a2a Deployment and Service (and the Kong route when a2a.route.enabled).
analytics.enabledfalseRenders the analytics-projector and analytics-reports Deployments (and the reports Service); needs kafka.enabled and a DSN source.
frontend.enabledfalseRenders the nip_mfe console remote (nginx) Deployment and Service.
autoscaling.enabled, analytics.projector.autoscaling.enabled, analytics.reports.autoscaling.enabledfalseHPAs (max 3, 2 and 3 replicas).
ingress.enabled / gatewayApi.enabledfalseEdge routing of the REST API, switched on by warehouse-infra.
otel.enabledtrueRenders OTEL_EXPORTER_OTLP_ENDPOINT.

See the Runbook for what each Deployment runs and how it is probed.