Wadm Configuration
These guides are for deploying wadm
in production. For local development and testing, simply run wash up
. For more information on wadm
, see the wadm
docs.
Preconfiguring Storage
The following is important to avoid data loss in production!
wadm
uses two NATS Key Value buckets for storage: application manifests, and lattice state.
Application manifests
The manifests bucket contains the "source of truth" for wadm
applications. If the manifest storage is lost, all knowledge of applications is gone. For production deployments, we highly recommend preconfiguring this bucket with multiple replicas and taking backups regularly.
For example, to configure the manifests bucket with 3 replicas:
nats kv add wadm_manifests --history=1 --replicas=3 --storage=file
The default bucket name is wadm_manifests
. If you use another name, you will need to set the --manifest-bucket-name
flag
Lattice state
If the state bucket is lost, wadm
will self-heal and recover state over the next couple of minutes, as hosts report their state via events.
Configuration Options
wadm
is configured via command line flags or environment variables. The following configuration options are supported:
Option | Environment Variable | Description | Default Value |
---|---|---|---|
-l , --structured-logging | WADM_STRUCTURED_LOGGING | Whether or not to use structured log output (as JSON) | false |
-t , --tracing | WADM_TRACING_ENABLED | Whether or not to enable opentelemetry tracing | false |
-e , --tracing-endpoint | WADM_TRACING_ENDPOINT | The endpoint to use for tracing. Setting this flag enables tracing, even if --tracing is set to false. | http://localhost:55681/v1/traces |
-d | WADM_JETSTREAM_DOMAIN | The NATS JetStream domain to connect to | None |
-s , --nats-server | WADM_NATS_SERVER | The URL of the remote nats server you want to connect to | 127.0.0.1:4222 |
--nats-seed | WADM_NATS_NKEY | Use the specified nkey file or seed literal for authentication. Must be used in conjunction with --nats-jwt | None |
--nats-jwt | WADM_NATS_JWT | Use the specified jwt file or literal for authentication. Must be used in conjunction with --nats-seed | None |
--nats-creds-file | WADM_NATS_CREDS_FILE | (Optional) NATS credential file to use when authenticating. If --nats-creds-file is set, --nats-seed and --nats-jwt cannot be used | None |
--nats-tls-ca-file | WADM_NATS_TLS_CA_FILE | (Optional) NATS TLS certificate file to use when authenticating | None |
--state-bucket-name | WADM_STATE_BUCKET_NAME | Name of the bucket used for storage of lattice state | wadm_state |
--manifest-bucket-name | WADM_MANIFEST_BUCKET_NAME | Name of the bucket used for storage of manifests | wadm_manifests |
--cleanup-interval | WADM_CLEANUP_INTERVAL | The amount of time in seconds to give for hosts to fail to heartbeat and be removed from the store. By default, this is 120s because it is 4x the host heartbeat interval | 120 |
-j , --max-jobs | WADM_MAX_JOBS | (Advanced) Tweak the maximum number of jobs to run for handling events and commands. Be careful how you use this as it can affect performance | 256 |
-i , --host-id | WADM_HOST_ID | The ID for this wadm process. This is used to help with debugging when identifying which process is doing the work | Random UUIDv4 |
--api-prefix | WADM_API_PREFIX | The API topic prefix to use. This is an advanced setting that should only be used if you know what you are doing | wadm |
--stream-prefix | WADM_STREAM_PREFIX | This prefix to used for the internal streams. When running in a multitenant environment, clients share the same JS domain (since messages need to come from lattices). Setting a stream prefix makes it possible to have a separate stream for different wadms running in a multitenant environment. This is an advanced setting that should only be used if you know what you are doing | wadm |
--stream-persistence | WADM_STREAM_PERSISTENCE | Nats streams storage type, possible values: file, memory | file |
Experimental features and options
The following options are hidden from the cli help output since these are more experimental/advanced, please proceed with caution.
Option | Environment Variable | Description | Default Value |
---|---|---|---|
--multitenant | WADM_MULTITENANT | Whether or not to enable multitenancy. This is for advanced use cases with segmented NATS account traffic | false |
--state-bucket-max-bytes | WADM_STATE_BUCKET_MAX_BYTES | Maximum bytes to keep for the state bucket | -1 |
--manifest-bucket-max-bytes | WADM_MANIFEST_BUCKET_MAX_BYTES | Maximum bytes to keep for the manifest bucket | -1 |
--command-stream-max-bytes | WADM_COMMAND_STREAM_MAX_BYTES | Maximum bytes to keep for the command stream | -1 |
--event-consumer-stream-max-bytes | WADM_EVENT_CONSUMER_STREAM_MAX_BYTES | Maximum bytes to keep for the event consumer stream | -1 |
--status-stream-max-bytes | WADM_STATUS_STREAM_MAX_BYTES | Maximum bytes to keep for the status stream | -1 |
--notify-stream-max-bytes | WADM_NOTIFY_STREAM_MAX_BYTES | Maximum bytes to keep for the notify stream | -1 |
--wasmbus-event-stream-max-bytes | WADM_WASMBUS_EVENT_STREAM_MAX_BYTES | Maximum bytes to keep for the wasmbus event stream | -1 |