Configure Kong Gateway Services and Routes in DB-less mode
A Service defines the upstream connection; a Route matches client requests and selects the Service. In DB-less mode, one declarative YAML/JSON file describes the full entity state, and loading it replaces that state. This guide uses an HTTP path route and the v3 format. Current docs say Routes default to HTTPS starting in v3.14, so both HTTP and HTTPS are explicit below. Database mode, Kubernetes Ingress Controller, Konnect, and authentication plugins are excluded.
A Service defines the upstream connection; a Route matches client requests and selects the Service. In DB-less mode, one declarative YAML/JSON file describes the full entity state, and loading it replaces that state. This guide uses an HTTP path route and the v3 format. Current docs say Routes default to HTTPS starting in v3.14, so both HTTP and HTTPS are explicit below. Database mode, Kubernetes Ingress Controller, Konnect, and authentication plugins are excluded.
DB-less entities are held in memory. Nodes do not coordinate through a central database, each node needs the intended config, all entities must fit cache, and plugin compatibility varies. The sample maps /orders to orders_api and strip_path=true removes that prefix, so /orders/42 reaches upstream as /42. Use an upstream hostname reachable by Gateway.
Configuration and verification
_format_version: "3.0"
services:
- name: orders_api
url: http://orders.internal.example:8080
routes:
- name: orders_path
service:
name: orders_api
paths:
- /orders
protocols:
- http
- https
strip_path: trueRun kong config parse kong.yml for syntax only; it does not load the file or prove DNS, connectivity, or runtime behavior. Set database=off and declarative_config to the full file path, or use KONG_DATABASE and KONG_DECLARATIVE_CONFIG. Review the entire file before applying, retain the last known-good full config, and apply it to every independent node. Verify with a request to the actual proxy listener and inspect logs/backend path. Restrict the Admin API; never expose its management port publicly.
Limits
This documentation example was not run. HTTPS as a Route protocol does not configure TLS certificates/listeners. Confirm fields and behavior against your installed version.
[DB-less mode](https://developer.konghq.com/gateway/db-less-mode/)
[Gateway Services](https://developer.konghq.com/gateway/entities/service/)
[Routes](https://developer.konghq.com/gateway/entities/route/)
[CLI reference](https://developer.konghq.com/gateway/cli/reference/)
[Manage configuration](https://developer.konghq.com/gateway/manage-kong-conf/)