New Delhi, India
BlogApril 10, 2025

Kubernetes Ingress Migration: Moving to Envoy Gateway Without Dropping Requests

Kubernetes
Envoy Gateway
Gateway API
NGINX Ingress
Canary Deployment
Harjot Singh Makkar
Kubernetes Ingress Migration: Moving to Envoy Gateway Without Dropping Requests
Replacing an ingress controller by deleting the old deployment and creating the new one is the fastest approach, and the most guaranteed to cause a production outage. Even a momentary gap where DNS resolves to an unready controller or un-warmed TCP proxy drops in-flight transactions and generates spikes of HTTP 502 and 504 errors. When migrating production traffic from legacy ingress-nginx to Envoy Gateway (implementing the Kubernetes Gateway API), the only safe path is a staged parallel routing pattern. By running both ingress controllers simultaneously within the same cluster and shifting traffic incrementally via DNS weights or route-level splits, you maintain full rollback capability at every step of the migration.
Deep-Dive Case Study: For the complete production migration from ingress-nginx to Envoy Gateway v1.7.0 with FluxCD GitOps, Gatekeeper policy debugging, and zero dropped requests, read Zero-Downtime Migration from ingress-nginx to Envoy Gateway v1.7.0.
The core rule of ingress migration is straightforward: never couple controller installation with traffic cutover. Separate provisioning, route translation, and traffic shifting into distinct operational phases: Install Envoy Gateway into a dedicated namespace (envoy-gateway-system) while leaving your existing ingress-nginx controller and all Ingress resources completely untouched. At this stage:
  • The GatewayClass (eg) and Gateway objects are instantiated.
  • The cloud provider provisions a separate external LoadBalancer IP for Envoy.
  • Zero production traffic reaches Envoy Gateway.
  • Platform engineers validate Envoy's internal readiness by issuing curl requests directly to the new LoadBalancer IP with explicit Host headers.
Legacy NGINX ingress configurations rely heavily on proprietary annotations (nginx.ingress.kubernetes.io/*). These do not translate automatically to Envoy Gateway. Instead, we map legacy routes into standard Kubernetes Gateway API HTTPRoute resources: During canary testing, enterprise workloads frequently encounter an unexpected barrier: HTTP 431 (Request Header Fields Too Large). In enterprise environments with SSO, Kerberos tokens, or corporate proxy headers, request headers often exceed Envoy's default 60KB limit. While NGINX used large-client-header-buffers, Envoy Gateway requires tuning Envoy's internal max_request_headers_kb. Because the Gateway API specification does not expose low-level Envoy connection settings directly, we leveraged an EnvoyPatchPolicy JSONPatch escape hatch: Validating this patch during the 10% canary window ensured that large authentication headers processed smoothly before migrating the remaining 90% of traffic. Once the canary route demonstrates parity:
  1. Update DNS records (or your external global load balancer) using weighted routing:
    • Shift 10% of traffic to Envoy's LoadBalancer IP.
    • Monitor error rates (502/503/504), p99 latency, and TLS handshake metrics.
    • Incrementally increase the weight: 25%, 50%, and finally 100%.
  2. Once 100% of traffic resolves to Envoy Gateway, allow existing connections on ingress-nginx to drain naturally over a 24-hour observation window.
  3. Remove legacy Ingress resources and uninstall the NGINX controller Helm chart via GitOps.
To ensure zero dropped requests, configure continuous telemetry on four key metrics:
  • Downstream 5xx Error Spikes: Real-time alerts on any non-zero rate of 502 Bad Gateway or 504 Gateway Timeout responses.
  • Latency Distribution Shifts: Comparing p95 and p99 response times between NGINX and Envoy data planes.
  • TLS Handshake Failures: Confirming that SNI negotiation and certificate chains match client expectations.
  • Upstream Connection Churn: Verifying that Envoy connection pooling maintains stable keep-alive connections to backend pods.
  • A hard cutover trades safety for speed: Parallel routing takes longer to plan, but it guarantees a deterministic, zero-downtime cutover with instant rollback capability.
  • Never rely on automatic annotation translation: Gateway API filters differ fundamentally from NGINX annotations. Map routes explicitly and test edge cases (header limits, CORS, path rewrites) before routing traffic.
  • Master the escape hatch: Standard Gateway API resources cover 90% of routing needs. For enterprise tuning (such as 512k header buffer sizes), tools like EnvoyPatchPolicy provide the necessary low-level control without abandoning declarative GitOps.
Share this post: