What are Kong and Envoy Gateway, and how is each one built?

An API gateway sits between external clients and your services. It terminates TLS, matches requests to backends, and enforces authentication and rate limits in one place. Without it, each microservice has to do this work itself, and each one tends to do it a little differently. Kong and Envoy Gateway both fill this role. They differ in how configuration gets to the proxy.

Kong

Kong runs on OpenResty, which is Nginx with an embedded LuaJIT runtime. Its features are Lua plugins that hook into phases of the request lifecycle. You can configure it in three ways:

  • Admin API: a REST interface you call directly.
  • Declarative file: a configuration file loaded in DB-less mode.
  • Kong Ingress Controller: watches Kubernetes resources and pushes the equivalent configuration into Kong.

Some plugins and management features, such as role-based access control, are available only in the commercial edition. Check which edition a feature belongs to before you depend on it.

Envoy Gateway

Envoy Gateway is a control plane. It is not a proxy. It watches Kubernetes Gateway API resources and its own policy resources, then translates them into Envoy's xDS configuration. It also manages the lifecycle of the Envoy proxy fleet that serves traffic. It is a younger project than Kong, so expect fewer production reports from other teams and a smaller ecosystem.

        KONG                              ENVOY GATEWAY
+---------------------------+     +---------------------------+
| Control plane             |     | Control plane             |
| Admin API / declarative   |     | Envoy Gateway controller  |
| file / Ingress Controller |     | (watches Gateway API)     |
+-------------+-------------+     +-------------+-------------+
              | Admin API / sync                | xDS (gRPC)
+-------------v-------------+     +-------------v-------------+
| Data plane                |     | Data plane                |
| Nginx/OpenResty           |     | Envoy proxies             |
| + Lua plugins             |     | + filters                 |
+---------------------------+     +---------------------------+
             KONG                           ENVOY GATEWAY
+-----------------------------+    +-----------------------------+
| CONTROL PLANE               |    | CONTROL PLANE               |
| Admin API (REST)            |    | Envoy Gateway controller    |
| Declarative file (DB-less)  |    | watches Gateway API and     |
| Kong Ingress Controller     |    | policy resources            |
+--------------+--------------+    +--------------+--------------+
               |                                  |
               | Admin API calls /                | xDS config (gRPC)
               | config sync                      | + proxy lifecycle
               v                                  v
+-----------------------------+    +-----------------------------+
| DATA PLANE                  |    | DATA PLANE                  |
| Kong proxy                  |    | Envoy proxy fleet           |
| OpenResty (Nginx + LuaJIT)  |    | (managed by Envoy Gateway)  |
| Lua plugins per req. phase  |    | filters configured via xDS  |
+--------------+--------------+    +--------------+--------------+
               |                                  |
               v                                  v
      +-----------------+                +-----------------+
      | Upstream        |                | Upstream        |
      | services        |                | services        |
      +-----------------+                +-----------------+

Kong configures its OpenResty proxy through the Admin API, a declarative file or the Kong Ingress Controller, while Envoy Gateway translates Gateway API resources into xDS configuration and manages the lifecycle of the Envoy proxies.

How does the Kubernetes Gateway API work for edge routing?

The Gateway API splits edge configuration into layered resources so that each one maps to a different owner:

  • GatewayClass is cluster-scoped and names the controller that implements it. A platform or infrastructure team installs it once, and it determines whether a Gateway runs on Kong or Envoy.
  • Gateway declares listeners: ports, protocols, hostnames, and TLS certificates. Each listener's allowedRoutes field controls which namespaces may attach routes. The cluster operator keeps control of exposure, while application teams don't need write access to the Gateway.
  • HTTPRoute, GRPCRoute, and the TCP, TLS, and UDP route types live in application namespaces. They match on paths, headers, or SNI and forward traffic to Services. A route references a Gateway through parentRefs. ReferenceGrant is required when a route or Gateway points to an object in a different namespace, so cross-namespace trust is always opt-in.

This split exists because ingress annotations mixed infrastructure and application concerns into a single object. Under the Gateway API, an application team can ship a canary weight change without touching the listener or the certificate.

Both projects implement the core resources, but production setups rarely stop at the core. In Kong, you define behavior such as authentication, transforms, and rate limits as KongPlugin resources and attach them to routes, Services, or consumers by annotation. Envoy Gateway uses typed policy CRDs, including ClientTrafficPolicy, BackendTrafficPolicy, and SecurityPolicy, which target Gateways or routes through targetRefs. You can move route definitions between the two with little change. You cannot move the policies, because each tool uses its own resources and attachment model. If you migrate, plan to rewrite those policies.

# Portable: the same HTTPRoute works on either controller.
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: orders
  namespace: shop
  annotations:
    konghq.com/plugins: orders-ratelimit  # Kong only; Envoy Gateway ignores it
spec:
  parentRefs:
    - name: public-gw              # Gateway owned by the platform team
      namespace: infra
  rules:
    - backendRefs:
        - name: orders-svc
          port: 8080
---
# Kong: policy is a plugin, attached by the annotation above.
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
  name: orders-ratelimit
  namespace: shop
plugin: rate-limiting
config:
  minute: 60
  policy: local
---
# Envoy Gateway: the same intent as a typed policy that selects the route.
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: BackendTrafficPolicy
metadata:
  name: orders-ratelimit
  namespace: shop
spec:
  targetRefs:
    - {group: gateway.networking.k8s.io, kind: HTTPRoute, name: orders}
  rateLimit:
    type: Local
    local:
      rules:
        - limit: {requests: 60, unit: Minute}

One HTTPRoute moves between controllers unchanged, while the same 60-requests-per-minute limit has to be written as a Kong plugin attached by annotation or as an Envoy Gateway BackendTrafficPolicy that selects the route through targetRefs.

How do you implement common edge routing tasks in Kong and Envoy Gateway?

All five common edge tasks are expressible in standard Gateway API resources, so the same manifests work on either controller. Divergence starts at the edges of each task: TLS tuning, sticky canaries, retries.

  • Host and path matching. Set hostnames and matches.path on an HTTPRoute. Use PathPrefix or Exact. RegularExpression is implementation-specific, so regex semantics may differ between controllers.
  • Header-based routing. Add matches.headers to send requests carrying a header, such as an internal test flag, to a separate backend. This lets you test without exposing a new hostname.
  • Weighted canary. Give two backendRefs relative weight values. Weights are not sticky, so a single client can alternate between versions. If you need session affinity, you have to configure it outside the core API.
  • TLS termination. Define an HTTPS listener on the Gateway with certificateRefs pointing to a Secret. Minimum TLS version, ciphers and client-certificate validation are not part of the core API.
  • HTTP-to-HTTPS redirect. Attach an HTTPRoute to the port-80 listener with a RequestRedirect filter that sets scheme: https. Set statusCode: 301 explicitly so the behaviour is clear to readers.
Task Core Gateway API Kong extra Envoy Gateway extra
Host/path match Yes None None
Header routing Yes None None
Weighted canary Yes (non-sticky) Plugin or upstream settings for affinity BackendTrafficPolicy for affinity
TLS termination Yes Plugin for client auth ClientTrafficPolicy for versions, mTLS
HTTP→HTTPS redirect Yes None None
Retries Experimental only Service annotations BackendTrafficPolicy
# Core Gateway API only: the same manifests work on Kong or Envoy Gateway.
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata: {name: edge}
spec:
  gatewayClassName: edge-class   # the only line that changes per controller
  listeners:
  - {name: http, port: 80, protocol: HTTP}
  - name: https
    port: 443
    protocol: HTTPS
    hostname: shop.example.com
    tls:
      mode: Terminate              # min TLS version, ciphers, mTLS need vendor policy
      certificateRefs: [{name: shop-example-tls}]   # kubernetes.io/tls Secret
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata: {name: redirect-to-https}
spec:
  parentRefs: [{name: edge, sectionName: http}]   # bind to port 80 only
  rules:
  - filters:
    - type: RequestRedirect
      requestRedirect: {scheme: https, statusCode: 301}   # explicit permanent redirect
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata: {name: shop}
spec:
  parentRefs: [{name: edge, sectionName: https}]
  hostnames: [shop.example.com]
  rules:
  - matches:                       # testers with the flag always reach v2
    - path: {type: PathPrefix, value: /api}
      headers: [{name: x-canary-test, value: "true"}]
    backendRefs: [{name: api-v2, port: 8080}]
  - matches: [{path: {type: PathPrefix, value: /api}}]
    backendRefs:                   # 90/10 split, per request, not sticky
    - {name: api-v1, port: 8080, weight: 90}
    - {name: api-v2, port: 8080, weight: 10}

A portable Gateway API setup with TLS termination, a 301 HTTP-to-HTTPS redirect, host and path matching, a header-based test route and a non-sticky 90/10 weighted canary, which runs unchanged on Kong or Envoy Gateway.

How do authentication and rate limiting differ between Kong and Envoy Gateway?

Kong's authentication centres on consumers. You define a KongConsumer, attach credentials such as key-auth, JWT, or basic-auth (stored as Kubernetes Secrets), and enable the matching plugin on a route or service through a KongPlugin resource. Because the gateway resolves a request to a named consumer, you can apply per-consumer plugins, including different rate limits. The rate-limiting plugin's policy setting decides where counters live: local keeps them in each node's memory, cluster stores them in Kong's database (not available in DB-less mode), and redis shares them across nodes.

Envoy Gateway attaches a SecurityPolicy to a Gateway or HTTPRoute. Its jwt block validates tokens against a provider's remote JWKS, and its extAuth block calls your own HTTP or gRPC authorization service. There is no built-in consumer registry, so identity lives in your IdP or authorization service. Rate limits are set in a BackendTrafficPolicy with type: Local or type: Global. Global limits run Envoy's rate-limit service, backed by Redis.

Capability Kong Envoy Gateway
Identity model Consumers with credentials JWT claims, external authz
Local rate limiting policy: local type: Local
Shared counters PostgreSQL or Redis Rate-limit service plus Redis
Custom authz Plugins extAuth service

Global limits make every request depend on a network call to shared state. That adds latency and creates a new failure point at the edge. When Redis or the rate-limit service slows down or becomes unreachable, you must choose between two outcomes. Failing open lets traffic through unthrottled. Failing closed rejects legitimate users. Make that choice explicitly and test it.

# JWT validation on one route. sub is copied into a header so the rate limiter can key on it.
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: SecurityPolicy
metadata:
  name: orders-jwt
spec:
  targetRefs:
  - group: gateway.networking.k8s.io
    kind: HTTPRoute
    name: orders
  jwt:
    providers:
    - name: example-idp
      remoteJWKS:
        uri:   # placeholder IdP
      claimToHeaders:
      - claim: sub
        header: x-user-id
---
# Global limit: 100 req/min per distinct user, shared across all Envoy replicas.
# Requires the rate-limit service backed by Redis, configured in the EnvoyGateway config
# (rateLimit.backend.type: Redis, redis.url: redis.ratelimit.svc.cluster.local:6379).
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: BackendTrafficPolicy
metadata:
  name: orders-ratelimit
spec:
  targetRefs:
  - group: gateway.networking.k8s.io
    kind: HTTPRoute
    name: orders
  rateLimit:
    type: Global
    global:
      rules:
      - clientSelectors:
        - headers:
          - name: x-user-id
            type: Distinct   # one counter per header value
        limit:
          requests: 100
          unit: Minute

An Envoy Gateway SecurityPolicy validates JWTs and maps the sub claim to a header, and a BackendTrafficPolicy uses that header for a per-user global rate limit backed by the rate-limit service and Redis.

How does configuration reach the data plane, and what does it mean for GitOps?

Where those counters live depends on how Kong gets its configuration in the first place.

In database-backed mode, Kong nodes read routes, services and plugins from PostgreSQL and cache them, so a change made through the Admin API reaches every node without a restart. The cost is an extra stateful system: a highly available PostgreSQL cluster with failover, backups, upgrades and monitoring. An outage there blocks configuration changes and can affect traffic.

DB-less mode removes the database. Kong holds a declarative configuration in memory, usually pushed by its ingress controller from Kubernetes resources. Each update replaces the whole config, and on very large configs the router rebuild can take noticeable time. Without a shared database, the cluster rate-limiting policy is unavailable. You choose between per-node local counters, which are inexact across replicas, or a Redis backend, which is another dependency to run.

Envoy Gateway translates Gateway API resources into xDS and streams them to Envoy over gRPC. Listeners, routes and clusters update incrementally, and existing connections drain instead of dropping.

For GitOps, both DB-less Kong and Envoy Gateway fit well because Git becomes the only source of truth. Database-backed Kong lets engineers make changes through the Admin API that Git never records. That drift costs debugging time later.

Troubleshooting

Kong's Admin API returns readable JSON for routes, services and plugins. Envoy exposes a config dump and access logs. The dump is large and expressed in Envoy's own model, so you must map it back to the Gateway API resources that produced it. Check the status conditions on HTTPRoute and Gateway resources first. Learning to trace that translation is the steep part of the learning curve.

What does extending Kong or Envoy Gateway cost your team?

Extension work has a similar hidden curve, and it shows up at upgrade time rather than on day one.

Kong's custom plugins are usually written in Lua against its Plugin Development Kit and run inside the gateway's request phases. That keeps latency low, but your team needs Lua and OpenResty experience. A plugin that reaches into internal behaviour can break when Kong changes, so every upgrade means re-running plugin tests against the new release. Envoy Gateway gives you three practical routes: Lua for small inline changes, Wasm modules built in Rust, Go or C++, and external processing (ext_proc), which streams requests over gRPC to a service you run yourself. Native C++ filters need a custom Envoy build, which is rarely worth it.

Path Skills needed Upgrade testing Long-term cost
Kong Lua plugin Lua, OpenResty, Kong PDK Retest each plugin against every Kong release Tied to Kong internals
Envoy Lua filter Lua, Envoy filter model Light; keep scripts small Low, if kept trivial
Envoy Wasm Rust/Go, Wasm toolchain, proxy ABI Check SDK and runtime compatibility Moderate; ecosystem still maturing
Envoy ext_proc Any gRPC-capable language Contract tests on the gRPC API An extra service to scale and page on

Scope matters as much as language. If you run a full API management gateway only for routing, you still operate its database or config store, admin API and plugin catalogue. A lean gateway avoids that, but API-product concerns such as developer keys, quotas and usage analytics then end up in application code or extra services that you own.

When should you choose Kong, Envoy Gateway, or an alternative?

Choose Kong when the gateway is part of the product rather than just plumbing. If you issue API keys to external developers, enforce per-consumer quotas, or plan to monetise access, Kong's consumer model and plugin catalogue let you handle these at the edge. Its commercial tiers add developer-portal tooling. Avoid Kong for a routing-only edge. If all you need is host and path routing, TLS termination and some retries, you would be running and upgrading a control plane, config store and plugin layer that you never use.

Choose Envoy Gateway when you already run Envoy, for example inside a service mesh. Your team can then debug the edge with the same mental model, metrics and admin tooling. It also suits teams that want to stay close to the Gateway API spec and keep vendor-specific CRDs to a minimum. Avoid it when consumer and key management is central to the product, because you would have to build that layer yourself.

Decide in advance how much non-portable configuration you will accept. Every custom plugin or extension resource makes it harder to switch implementations later.

Consider these alternatives:

  • Other Gateway API implementations if portability matters more than any one feature set.
  • An ingress controller alone for a small cluster with simple HTTP routing.
  • A managed cloud gateway if you don't want to run the edge yourself and can accept being tied to one provider.
Need Kong Envoy Gateway
Developer keys and quotas Built-in consumer model Build or integrate yourself
Existing Envoy or mesh Separate stack Shared tooling
Routing-only edge Excess overhead Good fit
Portability Plugin-heavy Closer to the spec

How OneEnv can help

Disclosure: OneEnv is the product behind this blog.

OneEnv (oneenv.io) is a workspace-based governance platform for the things services share — environment variables, database structure, API routes and validation rules. A change to a shared value is staged on a branch, reviewed once, and then every affected service explicitly approves or rejects it before it goes live, so you can see who a change touches before it ships instead of finding out in production.

Applied to kong vs envoy gateway, this is where it helps:

Saves time

  • Every service that inherits a shared value is listed in one place, so nobody searches repos and chats to find out who is affected.
  • One review per branch replaces coordinating each team separately; each service still keeps its own approve/reject.
  • Changing a shared variable is one edit and one review instead of editing every service's .env by hand.

Saves cost

  • Fewer production incidents and rollbacks caused by a shared value, route or column changing under a consumer unannounced.
  • Less duplicated configuration to maintain: one shared definition inherited by many services.
  • A wrong or stale value is caught at review time by the services it affects, not by a failed deploy.
  • OneEnv has a free plan (1 workspace, unlimited services and members, full governance), so trying it costs nothing.

These are qualitative benefits, not measured results — how much you save depends on how many services share the value.

Want to try it? Start at oneenv.io.