Configuration
Realm is configured through a YAML file. By default, Realm looks for config.yaml (or config.yml) in the current working directory. You can specify a custom path using the --config flag or the REALM_CONFIG_FILE environment variable.
Unknown keys are rejected: a misspelled or unsupported field makes Realm refuse to load the file.
File Structure
Section titled “File Structure”A Realm configuration file has the following top-level sections:
data_path: # Where realm stores its datalog_level: # Minimum log levelagent: # Agent settingsnodes: # Nodes to manageloads: # Workloads to deployRoot config
Section titled “Root config”| Field | Type | Default | Description |
|---|---|---|---|
data_path |
string | /var/lib/realm (Unix) or %ProgramData%\realm (Windows) |
Path to store client or agent data (ID file, database, cluster state file) |
log_level |
string | info |
Minimum log level: debug, info, warn or error. The LOG_LEVEL environment variable overrides it |
data_path: ./datalog_level: debugIncludes and variables
Section titled “Includes and variables”Any value can be loaded from another YAML file with the !include tag. Paths are resolved relative to the file that contains the tag:
nodes: !include nodes.yamlloads: !include loads.yaml${VAR} and $VAR references in values are expanded from the environment. Variables can also be defined in a .env file next to the config file; the environment takes precedence over .env.
nodes: lab1: url: http://${LAB1_HOST}:9000 driver: linuxEvery referenced variable must be defined, otherwise the config fails to load. Keep this in mind for values that contain a literal $, such as passwords.
Nodes represent the machines where loads are deployed. Each node has a name (the map key), a URL pointing to its agent API, and a driver.
nodes: lab1: url: http://192.168.1.59:9000 driver: linux
lab2: url: http://192.168.1.51:9000 driver: linuxurl field can be also configured with a mDNS address:
nodes: lab1: url: http://lab1.local:9000...Or with the agent’s unix socket (see Unix Socket). The socket path must be absolute:
nodes: local: url: unix:///run/realm/agent.sock driver: linux| Field | Type | Required | Description |
|---|---|---|---|
url |
string | Yes | URL of the node’s agent API (http://, https://, unix://) |
driver |
string | Yes | Node driver type. Currently supported: linux, windows |
driver_config |
object | No | Driver-specific configuration |
timeout |
object | No | Power-on/off timeouts, see Timeouts |
cloud_init |
object | No | Cloud init configuration |
registries |
list | No | Container registries used by the node |
Timeouts
Section titled “Timeouts”How long the CLI waits for the node to power on or off. After a power-on it waits up to start for the agent to answer. After a shutdown it waits up to stop for the agent to stop answering. Values are Go durations (90s, 5m, 1h30m).
nodes: lab1: url: http://192.168.1.59:9000 driver: linux timeout: start: 10m stop: 1m| Field | Type | Default | Description |
|---|---|---|---|
start |
duration | 5m |
Time to wait for the agent to come up after a power-on |
stop |
duration | 30s |
Time to wait for the agent to go down after a shutdown |
Cloud init
Section titled “Cloud init”Realm serves cloud-init configurations for any node with a cloud_init configuration, at /cloudinit/<node>/meta-data, /cloudinit/<node>/user-data and /cloudinit/<node>/network-config.
nodes: lab1: url: http://192.168.1.59:9000 driver: linux cloud_init: meta_data: instance-id: lab1 local-hostname: lab1 user_data: hostname: lab1 fqdn: lab1.local packages: - curl runcmd: - apt-get update| Field | Type | Description |
|---|---|---|
meta_data |
object | cloud-init meta-data document |
user_data |
object | cloud-init user-data (#cloud-config) |
network_config |
object | cloud-init network-config (version 1 or 2) |
Only a subset of the cloud-init modules is supported in user_data; unsupported keys are rejected when the config is loaded.
Container Registries
Section titled “Container Registries”Container registries can be configured per node:
nodes: lab1: url: http://192.168.1.59:9000 driver: linux registries: - host: ghcr.io auth: token: ghp_xxxxxxxxxxxx - host: registry.example.com:5000 insecure: true auth: username: admin password: secret - host: nexus.example.com ca_file: /etc/realm/certs/nexus-ca.pem auth: username: admin password: secretinsecure downgrades the connection to plain HTTP. For a registry that speaks
HTTPS but presents a certificate Go refuses (for example one that relies on the
legacy Common Name field instead of SANs), point ca_file at its CA bundle, or
set skip_tls_verify: true to bypass verification altogether.
| Field | Type | Description |
|---|---|---|
host |
string | Registry host (e.g., ghcr.io, docker.io) |
insecure |
bool | Allow HTTP instead of HTTPS |
skip_tls_verify |
bool | Do not verify the registry’s TLS certificate |
ca_file |
string | PEM bundle with extra CAs trusted for this registry |
auth.username |
string | Username (use with password) |
auth.password |
string | Password (use with username) |
auth.token |
string | Authentication token (alternative to username/password) |
Linux Node Driver
Section titled “Linux Node Driver”The linux driver runs on a host where Realm is installed as a agent. It supports optional Wake-On-LAN to power the host on remotely:
nodes: server: url: http://192.168.1.59:9000 driver: linux driver_config: wol: true MAC: "00:11:22:33:44:55"| Field | Type | Description |
|---|---|---|
wol |
bool | Enable Wake-On-LAN |
MAC |
string | MAC address (required when wol is true) |
Windows Node Driver
Section titled “Windows Node Driver”nodes: workstation: url: http://192.168.1.20:9000 driver: windows driver_config: wol: true MAC: "00:11:22:33:44:55"| Field | Type | Description |
|---|---|---|
wol |
bool | Enable Wake-On-LAN |
MAC |
string | MAC address (required when wol is true) |
Loads are the workloads deployed to nodes. Each load has a name (the map key), a target node, a driver (container or process), and driver-specific configuration.
loads: web: node: lab1 driver: container driver_config: image: docker.io/library/nginx:latest
my_service: node: lab2 driver: process driver_config: start_cmd: node start_args: "server.js" stop_signal: SIGTERM| Field | Type | Required | Description |
|---|---|---|---|
node |
string | Yes | Target node name or expression |
driver |
string | Yes | Load driver: container or process |
driver_config |
object | Yes | Driver-specific configuration |
depends_on |
list | No | List of load names this load depends on |
For detailed driver configuration, see Container Driver and Process Driver.
Dependencies
Section titled “Dependencies”Loads can declare dependencies on other loads using depends_on. Realm builds a dependency graph and ensures loads start and stop in the correct order. Circular dependencies are detected and rejected.
loads: database: node: lab1 driver: container driver_config: image: docker.io/library/postgres:15
api: node: lab1 driver: container driver_config: image: docker.io/library/myapi:latest depends_on: - databaseIn this example, database will always start before api, and api will stop before database.
Dynamic Node Selection
Section titled “Dynamic Node Selection”The node field supports expressions using expr-lang for dynamic node selection. The expression context provides:
nodes- array of all configured nodesselectAny(slice)- randomly select one item from a slice
nodes: vps-1: url: http://vps1:9000 driver: linux vps-2: url: http://vps2:9000 driver: linux
loads: web: node: selectAny(filter(nodes, .Name startsWith "vps-")) driver: container driver_config: image: docker.io/library/nginx:latestThe agent section configures the Realm agent. All fields are optional and have sensible defaults.
agent: listen_address: 0.0.0.0 listen_port: 9000 log_format: textGeneral
Section titled “General”| Field | Type | Default | Description |
|---|---|---|---|
listen_address |
string | 0.0.0.0 |
Address to bind the agent API |
listen_port |
int | 9000 |
Port to bind the agent API |
listen_socket |
string | Empty | Additional unix socket to expose the agent API on. Disabled when empty |
listen_socket_group |
string | realm |
Group owning the unix socket, as a group name or numeric gid |
disable_tcp |
bool | false |
Serve the API only on listen_socket. Requires listen_socket to be set |
log_format |
string | text |
Log output format: text or json |
The log level is configured with the root-level log_level field.
Unix Socket
Section titled “Unix Socket”Besides the TCP listener, the agent API can optionally be exposed on a unix socket:
agent: listen_address: 0.0.0.0 listen_port: 9000 listen_socket: /run/realm/agent.sock listen_socket_group: realmTo serve the API only on the socket, set disable_tcp: true. mDNS advertising is skipped in that case, since there is no TCP endpoint to advertise.
Container Runtime
Section titled “Container Runtime”| Field | Type | Default | Description |
|---|---|---|---|
containerd_sock |
string | /run/containerd/containerd.sock (Unix) or npipe:////./pipe/containerd-containerd (Windows) |
Containerd socket path |
containerd_namespace |
string | realm |
Containerd namespace |
cni_path |
string | /usr/lib/cni (Unix) or %ProgramFiles%\containerd\cni\bin (Windows) |
Path to CNI plugins |
volumes_pool |
string | realm_volumes |
ZFS pool name for container volumes |
zfs |
bool | false |
Enable ZFS for volume management |
Artifacts repository (Experimental)
Section titled “Artifacts repository (Experimental)”Realm agents can expose artifacts when configured.
| Field | Type | Default | Description |
|---|---|---|---|
artifacts |
ArtifactsRepository | Empty | Artifacts repository config |
artifacts field expects the following attributes:
| Field | Type | Default | Description |
|---|---|---|---|
auth_required |
bool | false | Endpoints available only for authed requests |
raw_path |
string | nil | Point to a local directory with raw artifacts (nesting not allowed) |
Database
Section titled “Database”Realm stores agent state in an embedded bbolt database at <data_path>/realm.db. No configuration is required.
Discovery
Section titled “Discovery”Agents always advertise themselves over mDNS (unless agent.disable_tcp is set). Use realm nodes discover to list the agents found on the local network and match them with the configured nodes.
Environment Variables
Section titled “Environment Variables”Configuration fields that have a default value can be set via environment variables using the REALM_ prefix. Nested fields use underscores as separators:
REALM_AGENT_LISTEN_ADDRESS=0.0.0.0REALM_AGENT_LISTEN_PORT=9000REALM_DATA_PATH=/opt/realmREALM_LOG_LEVEL=debugEnvironment variables take priority over config file values and defaults.
Fields without a default (for example agent.listen_socket) are not picked up from the environment. Set them in the config file instead, optionally through a ${VAR} reference.
Complete Example
Section titled “Complete Example”data_path: /opt/realm_datalog_level: infoagent: listen_address: 0.0.0.0 zfs: false
nodes: lab1: url: http://192.168.1.59:9000 driver: linux registries: - host: ghcr.io auth: token: ghp_xxxxxxxxxxxx lab2: url: http://192.168.1.51:9000 driver: linux
loads: database: node: lab1 driver: container driver_config: image: docker.io/library/postgres:15 env: - POSTGRES_PASSWORD=secret network: network: backend dns: true ip_masq: true mount_volume: - volume_mount_point: /var/lib/postgresql/data
api: node: lab1 driver: container driver_config: image: ghcr.io/myorg/api:latest env: - DB_HOST=database.realm network: network: backend dns: true ip_masq: true portmap: - host_port: 8080 container_port: 3000 protocol: tcp depends_on: - database
monitoring: node: lab2 driver: process driver_config: start_cmd: prometheus start_args: "--config.file=/etc/prometheus/prometheus.yml" working_dir: /opt/prometheus stop_signal: SIGTERM