Skip to content

Controller API

The controller deploys bridges on Kubernetes. Requests need Authorization: Bearer <CONTROLLER_TOKEN>.

Method and path Purpose
POST /v1/bridges Deploy or update a bridge
GET /v1/bridges/{namespace}/{name} Readiness
DELETE /v1/bridges/{namespace}/{name} Remove. ?data=delete also deletes its volume
GET /v1/bridges/{namespace}/{name}/config Configuration
PUT /v1/bridges/{namespace}/{name}/config Replace it: value, version

Deployment request

Field Meaning
name, namespace Name of the resources
cluster_id, region Cluster
image, leaf_image Images of bridge and leaf node
nats_leaf_url Leaf port of the NATS server
relays, dht Relays, and optional DHT bootstrap nodes
signer_url Signing agent
secret Secret with signer-token, agent-token and config-token
cpu, memory, storage Limits
config Optional initial configuration

A pod with the bridge and a leaf node, a service, a config map and a volume are created. The controller changes only resources that it created.

Policy

POLICY_FILE limits what can be deployed:

{
  "clusters": ["cluster-k"], "namespaces": ["mesh"],
  "images": ["mesh-node:dev", "nats:2-alpine"], "secrets": ["bridge-secrets"],
  "relays": ["*"], "max_cpu": "1", "max_memory": "512Mi", "max_storage": "1Gi",
  "max_payload": 1048576, "require_default_deny": false, "advertise": ["cluster-k.>"]
}

trusted optionally fixes the keys that clusters may be trusted with. Violations are answered with 403. Configuration updates are checked as well.