Skip to content

Latest commit

 

History

History
93 lines (67 loc) · 2.31 KB

File metadata and controls

93 lines (67 loc) · 2.31 KB

Worker Config (worker.yaml)

Overview

worker.yaml is the primary runtime configuration file. It defines environment variables, secret references, and opt-in runtime output used inside the worker container.

When To Use

Use this when you need to:

  • Define runtime environment variables.
  • Reference secrets that should be resolved at startup.
  • Override defaults at runtime without rebuilding images.

Key Concepts

  • Runtime-only config: /home/udx/.config/worker/worker.yaml.
  • Deployment env vars override worker.yaml values.
  • Secret reference behavior is documented in docs/secrets.md.
  • Provider authentication is not configured in worker.yaml.

Examples

Basic

kind: workerConfig
version: udx.io/worker-v1/config
config:
  env:
    APP_MODE: "worker"
    AWS_REGION: "us-west-2"
  secrets:
    DB_PASSWORD: "aws/db-password/us-west-2"
    API_KEY: "azure/kv-prod/api-key"

Static Env and Secret References

kind: workerConfig
version: udx.io/worker-v1/config
config:
  env:
    API_KEY: "dev-only-static-key"
  secrets:
    DB_PASSWORD: "azure/kv-prod/db-password"

API_KEY is injected as-is. DB_PASSWORD is resolved from the provider after auth exists and then exported as an environment variable.

Runtime Environment and Precedence

  1. Deployment environment variables (highest priority)
  2. Deployment environment variables containing secret references (resolved at startup)
  3. worker.yaml config.secrets
  4. worker.yaml config.env

Example override:

# worker.yaml (production defaults)
config:
  secrets:
    ES_PASSWORD: "gcp/prod-project/es-password"

Deployment override example:

docker run --rm \
  -e ES_PASSWORD="gcp/staging-project/es-password" \
  usabilitydynamics/udx-worker:latest

Common Pitfalls

  • Storing plaintext secrets in worker.yaml.
  • Putting cloud login/session setup in worker.yaml.
  • Forgetting that deployment env vars override runtime config.

Runtime Output

By default the worker does not print runtime config details. Set WORKER_RUNTIME_OUTPUT=true to emit the redacted runtime contract JSON on stdout.

See docs/runtime-output.md for the output contract, capture examples, and CI artifact usage.

Related Docs

  • docs/services.md
  • docs/secrets.md
  • docs/deployment.md
  • docs/runtime-output.md