FARP & discovery
FARP (the Forge API Gateway Registration Protocol) provides service discovery and automatic
routing. The farp section is optional and disabled by default. For conceptual depth, see the
FARP section.
farp:
enabled: true
watch_interval: 5s
schema_cache_ttl: 5m
discovery:
backends:
- type: kubernetes
enabled: true
config:
namespace: default
label_selector: "app.kubernetes.io/part-of=myapp"
watch_interval: 10sfarp01
| Key | Type | Default | Description |
enabled | boolean | false | Enable FARP service discovery and auto-routing. |
watch_interval | duration | 5s | Interval for discovering service changes. |
schema_cache_ttl | duration | 5m | Schema cache time-to-live. |
discovery | object | none | Discovery backend configuration. See below. |
Discovery02
farp.discovery holds a list of discovery backends.
| Key | Type | Default | Description |
backends | array | [] | Discovery backends. Each is tagged by type. |
Each backend entry has a type (mdns, dns, consul, or kubernetes), an enabled flag
(default true), and a backend-specific config object.
- type: mdns
enabled: true
config:
service_type: _http._tcp
domain: local.
watch_interval: 10s
query_timeout: 2s
enable_ipv6: true- type: dns
enabled: true
config:
servers: ["10.0.0.53:53"]
domain: services.internal
watch_interval: 30s- type: consul
enabled: true
config:
address: http://consul:8500
datacenter: dc1
token: "${CONSUL_TOKEN}"
watch_interval: 10s- type: kubernetes
enabled: true
config:
namespace: default
label_selector: "app.kubernetes.io/part-of=myapp"
watch_interval: 10s
use_endpoint_slices: true
include_not_ready: falseNote
The farp.discovery.kubernetes backend is independent of the in-process Gateway API controller
configured under kubernetes. See Kubernetes
for how the two relate.