Skip to main content
The k7d daemon exposes its control plane on a Unix socket, by default /run/k7d/k7d.sock (override with --socket or the K7D_SOCKET env var). Protocol: one JSON request object per line, one JSON response object per line. A connection may carry multiple request/response pairs. Requests are tagged with "op", responses with "status". Errors are always an explicit {"status": "error", "message": "..."} response — never a silent success.
Clients reach the guest agent themselves over vsock, using the guest_cid returned by create_vm — the daemon does not proxy the agent protocol (vsock CIDs are a kernel-global namespace, so any host process can connect to a running VM’s agent).
Reference clients: a thin Python client covering the tree verbs in examples/cluster-tree-search/k7d_client.py, an MCP server wrapping the tree for a frontier agent in examples/k7d-mcp/, and a read-only SSE dashboard in examples/k7view/.

Host operations

VM lifecycle operations

VmConfig

The config object accepted by create_vm (and the tree-create operations): vm_created responses carry vm_id, guest_cid, vm_index (determines the guest IP 10.200.0.{2 + vm_index}), pod_netns_attached, and pooled (whether the VM was served from the warm pool instead of cold-booted).

Tree operations

Snapshot-tree semantics (budgets, LRU eviction, protect/prune, keyframes) are explained in Snapshot tree; cluster specifics in Cluster mode.

TreeBudget

TreeUsage

Carried on tree_nodes, tree_list, and tree_watching: live_vm_count, live_ram_bytes, disk_bytes, total_nodes, live_node_count.

EgressPolicy

Per-tree posture for traffic leaving the tree’s bridge, enforced by the tree network jail. Forks inherit the source’s policy.
169.254.0.0/16 (cloud metadata) is dropped in every mode unless a whitelist entry names it. RoCEv2 leaves as UDP/4791 — a whitelist that needs RDMA out of the tree must name that port.

Fork responses

tree_created, tree_forked, and tree_resumed responses carry guest_cids — one vsock CID per payload member, ordered by vm_index (a single entry for single-VM trees). Fork responses additionally carry:
  • fork_memory_full_copy (per member): false means the CoW MAP_PRIVATE fast path; true means a full memory copy (only virtiofs-backed sources — e.g. read-write hostPath — take that fallback).
  • latency_ns: the daemon’s own wall time for the fork (or the whole batch). Budgets are asserted on this figure, not on the client’s round trip.
  • dilation: the child’s clock factor after the fork.
tree_prepared carries wrote_base (a new keyframe was written), wrote_base_incremental (it was a reflink clone of the nearest ancestor plus this node’s dirty pages, O(divergence) instead of O(guest RAM)), base_disk_bytes (the physical bytes it actually added — stat cannot tell you this on a reflinked file), latency_ns, and guest_cids.

Clock operations

All clock ops act on every live VM of one cluster at once: the whole cluster is paused for the write and resumed after it. Concepts, numbers, and caveats: Time warp. cluster_id is the NetConfig.cluster_id given to create_vm, or for tree-owned clusters {tree_id}-{node_id} (tree_id alone for the root). The auto_warp reply carries mode, holders, and stats: cycles, warps, guest_ns_added, wall_ns_paused, plus a breakdown of where the pause went (pause_ns, freeze_ns, stop_vcpus_ns, quiesce_ns, decide_ns, …).

Daemon environment

Every unknown value above is a hard error rather than a silent fallback.

On-disk locations