Skip to main content
Version: 0.7.x

Tutorial: operating a fleet with the control plane

Stand up a Hub, register two compute nodes, target a rollout by label, and verify convergence. Takes about 20 minutes and uses only loopback processes.

Prerequisites. Built arkflow and arkflow-server binaries (cargo build -p arkflow -p arkflow-server); no external database — the tutorial uses SQLite storage on loopback with explicit credentials.

1. Start the Hub​

mkdir -p /tmp/arkflow-fleet
ARKFLOW_HUB_STORAGE=/tmp/arkflow-fleet/hub.sqlite \
ARKFLOW_HUB_ADDRESS=127.0.0.1:8080 \
ARKFLOW_HUB_INSECURE_LOCAL=true \
arkflow-server

ARKFLOW_HUB_STORAGE plus ARKFLOW_HUB_INSECURE_LOCAL (loopback only) makes the Hub durable and development-friendly. A production Hub drops the insecure-local flag and adds real credentials — see the deployment guide.

Expected result: the process starts; curl -s http://127.0.0.1:8080/api/v1/system returns the principal echo.

2. Register an Agent node​

Create node-a.yaml:

logging:
level: info
health_check:
enabled: false
hub_urls: ["http://127.0.0.1:8080"]
node_id: "node-a"
node_token: "replace-with-node-token"
api_prefix: "/api/v1"
streams:
- id: demo-events
input:
type: generate
context: '{"site": "a", "value": 1}'
interval: 1s
batch_size: 1
pipeline:
thread_num: 1
processors: []
output:
type: stdout

Run it:

arkflow --config node-a.yaml

Expected result: the node registers (agent.register in the Hub event log) and the stream runs locally. The registered example control-plane-node is the same shape.

3. Inspect the fleet​

Query the API (insecure-local mode accepts unauthenticated requests; a production Hub requires a Bearer token):

curl -s http://127.0.0.1:8080/api/v1/nodes | jq

Expected result: node-a with its reported resources and stream state. The web console is a separate deployment (console/ in the repository) that talks to this API — see the console walkthrough.

4. Label the fleet and target a rollout​

Label the node, then create a rollout targeting {"env":"dev"}:

curl -X PUT -H 'Content-Type: application/json' \
-d '{"labels":{"env":"dev"}}' http://127.0.0.1:8080/api/v1/nodes/node-a/labels
curl -s -H 'Content-Type: application/json' \
-d '{"selector":{"env":"dev"},"version":<version-id>}' \
http://127.0.0.1:8080/api/v1/rollouts

Expected result: the rollout pins the resolved node set (one node now); adding a node with the label later requires a new rollout — selectors resolve once. See node labels and targeting.

5. Watch convergence and the audit trail​

  • GET /api/v1/rollouts/{id} until every resolved node reports the target.
  • GET /api/v1/events shows agent.register, label replacement, and rollout records with actors.
  • The console (/docs/operate/control-plane/console) mirrors the same views.

6. Clean up​

Stop the node process, then the Hub. State lives in /tmp/arkflow-fleet/hub.sqlite — delete the directory to start fresh.

Where to go next​