Skip to content

Support out-of-cluster deployment (rpm/deb alongside remote agent) #12

Description

@kitplummer

Summary

peat-sidecar currently assumes Kubernetes deployment (Helm chart, sidecar container, PVC storage). It also needs to run as a standalone systemd service alongside the remote agent's rpm/deb install path for bare-metal and VM deployments.

Current State

  • Binary is built as a single static Rust binary (target/release/peat-sidecar)
  • Config is via CLI flags / env vars (already works outside K8s)
  • Data dir defaults to /data/peat-sidecar (K8s-oriented path)
  • Deployment assumes Helm + Docker (Dockerfile, chart/, zarf.yaml)
  • No systemd unit file, no rpm/deb packaging, no FHS-compliant paths

Proposed Approach

1. FHS-Compliant Defaults

Add sensible defaults for non-K8s environments:

  • Data dir: /var/lib/peat-sidecar (instead of /data/peat-sidecar)
  • Config: /etc/peat-sidecar/config.yaml or env file at /etc/default/peat-sidecar
  • Logs: stdout (systemd journal captures this)
  • Socket: unix:///var/run/peat-sidecar.sock or tcp://127.0.0.1:50051

2. Systemd Unit File

[Unit]
Description=Peat Sidecar - CRDT mesh sync for UDS Remote Agent
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
EnvironmentFile=-/etc/default/peat-sidecar
ExecStart=/usr/bin/peat-sidecar
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

3. RPM/DEB Packaging

  • Use cargo-deb for Debian packages
  • Use cargo-rpm or nfpm for RPM packages
  • Package includes: binary, systemd unit, default env file, man page (optional)
  • Coordinate with remote agent's packaging so they can be installed together or as a dependency

4. Install Script (for non-package-manager environments)

Simple install.sh that:

  • Copies binary to /usr/bin/
  • Creates systemd unit
  • Creates data dir with appropriate permissions
  • Creates env file template
  • Enables and starts the service

Testing

  • CI builds rpm and deb artifacts
  • Test install/uninstall cycle in a container (ubuntu, rocky)
  • Verify sidecar starts, binds socket, and serves Connect RPC

References

  • src/main.rs:39 — current default data dir (/data/peat-sidecar)
  • Dockerfile — current container build
  • Remote agent rpm/deb packaging (coordinate paths and dependencies)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions