application.yaml

An application spec names a cluster and declares groups of instances, optionally with volumes, services and one load balancer.

api_version: genesis/v1
application:
  name: shop                  # DNS-safe; instances are <name>-<group>-<n>
  cluster: lab                # a cluster registered in this ledger
  groups: [...]
  load_balancers: [...]       # optional, at most one

groups

FieldDefaultRules
name(required)Unique. Instance keys are <name>-0, <name>-1, …
count(required)0 or more
image(required)Any image the cluster can resolve: ubuntu:24.04, images:debian/12, or an alias you published
typecontainercontainer or vm
target(required)Exactly count entries, keyed <name>-0 to <name>-(count-1), each naming a cluster member
size.cpu(required)Positive integer. Becomes limits.cpu
size.memory(required)NMiB or NGiB. Becomes limits.memory
size.root_diskNMiB or NGiB. Root disk size
envEnvironment variable name to string value
refsEnvironment variable name to an instance key or load balancer name. Keys can't overlap with env
exposeList of port: N/tcp, unique per group. Published on the member's tailnet address
healthCommand argv run inside each instance; exit 0 means healthy. Required for container groups
volumesSee below
servicesSee below. At most one

Exposed ports can't collide on a member, and never use the SSH or LXD control ports.

refs is checked (the target must exist) and, when it points at a service group, opens that path in the guard. In 0.1.0-dev it is not set inside the instance, and the general instance-to-instance traffic policy is undecided.

volumes

FieldDefaultRules
name(required)Unique across the application
pool(required)A storage pool on the member, usually default
size(required)NMiB or NGiB. Volumes grow; they never shrink
content_typefilesystemfilesystem or block. Never changes after creation. Block volumes attach only to VM groups
attach(required)Instance keys from this group
mount(required)Absolute path, not /
security.sharedfalseRequired when attach lists more than one instance. All of them must be on one member, and you approve the share with --force-volume-share

services

A group with a service must be type: vm, count: 1, with image ubuntu:22.04 or ubuntu:24.04.

FieldDefaultRules
kind(required)postgres or clickhouse
version(required)Never latest. PostgreSQL: a major ("17", newest release frozen at plan time) or an exact package version. ClickHouse: an exact numeric release like "24.8.4.13"
admin_password_env(required)Name of the variable holding the admin password. plan and deploy refuse if unset or empty
admin_user_envName of a variable holding the admin user. Otherwise postgres or default
namethe kindUnique; used by upgrade --service and in plan rows (services.<name>)
port5432 / 90001 to 65535
data_volumethe only block volumeRequired unless exactly one block volume is attached
data_pathData directory inside the volume
mount_deviceA /dev/disk/by-id/… path
healthgeneratedMust match the generated health command if given
tuningPostgreSQL: max_connections (positive integer), shared_buffers (size). ClickHouse: max_memory_usage (size)

load_balancers

At most one.

FieldDefaultRules
name(required)Must not collide with a group name or instance key
kind(required)haproxy
balances(required)The group or groups whose instances become backends
target(required)Exactly one replica: {<name>-0: <member>}
listen(required)N/tcp, published on the member's tailnet address. Can't clash with a balanced group's exposure
check.typetcptcp or http
check.pathFor http checks
check.expect_statusFor http checks

The load balancer's check is separate from the group's health command.

Registration rules

  • A name is bound to one spec path and one cluster the first time you init it. init, plan, deploy, rollback and destroy refuse if either changes:
application "<name>" is registered at <path> on cluster "<c>", not <path> on "<c>"
  • target members must belong to the registered cluster. Change the cluster spec and the application refuses with sg:application-cluster-mismatch until placements match.