Getting started
The gateway is configured with one YAML file. Everything reusable is defined once under Rules, then referenced by name from the scope that needs it.
-
Write a config. One backend, one route, and a rate limit bound to the route.
gateway.yaml ApiVersion: v1BetaRules:UsageControlRules:per-minute:RequestCount: 60WindowTime: 1mServerConfigs:my-api:URL: "http://localhost:9090"ServerRoutes:api:TargetServer: my-apiPathPattern: /apiUsageControlRules: [per-minute]A request to
/api/usersis forwarded tohttp://localhost:9090/api/users, and each caller gets 60 requests per minute. -
Validate it.
nocleye checkreports errors and warnings without starting the gateway.Terminal window nocleye check --gConfigPath ./gateway.yamlTerminal window docker run --rm \-v "$PWD/gateway.yaml:/etc/gateway/gateway.yaml:ro" \-e GATEWAY_CONFIG_PATH=/etc/gateway/gateway.yaml \<your-registry>/nocleye:<tag> checkSee the check reference for every message.
-
Run it.
Terminal window nocleye gateway --gConfigPath ./gateway.yaml --gPort 8080Terminal window docker run --rm -p 8080:8080 \-v "$PWD/gateway.yaml:/etc/gateway/gateway.yaml:ro" \-e GATEWAY_CONFIG_PATH=/etc/gateway/gateway.yaml \<your-registry>/nocleye:<tag> gatewayEvery flag has an environment variable, see Command line.
- How requests are handled: the order the gateway applies routing, limits and auth.
- Servers and routes: path rewriting and HTTPS backends.
- Logs and metrics: the access log and Prometheus.
