Reeve Docs

Docs / Reference

Sidecar workloads and the session plane

A plugin that needs code outside the backend process declares managed workloads in its manifest. Installing or updating the plugin deploys or updates them as one unit; nothing about the plugin needs to be known by the deployment chart or by the operator.

Use a sidecar only for a radio pinned to a host or a heavy native runtime. The split is topology, not distrust — the sidecar and its companion plugin are equally trusted, and the sidecar never touches the database. All persistence flows through its plugin.

Declaring workloads

The deployment section is a closed, versioned schema. Each workload pins an exact image digest for that plugin version; a tag-only reference requires an explicit operator opt-in.

The operator consents to a privilege posture — privileged flags, device passthrough, volumes, ports, network mode, parameters — not to a set of bytes. See consent covers what a workload may do for what that means and what it gives up.

Deployment parameters are typed and may be grouped into sections. An enum parameter can be a switch — widget, enumLabels and reveals — that shows the sections of one alternative at a time while still delivering every value; see parameters.

The plugin requests workloads.deploy to declare workloads and workloads.command to send commands to its own sidecars. That facade binds to the calling instance, so a plugin can never command another plugin's workload. Revoking workloads.deploy is what makes a deployment revocation reachable — the reconciler treats a grant missing the code as consent-absent, so a manifest declaring no permissions parks its workload awaiting consent and never creates a container.

The session plane

Sidecars hold no broker credentials. They dial out to a backend-terminated workload gateway over a WebSocket, carrying a per-instance revocable gateway token in the request header only, and exchange JSON frames.

Step Frame
Open Dial wss://<backend>/ws/workloads/{instanceId}, bearer token in the header
Announce HELLO carrying instance id, application version, spec hash and protocol version
Exchange {messageId, type, payload} — the payload models are the shared wire contracts
Presence Server-owned: socket close or missed heartbeats mark the instance offline

Server-owned presence means no retained birth or last-will messages, no broker access control for sidecars and one transport. A manual operator exposes nothing beyond the backend URL they already expose.

Three obligations on the sidecar author:

  • Snapshot on reconnect is a contract obligation. After HELLO the sidecar pushes a full device and telemetry snapshot before resuming incremental frames. Reconnection is resync, not replay.
  • Publish on one transport only. Publishing the same devices over both the broker and the session plane lands them under two owners with separate de-duplication caches, producing duplicate logical devices and ghost rows.
  • Carry what the plugin's parse needs, verbatim. Reserved double-underscore telemetry keys must survive the ingestion path unaltered, and vendor-specific detail belongs in the discovered-device message's metadata under a key the plugin defines — the typed scalar fields alone cannot reproduce full fidelity.

The broker's remaining role

The broker survives only for genuinely-MQTT integrations: Zigbee2MQTT, an MQTT-publish plugin kind, and the discovery host. Non-adapter workloads may receive broker connection material through bootstrap keys; requesting them from an adapter-health workload is a validation error.

Sidecars get no dedicated broker user and no per-workload access-control lists, and a manual deployment exposes no broker. See MQTT integrations for the rules that apply where a broker is in the path.

Exposing a media surface

A camera-bearing plugin names an origin and the backend proxies it, so the browser never learns the workload's address and needs no credential beyond the session it already holds.

The plugin chooses how narrow that origin is — typically a couple of read-only routes behind a token the workload received over the session plane, rather than the underlying media server's own configuration API. Reeve renders no network policy between workloads, so a port on the pod network is a port every co-resident workload can reach, and a media server's configuration API accepts arbitrary stream sources including command lines.

Traps:

  • A workload with no declared ports gets no service object on Kubernetes, yet its DNS name is computed from the stored row and resolves fine, so the failure surfaces as a refused connection. The same plugin works on a docker bridge, where every container gets a name regardless — so a plugin can pass locally and be unreachable in a cluster. Declare the media port in the manifest.
  • A media playlist is a list of relative URLs, so proxying one byte-for-byte points the player at segment routes that do not exist. Playlist transports need URI rewriting plus a segment route under the same origin confinement, or they must not be advertised at all.
  • Pin the media UDP port and multiplex every peer connection onto it, or the set of ports an operator has to open grows with the viewer count. Put it adjacent to the protocol's own port and outside the ephemeral range so the kernel cannot claim it first.
  • Media tickets are short-lived and revocable only by expiry. Enforcing single use would need a replay cache, and therefore the shared store the signed-ticket design exists to avoid.

The discovery host

Discovery providers that need node-local privileges — SSDP, USB, BLE, DHCP — run in a per-node workload that scans on demand, once, to completion, then leaves nothing running, forwarding candidates back over the session plane. Multicast DNS is browsed in-process by the backend instead, because it only works from a process sharing the devices' layer-2 segment. See discovery traps.

What an operator will meet

Symptom Cause Do
A workload sits awaiting consent and no container is created The plugin's grant does not carry the deployment permission Re-grant it, or the publisher must declare it
Camera media fails only on the docker provider The backend must join the workloads' shared network — it is the first traffic that flows backend to workload A backend running outside that compose topology has no configuration that reaches a workload
A sidecar is marked offline while its process is clearly running Presence is server-owned: the socket closed or heartbeats were missed Check reachability of the backend gateway from the sidecar, not the broker
A sidecar's devices appear twice The sidecar published on both the broker and the session plane Publish on the session plane only; the duplicates are separate owners with separate de-duplication caches