Octopus
1.x
Docs/Octopus/Service Discovery & FARP
Open

Reading1 min
Updated31 Jul 2026
Sourcev1/farp/index.mdx

Service Discovery & FARP

Most gateways expect you to declare every route by hand. FARP — the Forge API Gateway Registration Protocol — flips that around: services publish their own schemas, and Octopus turns those schemas into routes as services come and go. In the live discovery path, services publish an OpenAPI document; the federated API surface additionally merges AsyncAPI and GraphQL schemas (see Schema federation). Static upstreams/routes and FARP-driven discovery work together — you can use either or both.

How it works01

  1. Discover — a discovery backend reports the set of live service instances and their addresses.

  2. Fetch schemas — Octopus retrieves each service's published schema (its FARP manifest).

  3. Generate routes — paths and methods from the schema become gateway routes pointing at the discovered upstream.

  4. Watch & reconcile — Octopus watches for changes and updates routes when services scale, appear, or disappear.

Discovery backends02

FARP can source instances from several backends, each configured under farp.discovery.backends:

  • mDNS / Bonjour — zero-config discovery for local development.

  • Consul — service catalog with health filtering.

  • DNS — resolve instances from SRV/A records.

  • Kubernetes — discover Pod endpoints via the discovery.k8s.io/v1 EndpointSlice API.

Note

An etcd discovery backend exists in the source tree but is not wired into the gateway's discovery configuration — only the four backends above can be selected. See Discovery backends for the honest breakdown.

Note

Kubernetes discovery uses EndpointSlice, which reflects Pod scale up/down that the legacy Endpoints watch can miss. See the Kubernetes section for cluster setup.

In this section03