Skip to content

Production Deployment

Ketos Agent ships as a single static binary with zero runtime dependencies, ready for bare-metal hosts, VMs, edge nodes, and Docker / Kubernetes clusters.


Place the binary at /usr/local/bin/ketos-agent and your config at /etc/ketos-agent/config.yml, then create /etc/systemd/system/ketos-agent.service:

[Unit]
Description=Ketos Agent - Full-Context Incident Collector
After=network-online.target
[Service]
Type=simple
ExecStart=/usr/local/bin/ketos-agent --config /etc/ketos-agent/config.yml
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartSec=5s
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target

Enable and manage the service:

Terminal window
sudo systemctl daemon-reload
sudo systemctl enable --now ketos-agent
# Config changes hot-reload automatically; you can also trigger reload via SIGHUP
sudo systemctl reload ketos-agent
# Tail service logs
journalctl -u ketos-agent -f

Monitoring the Host from a Container (Docker / Kubernetes)

Section titled “Monitoring the Host from a Container (Docker / Kubernetes)”

Mount the host root filesystem read-only at /hostfs and set root_path: /hostfs to safely collect host metrics and Top processes:

inputs:
host:
- id: default
root_path: /hostfs
storage:
dir: /var/lib/ketos-agent
max_disk_mb: 50
max_snapshots: 500
Terminal window
docker run -d --name ketos-agent \
--restart unless-stopped \
--pid=host --net=host \
-v /:/hostfs:ro \
-v $(pwd)/config.yml:/etc/ketos-agent/config.yml:ro \
-v $(pwd)/data:/var/lib/ketos-agent \
your-image --config /etc/ketos-agent/config.yml

[!TIP] Mounting --pid=host lets top_processes accurately report host process names and PIDs. Always mount the host root filesystem read-only (:ro).


Cross-Platform Static Builds (From Source)

Section titled “Cross-Platform Static Builds (From Source)”

If you need to compile static binaries for target platforms yourself:

Terminal window
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o bin/ketos-agent-linux-amd64 ./cmd/ketos-agent

  • Ordered drain: On SIGINT / SIGTERM, the collector shuts down cleanly in order: collectors → rule engine → snapshot writer → plugins, saving any in-flight evidence safely (status: partial if the post-window has not yet elapsed).
  • Power-loss safe: All .md context files are written via atomic temp-file replacement; stale temporary files are cleaned up and quotas recalibrated automatically on startup. See Security & Resource Limits.