Skip to content

Gateway configuration examples

The api-gateway repository includes small, runnable setups. Each one has a gateway.yaml, a tiny echo backend and a docker-compose.yml, so you can start it, send requests and read the logs in a few minutes.

You need Docker with Compose and curl. Clone the repository, go into an example folder and start it:

Terminal
git clone https://github.com/nocleye/api-gateway.git
cd api-gateway/examples/hello-gateway
docker compose up --build

Only the gateway publishes a port (8080). The backend is reachable only through the gateway. Send requests from a second terminal, and stop everything with docker compose down. Each example’s README has the exact requests to try.

hello-gateway

One echo backend behind the gateway. Shows how a request is matched to a route, how the path is rewritten, and how to follow it in the logs.

What it shows v0.5.0-beta

  • Servers and routes
  • Longest-prefix route matching
  • Path rewrite (remove and add prefix)

rate-limit-basics

The same echo backend with usage control. Shows how a global limit and a route limit combine, and what changes between Cascade and Strict.

What it shows v0.5.0-beta

  • Client ID rule by IP
  • Usage control rules (global and route limits)
  • Global default rules
  • Route-level limits
  • Cascade and Strict usage control modes

Besides the single-feature examples, the repository has a lab: a local k3d cluster that runs the published gateway image in front of two apps, with Prometheus and Grafana. Use it to see routing, rate limits, auth, TLS backends and metrics working together. The gateway loads config/gateway.yaml directly, there is no dashboard or control plane.

App Role
gateway Public port 8080, support port 8081 (/metrics, /healthz, /readyz)
httpbin svc-a, plain HTTP backend with status, delay and unstable endpoints
podinfo svc-b, TLS backend with a certificate from an in-cluster CA (cert-manager)
prometheus and grafana Scrape the gateway and show the “Gateway k8s Observability Lab” dashboard

It needs k3d. The steps to start it and send traffic are in the Lab tab of Getting started.