runfabric

Router Plugin Authoring Guide

This guide explains how to build a kind=router plugin for runfabric router ... flows.

Contract Summary

Router plugins implement one RPC method:

The engine invokes plugins over line-delimited JSON RPC on stdin/stdout.

Required RPC methods:

Quick Scaffold (Go)

Use the bundled template:

mkdir -p my-router-plugin
cp -R examples/router-plugin-go-template/* my-router-plugin/
cd my-router-plugin
go mod init github.com/your-org/my-router-plugin
go mod tidy
go build -o bin/my-router-plugin .

Manifest Registration

Create plugin.yaml for external discovery (example):

apiVersion: runfabric.io/plugin/v1
kind: router
id: my-router
name: My Router
version: 0.1.0
executable: ./bin/my-router-plugin

Then install/discover through your standard RunFabric plugin directory flow.

Select Plugin

Configure runfabric.yml:

extensions:
  routerPlugin: my-router

Optional router policy controls remain under extensions.router (auto apply, approvals, credentials, mutation policy, canary, quality scoring).

Testing Checklist

  1. runfabric router routing --json to confirm intent shape.
  2. runfabric router simulate --json to verify local steering behavior.
  3. runfabric router dns-sync --dry-run --json with your plugin selected.
  4. runfabric router chaos-verify --json to validate failover scenarios.

Built-in Expansion Adapters

Built-in routers now include:

Each reconciler computes idempotent create/update/no-op actions from routing intent and applies provider API changes when not running in dry-run mode.