Configuration
Audience System Administrator
Since pyck v0.27.0
This page covers the required and optional environment variables and the NATS configuration requirements.
Required environment variables
Section titled “Required environment variables”All pyck binaries require the following environment variable to be set:
PYCK_ENV(required): Specifies the environment name (for example,production,staging,dev,local)- This variable must be set explicitly in your deployment configuration
- The application will fail to start if this variable is missing or empty
- Used for resource naming and namespace construction (for example,
pyck-{PYCK_ENV}-workers)
Example configuration:
Docker Compose:
environment: - PYCK_ENV=productionKubernetes ConfigMap:
apiVersion: v1kind: ConfigMapmetadata: name: pyck-configdata: PYCK_ENV: "production"IMPORTANT: As of commit 15ffdc33 (April 2026), PYCK_ENV has no default value. Deployments that previously relied on the implicit “local” default must now explicitly set this variable.
Optional discovery environment name
Section titled “Optional discovery environment name”The management service publishes a client discovery document at /.well-known/pyck-configuration. Its meta.environment field holds the name of the environment as listed in the DNS TXT record _pyck.pyck.cloud, for example dev, test, demo or eu. For the format of the document, see Client discovery document.
The name can be set with this optional environment variable:
PYCK_DISCOVERY_ENVIRONMENT: The name published asmeta.environment(default: the value ofPYCK_ENV)
Example Configuration:
environment: - PYCK_DISCOVERY_ENVIRONMENT=euThe management service builds the document once at startup. Restart it after you change the variable.
Optional health check configuration
Section titled “Optional health check configuration”Temporal workers expose a /health HTTP endpoint (enabled by default on port 8080) to support deployment health monitoring. This endpoint verifies that the worker is actively polling Temporal task queues.
The health server can be configured via these optional environment variables:
HEALTH_DISABLED: Set to1to disable the health endpointHEALTH_PORT: HTTP port for health checks (default:8080)HEALTH_INTERVAL: How often to probe Temporal (default:10s)HEALTH_TIMEOUT: RPC timeout for each probe (default:3s)HEALTH_MAX_STALE: Maximum age of last successful probe before reporting unhealthy (default:90s)
Example Configuration:
environment: - HEALTH_PORT=9090 - HEALTH_INTERVAL=30s - HEALTH_MAX_STALE=120sThe health endpoint returns:
- 200 OK when the worker is actively polling Temporal
- 503 Service Unavailable when polling has stalled or Temporal is unreachable
This is particularly useful for container orchestrators (Kubernetes, fly.io) that need to detect and restart wedged workers.
NATS configuration requirements
Section titled “NATS configuration requirements”pyck uses NATS.io for event streaming and service messaging with a strict account separation for security. The system enforces the following requirements:
Tenant account separation
Section titled “Tenant account separation”The tenant account (configured via PYCK_NATS_TENANT_ACCOUNT_NAME, default: pyck-tenants) must be separate from the services’ account.
Why the accounts must be separate:
- Tenant clients connect to NATS through a dedicated account isolated from backend services
- If tenant clients were placed in the services’ account, they could potentially access streams and subjects they shouldn’t, creating a security vulnerability
- The answers to tenant API calls would be delivered to whatever reply subject the client names, and stored in a stream under another tenant’s or the platform’s subjects
Startup validation
Section titled “Startup validation”BREAKING CHANGE (since v0.26.0): The management service now performs an account separation check at startup using the NATS system API ($SYS.REQ.USER.INFO). The service will refuse to start if:
PYCK_NATS_TENANT_ACCOUNT_NAMEnames the same account as the management service’s own NATS connection- The NATS server does not have a system account configured (required for the
$SYS.REQ.USER.INFOAPI)
Required NATS Server Configuration:
- A
system_accountmust be configured in the NATS server config - The tenant account declared in the server config must match
PYCK_NATS_TENANT_ACCOUNT_NAME - The tenant account must be distinct from the account used by pyck backend services
Example Error: If the validation fails, you’ll see an error like:
failed checking PYCK_NATS_TENANT_ACCOUNT_NAME: the NATS tenant account is the services' account: "pyck-tenants"Resolution:
- Verify your NATS server configuration has a
system_accountdefined - Ensure
PYCK_NATS_TENANT_ACCOUNT_NAMEpoints to a separate account for tenant clients - Confirm the account exists in your NATS server configuration’s
accountsblock
Consumer create subject (breaking change)
Section titled “Consumer create subject (breaking change)”BREAKING CHANGE (in the next release after v0.26.0): tenant clients can no longer create push consumers. Every NATS server configuration, the Kubernetes one included, must export and import the consumer create subject the same way config/nats/nats.conf does:
# account "pyck", exports{service: "$PYCK.TENANT.CONSUMER.CREATE.>", accounts: ["pyck-tenants"]}
# account "pyck-tenants", imports{service: {account: "pyck", subject: "$PYCK.TENANT.CONSUMER.CREATE.>"}, to: "$JS.API.CONSUMER.CREATE.>"}If you changed PYCK_NATS_TENANT_ACCOUNT_NAME, use that account name instead of pyck-tenants.
These lines replace the export and import of $JS.API.CONSUMER.CREATE.>. Deploy the new management image before the NATS configuration: until management runs, tenant clients cannot create consumers. For the same reason, only roll back management together with the NATS configuration. For how tenant clients create consumers, see Tenant NATS clients.