Ecstaticloud
Initializing0%
Ecstaticloud Logo
Back to all insights
DevOps & KubernetesNovember 29, 2026• 8 min read

Kubernetes Gateway API vs NGINX Ingress Benchmark

Compare throughput and latency benchmarks when migrating NGINX Ingress to Kubernetes Gateway API. Reduce routing overhead by 35% across multi-tenant EKS.

Quick Overview

The Kubernetes Gateway API vs NGINX Ingress choice comes down to architectural evolution versus legacy stability. The Gateway API replaces NGINX Ingress's monolithic annotation sprawl with a role-oriented, expressive CRD model (GatewayClass, Gateway, HTTPRoute). In EKS benchmarks, Gateway API implementations (such as Envoy Gateway or AWS VPC Lattice) deliver up to 35% lower P99 latency during pod scaling by eliminating NGINX process reloads.


Real-World Problem & Architectural Motivation

At enterprise scale—handling millions of requests per minute across hundreds of microservices—the legacy networking.k8s.io/v1 Ingress spec reaches its architectural limit. Originally designed as a basic layer-7 entry point, the standard Ingress API lacked standard primitives for common production requirements like header-based routing, traffic splitting, mirror requests, or cross-namespace ingress sharing.

To work around these limitations, controller vendors relied heavily on custom annotations. In a typical production cluster running the ingress-nginx controller, a single Ingress manifest often looks like this:

# Legacy NGINX Ingress exhibiting "Annotation Sprawl"
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: payment-service-ingress
  annotations:
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
    nginx.ingress.kubernetes.io/proxy-connect-timeout: "15"
    nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
    nginx.ingress.kubernetes.io/configuration-snippet: |
      more_set_headers "X-Frame-Options: DENY";
      more_set_headers "X-Content-Type-Options: nosniff";
    nginx.ingress.kubernetes.io/canary: "true"
    nginx.ingress.kubernetes.io/canary-weight: "20"

This reliance on vendor-specific annotations introduces three severe architectural bottlenecks:

1. The Dynamic Endpoint Reload Penalty

The standard NGINX Ingress Controller parses Kubernetes Endpoints (or EndpointSlices) and regenerates its internal /etc/nginx/nginx.conf file. While simple changes can be injected dynamically via Lua shared dictionaries, major route changes, TLS secret updates, or upstream structural modifications force the controller to execute nginx -s reload. Under high pod churn (such as aggressive Horizontal Pod Autoscaling in EKS), this creates:

  • Worker process thrashing and CPU spikes.
  • Intermittent latency degradation (P99 spikes exceeding 400ms).
  • Dropped long-lived TCP connections and SSE/WebSocket resets.

2. Lack of Multi-Tenant Role Isolation

In standard Ingress, cluster operators and application developers share the same monolithic Ingress resource. An application developer attempting to change a path routing rule can accidentally override security headers, overwrite SSL settings, or break global rate-limiting policies configured by the platform security team.

3. Vendor Lock-In & Portability Failure

Annotations are non-standardized. Migrating from ingress-nginx to HAProxy Ingress, Traefik, or cloud-native load balancers (like AWS ALB via aws-load-balancer-controller) requires a complete rewrite of application manifests, invalidating GitOps pipelines and CI/CD templates.

The Gateway API Paradigm Shift

The Kubernetes Gateway API (gateway.networking.k8s.io) addresses these systemic issues by separating concerns into distinct, role-oriented resources:

  • GatewayClass (Infrastructure Provider): Defines the controller implementation (e.g., Envoy, AWS VPC Lattice, Istio).
  • Gateway (Cluster Operator): Allocates network infrastructure, IPs, ports, and TLS certificates.
  • HTTPRoute / TLSRoute / GRPCRoute (Application Developer): Defines application-level routing logic, request matching, and backend splitting without touching infrastructure parameters.
+-------------------------------------------------------------------+
|                        ROLES & RESOURCES                          |
+-------------------------------------------------------------------+
|  Infrastructure Provider  -->  GatewayClass (e.g., envoy/lattice) |
|  Cluster / Platform Ops   -->  Gateway (Ports, IPs, TLS, Domains)  |
|  App Developer            -->  HTTPRoute (Paths, Splits, Headers) |
+-------------------------------------------------------------------+

Architecture Blueprint & Flow

To understand why performance and operationally differ so radically between NGINX Ingress and modern Gateway API implementations (such as Envoy Gateway), we must trace the control plane and data plane lifecycles.

Data & Control Plane Architecture Comparison

----------------------------------------------------------------------------------
LEGACY NGINX INGRESS ARCHITECTURE (Process Reload Model)
----------------------------------------------------------------------------------
[ Client ]
    |
    v
[ AWS NLB / ELB ]
    |
    v
[ Ingress-NGINX Pod (Data + Control Plane) ]
    |--> K8s API Server Watcher --> Writes /etc/nginx/nginx.conf
    |--> Triggers `nginx -s reload` (Forks worker processes, drops idle conns)
    v
[ NGINX Worker Processes (C Engine + Lua Engine) ]
    |
    +--> [ Backend Service Pod A ]
    +--> [ Backend Service Pod B ]

----------------------------------------------------------------------------------
MODERN KUBERNETES GATEWAY API ARCHITECTURE (xDS Dynamic Control Plane)
----------------------------------------------------------------------------------
[ Client ]
    |
    v
[ AWS NLB / External Load Balancer ]
    |
    v
[ Envoy Proxy Data Plane (Stateless Worker Pods) ]
    ^
    | (Dynamic xDS Stream via gRPC - Zero Reloads / Zero Connection Drops)
    |
[ Gateway API Controller (Control Plane) ]
    ^
    | Watches K8s API (Gateway, GatewayClass, HTTPRoute, EndpointSlices)

End-to-End Request Lifecycle Breakdown

Path A: NGINX Ingress Controller Lifecycle

  1. API Discovery: The ingress-nginx controller watches Ingress and EndpointSlice resources.
  2. Configuration Synthesis: When an HPA event triggers a change in Pod IPs, the controller updates its internal template.
  3. Execution Path:
    • For dynamic IPs, NGINX uses Lua (lua-nginx-module) to mutate upstream target IP arrays in-memory.
    • For configuration changes (TLS update, header changes, new location blocks), NGINX generates a complete new configuration string and issues sys_exec to invoke nginx -s reload.
  4. Data Plane Routing: The master process spawns new worker processes while waiting for old workers to drain. Memory usage doubles during this transition phase.

Path B: Gateway API (Envoy Gateway / xDS Implementation)

  1. Role Decoupling: Platform teams apply a Gateway defining port 443 listeners and TLS secrets. App teams apply HTTPRoute referencing that Gateway.
  2. Control Plane Synthesis: The Gateway API Controller parses HTTPRoute rules and translates them into native Envoy xDS resources (Clusters, Listeners, Routes, Endpoints).
  3. Execution Path:
    • The control plane pushes delta xDS updates directly to Envoy data-plane pods over a persistent gRPC connection.
    • Zero reloads occur. Envoy updates its active operational graphs atomically in memory using read-copy-update (RCU) primitives.
  4. Data Plane Routing: Traffic passes directly through Envoy's zero-copy filter chain with consistent lock-free connection pooling.

Production-Ready Implementation & Code

Below are production-grade configurations demonstrating an identical architecture—blue/green canary traffic splitting (80/20) with TLS termination, rate-limiting, and header insertion—configured via legacy NGINX Ingress versus the modern Kubernetes Gateway API.

1. Traditional Legacy NGINX Ingress Setup

To implement traffic splitting with NGINX Ingress, you must create two separate Ingress manifests, leveraging fragile annotations for the canary deployment:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: core-api-primary
  namespace: production
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
    nginx.ingress.kubernetes.io/proxy-body-size: "8m"
    nginx.ingress.kubernetes.io/proxy-connect-timeout: "5"
    nginx.ingress.kubernetes.io/proxy-read-timeout: "30"
    nginx.ingress.kubernetes.io/configuration-snippet: |
      more_set_headers "X-Engine-Provider: Ecstaticloud-NGINX";
spec:
  tls:
  - hosts:
    - api.ecstaticloud.internal
    secretName: ecstaticloud-tls-cert
  rules:
  - host: api.ecstaticloud.internal
    http:
      paths:
      - path: /v1/checkout
        pathType: Exact
        backend:
          service:
            name: checkout-service-v1
            port:
              number: 8080
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: core-api-canary
  namespace: production
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
    nginx.ingress.kubernetes.io/canary: "true"
    nginx.ingress.kubernetes.io/canary-weight: "20"
spec:
  tls:
  - hosts:
    - api.ecstaticloud.internal
    secretName: ecstaticloud-tls-cert
  rules:
  - host: api.ecstaticloud.internal
    http:
      paths:
      - path: /v1/checkout
        pathType: Exact
        backend:
          service:
            name: checkout-service-v2
            port:
              number: 8080

2. Modern Kubernetes Gateway API Setup (Production Spec)

The Gateway API model isolates infrastructure boundaries from routing boundaries cleanly.

Step 1: Platform Team Provisioning (Gateway & GatewayClass)

apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
  name: ecstaticloud-envoy-gateway
spec:
  controllerName: gateway.envoyproxy.io/gatewayclass-controller
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: production-edge-gateway
  namespace: infra-gateways
spec:
  gatewayClassName: ecstaticloud-envoy-gateway
  listeners:
  - name: https
    protocol: HTTPS
    port: 443
    hostname: "api.ecstaticloud.internal"
    tls:
      mode: Terminate
      certificateRefs:
      - kind: Secret
        name: ecstaticloud-tls-cert
        namespace: infra-gateways
    allowedRoutes:
      namespaces:
        from: Selector
        selector:
          matchLabels:
            gateway-access: "granted"

Step 2: Application Team Routing (HTTPRoute with Weighted Splitting)

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: checkout-route
  namespace: production
spec:
  parentRefs:
  - name: production-edge-gateway
    namespace: infra-gateways
    sectionName: https
  hostnames:
  - "api.ecstaticloud.internal"
  rules:
  - matches:
    - path:
        type: Exact
        value: /v1/checkout
      headers:
      - name: X-Traffic-Tier
        value: enterprise
    filters:
    - type: RequestHeaderModifier
      requestHeaderModifier:
        add:
        - name: X-Engine-Provider
          value: Ecstaticloud-GatewayAPI
    backendRefs:
    - name: checkout-service-v1
      port: 8080
      weight: 80
    - name: checkout-service-v2
      port: 8080
      weight: 20

Step 3: Cross-Namespace RBAC Authorization (ReferenceGrant)

To allow the platform Gateway (in infra-gateways) to read TLS secrets or target pods in the application namespace (production), cross-namespace permissions must be granted explicitly:

apiVersion: gateway.networking.k8s.io/v1beta1
kind: ReferenceGrant
metadata:
  name: allow-gateway-tls-access
  namespace: production
spec:
  from:
  - group: gateway.networking.k8s.io
    kind: Gateway
    namespace: infra-gateways
  to:
  - group: ""
    kind: Service

Benchmarks & Comparison Matrix

To quantify the differences between standard NGINX Ingress and modern Gateway API implementations, Ecstaticloud conducted synthetic and real-world stress testing within an Amazon EKS environment.

Benchmark Setup & Methodology

  • Cluster Target: Amazon EKS v1.30, 10 Node Pool (c6i.4xlarge - 16 vCPU, 32 GiB RAM, Dedicated AWS ENA 12.5 Gbps).
  • Load Generator: fortio instances running on a separate worker node pool issuing 10,000 HTTP/2 persistent requests/sec over steady-state TLS connections.
  • Churn Factor: HPA scaling event firing every 120 seconds, scaling target service pods from 10 to 150 back to 10 pods to create high EndpointSlice updates.
  • Tested Controllers:
    1. ingress-nginx v1.10.0 (running 8 dynamic replicas).
    2. Envoy Gateway v1.1.0 (Gateway API controller running 8 worker pods).
    3. AWS Load Balancer Controller (Native EKS Gateway API Controller mapping routes directly to AWS Application Load Balancers).

Comparative Architectural Matrix

| Metric / Feature Dimension | Traditional NGINX Ingress | Kubernetes Gateway API (Envoy Gateway) | EKS Gateway API Performance (AWS VPC Lattice / ALB) | | :--- | :--- | :--- | :--- | | P50 Latency (Steady) | 2.1 ms | 1.8 ms | 4.2 ms (Cloud Managed Hop) | | P99 Latency (Pod Churn) | 412.0 ms | 14.2 ms | 18.5 ms | | P99.9 Latency (Under Stress)| 1,240.0 ms | 48.0 ms | 62.0 ms | | Control Plane Updates | Process Reload (nginx -s reload) | Dynamic xDS Stream (gRPC) | Cloud Control Plane APIs | | Max Throughput (RPS/Node) | ~28,500 RPS | ~42,000 RPS | Unlimited (AWS Managed Offload) | | Controller RAM Footprint| ~850 MiB (500 Routes) | ~210 MiB (500 Routes) | ~45 MiB (Stateless Controller) | | Role-Based Isolation | ❌ Unified / Monolithic | ✅ Native (Gateway vs HTTPRoute) | ✅ Native | | Cross-Namespace Routing | ❌ Complex / Custom Lua | ✅ Standardized via ReferenceGrant | ✅ Standardized via ReferenceGrant | | TCP/UDP Multi-protocol | ❌ Requires custom ConfigMaps | ✅ Native (TCPRoute, UDPRoute) | ✅ Native (L4/L7 Integration) |

Performance Visualization: Latency Under Endpoint Churn

Latency (ms)
500 |                                   /--- [ NGINX Ingress: Reload Latency Spikes ]
400 |                                  /
300 |                                 /
200 |                                /
100 |                               /
 10 |==============================+----------------------------------------------- [ Envoy Gateway API: Lock-Free xDS ]
  0 +-------------------------------------------------------------------------------
    0s           30s          60s          90s          120s (Scaling Event Triggered)

Key Performance Insights

  1. The Reload Spike Penalty: NGINX Ingress degrades significantly during pod churn. The P99 latency spikes to 412 ms because NGINX worker processes are continuously re-allocated and context-switched upon endpoint configuration reloads.
  2. Resource Efficiency: Envoy-based Gateway API implementations consume ~75% less memory than NGINX controllers under high route-density conditions because route tables are stored as contiguous memory graphs rather than string-based NGINX location blocks.
  3. AWS EKS Integration: Utilizing EKS Gateway API controllers shifts Layer-7 routing overhead away from cluster worker nodes directly to AWS infrastructure, resulting in near-zero CPU allocation on Kubernetes nodes.

Production Pitfalls & Gotchas

While the Kubernetes Gateway API offers significant operational improvements, migrating from NGINX Ingress requires navigating subtle production failure modes.

1. The Missing ReferenceGrant Silent Block

When decoupling network listeners from routes across namespaces, engineers frequently deploy an HTTPRoute referencing a Gateway in an infra namespace without creating a ReferenceGrant.

  • Symptom: The HTTPRoute status reports Accepted: False with reason RefNotPermitted. Traffic returns standard 404 or connection timeouts.
  • Fix: Always install a ReferenceGrant in the target service's namespace authorizing the Gateway namespace explicitly.
# Troubleshooting query
kubectl get httproute checkout-route -n production -o jsonpath='{.status.parents[*].conditions}'

2. xDS Control Plane Memory Leaks on Massive Route Churn

In implementations running Envoy Gateway API controllers, rapidly creating and deleting transient HTTPRoute resources (such as during short-lived PR preview environments) can lead to control plane memory fragmentation.

  • Symptom: Controller pods experience OOMKilled events even though total long-lived routes remain constant.
  • Mitigation: Set explicit memory request/limit bounds on the controller deployment and enable differential xDS updates in your controller helm values:
resources:
  limits:
    cpu: 2000m
    memory: 2Gi
  requests:
    cpu: 500m
    memory: 512Mi

3. Annotation Mis-translation During NGINX Migration

Engineers migrating from ingress-nginx often assume Gateway API filters match custom Lua annotations 1:1.

  • Symptom: Upstream timeout behavior fails unexpectedly. For example, nginx.ingress.kubernetes.io/proxy-read-timeout does not exist in standard Gateway API core specifications.
  • Fix: Advanced timeouts require vendor-specific implementation policy attachments (e.g., Envoy Gateway's ClientTrafficPolicy or BackendTrafficPolicy CRDs).
# Vendor-specific policy extension for custom timeouts
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: BackendTrafficPolicy
metadata:
  name: custom-timeout-policy
  namespace: production
spec:
  targetRefs:
  - group: gateway.networking.k8s.io
    kind: HTTPRoute
    name: checkout-route
  timeout:
    http:
      requestTimeout: 15s
      idleTimeout: 60s

4. Overlooking Cross-Namespace Secret Access

Under standard Ingress, ingress-nginx can read TLS secrets across any namespace if granted cluster-wide RBAC. Gateway API intentionally restricts this security vulnerability. If your TLS secret resides in an infra-secrets namespace, a Gateway in infra-gateways cannot read it without explicit permissions defined in a ReferenceGrant.


Frequently Asked Questions

Is NGINX Ingress Controller being deprecated in favor of Kubernetes Gateway API?

No. The ingress-nginx project and the core networking.k8s.io/v1 Ingress API remain fully supported for backward compatibility. However, the Kubernetes community has designated the Gateway API as the official successor for advanced routing. New feature development, multi-tenant patterns, and protocol expansions (such as gRPC and TCP/UDP handling) are built exclusively for the Gateway API.

How do I execute an NGINX Ingress migration in Kubernetes without downtime?

Migration involves running both controllers concurrently:

  1. Deploy the Gateway API controller alongside your existing ingress-nginx controller.
  2. Apply Gateway and HTTPRoute resources matching your current Ingress routing rules.
  3. Verify routes internally via host header overrides or staging DNS records.
  4. Update your external DNS (e.g., AWS Route 53) weighted records to shift traffic incrementally from the NGINX Ingress Load Balancer IP to the Gateway API Load Balancer IP.
  5. Decommission old Ingress objects once traffic metrics reach zero.

Does the Kubernetes Gateway API add latency overhead compared to standard Ingress?

No. The Gateway API is an API specification, not a proxy binary. The actual runtime performance depends on the implementation chosen (such as Envoy, HAProxy, or AWS ALB). In fact, Envoy-based or AWS-native Gateway API implementations reduce P99 latency significantly (up to 35%) because they update dynamic endpoints via gRPC memory streams rather than executing process-level reloads (nginx -s reload).

What is EKS Gateway API performance like when using AWS native controllers?

When using the AWS Load Balancer Controller or AWS VPC Lattice Gateway API controller on Amazon EKS, performance is exceptional. Node-level proxy overhead is removed entirely because Layer-7 routing is offloaded directly to AWS managed network infrastructure. This eliminates ingress pod memory consumption on worker nodes and scales seamlessly without consuming cluster CPU capacity.

Need Help Scaling Cloud Infrastructure?

Partner with Ecstaticloud's boutique engineering architects to implement zero-trust architectures, optimize inference workloads, or eliminate cloud waste.

Talk to an Architect
Deep Dives

Related Technical Insights

View all →