Documentation Index
Fetch the complete documentation index at: https://mintlify.com/mikronita/mikrom/llms.txt
Use this file to discover all available pages before exploring further.
mikrom-agent is the worker daemon that runs on each compute node in the Mikrom cluster. It receives placement commands from mikrom-scheduler over NATS, then drives the full lifecycle of microVMs on that host—creating, starting, pausing, resuming, and cleaning up Firecracker or Cloud Hypervisor VMs. In addition to VM lifecycle management, the agent reports host and VM metrics back to the scheduler, streams workload logs to the control plane, loads the mikrom-agent-ebpf data-plane program, and starts the tundra-nat64 translator that enables IPv4 egress from the IPv6-only internal network.
Port: 5003
Responsibilities
VM Lifecycle
Creates, starts, stops, pauses, resumes, and destroys Firecracker and Cloud Hypervisor microVMs in response to scheduler commands.
Worker Registration
Registers the worker node with the scheduler on startup and sends periodic heartbeats carrying CPU, RAM, and disk capacity metrics.
Log Streaming
Captures stdout/stderr from running workloads and ships them to the control plane for display in the dashboard and CLI.
eBPF Data Plane
Embeds and loads the
mikrom-agent-ebpf program for host-side network handling and metrics collection.NAT64 Translation
Starts a singleton
tundra-nat64 translator on the host bridge, enabling IPv4 egress from workloads via DNS64 answers from mikrom-dns.Host Metrics
Collects and reports CPU, RAM, disk, and per-VM metrics to the scheduler for capacity-aware placement decisions.
Hypervisor Support
- Firecracker
- Cloud Hypervisor
Firecracker is the default hypervisor for application workloads. It provides sub-second boot times and strong isolation with a minimal device model.
- Used for standard app deployments.
- Boots using the Zig-built
mikrom-initbinary embedded in the microVM image. - Socket-based API for lifecycle management.
eBPF Data Plane
The agent embeds the compiledmikrom-agent-ebpf artifact at build time. The build script (build.rs) reads the program from target/bpfel-unknown-none/release/mikrom-agent-ebpf and embeds it into the agent binary. At runtime, the agent loads it into the kernel for host-side networking support and metrics collection.
The eBPF build uses Rust nightly with
-Z build-std=core. Keep the eBPF build path in sync with the Dagger CI runner when modifying the build pipeline.NATS Command Handling
The agent subscribes to NATS subjects controlled by the scheduler. The communication model is request-reply: the scheduler sends a placement command and waits for the agent’s acknowledgement within the configured timeout.Timeout Configuration
All timeout values are runtime-configurable via environment variables. Defaults are conservative to accommodate a range of hardware.NATS Timeouts
| Variable | Default | Description |
|---|---|---|
AGENT_NATS_CONNECT_TIMEOUT_SECS | 5 | Timeout for the initial NATS connection |
AGENT_NATS_MAX_BACKOFF_SECS | 60 | Maximum backoff between NATS reconnect attempts |
AGENT_NATS_CIRCUIT_BREAKER_COOLDOWN_SECS | 300 | Cooldown before retrying after a circuit-breaker trip |
Cloud Hypervisor Timeouts
| Variable | Default | Description |
|---|---|---|
AGENT_CLOUD_HYPERVISOR_SOCKET_WAIT_TIMEOUT_SECS | 10 | Time to wait for the Cloud Hypervisor socket to appear |
AGENT_CLOUD_HYPERVISOR_API_CONNECT_TIMEOUT_SECS | 5 | Timeout for HTTP API connection to Cloud Hypervisor |
AGENT_CLOUD_HYPERVISOR_API_STATUS_TIMEOUT_SECS | 30 | Timeout waiting for a status response |
AGENT_CLOUD_HYPERVISOR_API_HEADER_TIMEOUT_SECS | 10 | Timeout reading HTTP response headers |
AGENT_CLOUD_HYPERVISOR_API_BODY_TIMEOUT_SECS | 60 | Timeout reading HTTP response body |
AGENT_CLOUD_HYPERVISOR_CONFIGURE_CLIENT_TIMEOUT_SECS | 5 | Timeout for the configure-phase HTTP client |
AGENT_CLOUD_HYPERVISOR_CONFIGURE_REQUEST_TIMEOUT_SECS | 6 | Timeout for individual configure requests |
AGENT_CLOUD_HYPERVISOR_CONFIGURE_BACKOFF_MAX_SECS | 5 | Maximum backoff during configure retries |
Firecracker Timeouts
| Variable | Default | Description |
|---|---|---|
FC_SOCKET_WAIT_TIMEOUT_SECS | 120 | Time to wait for the Firecracker socket (non-jailer boot path) |
FC_SOCKET_WAIT_CHROOT_SECS | 10 | Time to wait for the socket inside a chroot |
FC_API_CONNECT_TIMEOUT_SECS | 2 | Timeout for HTTP API connection to Firecracker |
FC_API_STATUS_TIMEOUT_SECS | 30 | Timeout waiting for a status response |
FC_API_HEADER_TIMEOUT_SECS | 10 | Timeout reading HTTP response headers |
FC_API_BODY_TIMEOUT_SECS | 60 | Timeout reading HTTP response body |
FC_PROCESS_TERMINATE_TIMEOUT_SECS | 10 | Grace period for process termination (SIGTERM) |
FC_PROCESS_KILL_TIMEOUT_SECS | 2 | Grace period before sending SIGKILL |
FC_VFS_TERMINATE_TIMEOUT_SECS | 5 | Grace period for VFS process termination |
FC_VFS_KILL_TIMEOUT_SECS | 2 | Grace period before sending VFS SIGKILL |
Runtime Dependencies
- NATS — command and control channel from the scheduler
- Firecracker or Cloud Hypervisor — hypervisor binary on the host
mikrom-init— Zig-built init binary embedded in microVM images; must be present in the image rootmikrom-network— WireGuard mesh connectivity; must be running on the same hostmikrom-dns— provides DNS64 answers that feed the NAT64 translatormikrom-agent-ebpf— compiled eBPF payload, embedded at build time
Key Source Files
| File | Purpose |
|---|---|
src/main.rs | Process bootstrap and runtime wiring |
src/agent.rs | VM orchestration and scheduler integration |
src/metrics.rs | Host metric collection |
src/ebpf/ | Agent-side integration for the compiled eBPF payload |
build.rs | Embeds the eBPF artifact from target/bpfel-unknown-none/release |
Debian Package
A Debian package is available for production deployments.Local Development
Testing
- Prefer workspace-level CI profiles for the full agent + eBPF path.
- The NATS integration test is opt-in:
make ci-external-testssetsMIKROM_RUN_NATS_TESTS=1. - Ceph storage tests require a live Ceph cluster: set
MIKROM_RUN_CEPH_TESTS=1or use the dedicatedceph-testsGitHub Actions job on a self-hosted runner labeledceph. - For end-to-end NAT64/DNS64 smoke validation, follow the steps in
docs/nat64-dns64-smoke-checklist.md.
When making changes to VM lifecycle behavior, always validate against the scheduler and networking services together rather than running the agent in isolation. The three services form a tightly coupled placement-and-boot pipeline.