InsightsPlatform Engineering
Moving from ingress-nginx to Gateway API without changing how requests are routed
ingress-nginx was scheduled to retire in March 2026. How to inventory what your Ingress objects really do, convert them with ingress2gateway, check the behaviours that differ between controllers and move traffic over one hostname at a time.
Published November 8, 20266 min read
If your clusters still run ingress-nginx, you are running a controller that the Kubernetes project said it would retire in March 2026. After retirement there are no more releases, bug fixes or security updates. Existing deployments keep working, which is exactly the problem: nothing breaks, so nothing prompts anyone to move.
The Kubernetes Steering and Security Response Committees said in their statement of 29 January 2026 that none of the alternatives is a drop-in replacement. Gateway API is the project's recommended direction, but a migration is not a find-and-replace of kind: Ingress. This article covers how to do it so that the routing your users depend on stays the same.
Find out what you actually run
The statement gives a way to check whether the controller is present. Run it with cluster admin permissions:
kubectl get pods --all-namespaces --selector app.kubernetes.io/name=ingress-nginxThen list what it serves, and which annotations carry behaviour:
kubectl get ingress -A -o json \
| jq -r '.items[] | .metadata.namespace + "/" + .metadata.name as $n
| (.metadata.annotations // {} | keys[]
| select(startswith("nginx.ingress.kubernetes.io/"))) as $a
| "\($a)\t\($n)"' \
| sort | uniq -c | sort -rnThe output is your migration backlog. Annotations such as rewrite-target, use-regex, proxy-read-timeout, proxy-body-size or configuration-snippet each stand for a behaviour that has to exist on the other side. A configuration snippet in particular is arbitrary NGINX configuration, and it will not convert mechanically.
Know the model you are moving to
Ingress has one object and one owner. Gateway API splits the work by role:
| Object | Typical owner | Purpose |
|---|---|---|
GatewayClass | Infrastructure provider | Names the controller implementation |
Gateway | Platform team | Listeners: ports, hostnames, TLS termination |
HTTPRoute | Application team | Matching and routing rules attached to a Gateway |
Features that Ingress controllers exposed through annotations, such as redirects, header changes and traffic splitting, are fields on HTTPRoute. Anything not in the core API is provided through implementation-specific policy resources, and the Gateway API project discourages annotations on its own resources. The migrating from Ingress guide shows one Ingress becoming a Gateway, two HTTPRoutes and a separate redirect route.
That split is the main design decision. Put the Gateway in a platform-owned namespace and decide which namespaces may attach routes to it. Do that before converting anything, or every converted route inherits an accidental answer.
Install the API and choose an implementation
Gateway API is a set of CRDs plus a controller. Most implementations expect you to install the CRDs from a release of the project. The current release line is v1.5 (patch v1.5.1), which promoted ListenerSet, TLSRoute, the HTTPRoute CORS filter, client certificate validation, certificate selection for Gateway TLS origination and ReferenceGrant to the Standard channel, per the v1.5 announcement.
kubectl apply --server-side -f \
https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.5.1/standard-install.yamlWhich controller to pick is a separate decision and depends on what you already run. Keep one rule: choose it before converting, because a few translations depend on the implementation.
Convert with ingress2gateway
ingress2gateway reads Ingress objects and writes equivalent Gateway API resources. Version 1.0, announced on 20 March 2026, supports over 30 common ingress-nginx annotations (before 1.0 it supported three), backs each with controller-level tests that compare ingress-nginx and the generated output, and has pluggable emitters. The standard emitter produces core Gateway API resources; Agentgateway, Envoy Gateway and Kgateway emitters can add resources specific to those projects.
# From the cluster, every namespace
ingress2gateway print --providers=ingress-nginx -A > gateway-api.yaml
# From manifests in a repository, with an implementation-specific emitter
ingress2gateway print --providers=ingress-nginx \
--input-file ingress/*.yaml \
--emitter envoy-gateway > gateway-api.yamlThe flags worth knowing, from the project README:
--ingress-nginx-ingress-classselects Ingresses by class (defaultnginx), which matters if you run more than one controller.--allow-experimental-gw-apiincludes experimental fields such asURLRewrite. Leave it off unless your implementation supports them.--input-filereads manifests instead of the cluster, so conversion can run in CI against your repository.
The tool warns about fields it could not translate and says so on output. Treat each warning as a ticket. The project also states that some translations are approximate; proxy read and send timeouts and body-size limits do not map perfectly. The generated YAML is a first draft to review, not something to apply.
Check the behaviours that differ
The conversion can be correct on paper and still route differently. The Kubernetes blog post Five Surprising Ingress-NGINX Behaviors lists the places where ingress-nginx does more than the manifest says:
- Regex paths are prefix matches and case-insensitive. A path of
/[A-Z]{3}withuse-regex: "true"also matches/uuid. In Gateway API aRegularExpressionpath match has implementation-specific semantics. The post notes that Envoy-based implementations (Istio, Envoy Gateway, Kgateway) match the whole path and are case-sensitive, so a rule that used to catch more than intended may now catch less. use-regexapplies to every path of a host, across all Ingresses that share the host, not only the object carrying the annotation.rewrite-targetturns on regex matching for the paths of that Ingress.- Missing trailing slashes are redirected to the path with a slash.
- URLs are normalized (dot segments, duplicate slashes) before matching.
None of these needs a clever fix. They need a test. Write down the request paths your clients really send, including the sloppy ones, and run them against both stacks.
#!/usr/bin/env bash
# Usage: compare.sh paths.txt old.example.com new-gateway-ip
set -euo pipefail
paths=$1; host=$2; new=$3
while read -r path; do
old_status=$(curl -s -o /dev/null -w '%{http_code} %{redirect_url}' "https://$host$path")
new_status=$(curl -s -o /dev/null -w '%{http_code} %{redirect_url}' \
--resolve "$host:443:$new" "https://$host$path")
[ "$old_status" = "$new_status" ] || echo "DIFF $path old=[$old_status] new=[$new_status]"
done < "$paths"A good source for paths.txt is a day of access logs, reduced to unique method and path combinations per host. Real traffic finds the case-mismatched path and the double slash that no one remembers.
Move traffic one hostname at a time
Run both controllers side by side. The new Gateway gets its own load balancer address, so nothing about the old path changes while you test.
- Apply the reviewed Gateway and routes. Confirm the
GatewayisProgrammedand eachHTTPRoutereportsAcceptedandResolvedRefsin its status. - Run the comparison script against the new address.
- Lower the DNS TTL ahead of time, then point one low-risk hostname at the new Gateway. Watch error rate and latency per host for at least a full traffic cycle.
- Continue with the next hostname. Rolling back is a DNS change as long as the old Ingress is still in place.
- Delete the Ingress objects and then the controller only after every hostname has moved and the old controller has seen no traffic.
Cross-namespace backends need an explicit ReferenceGrant, which is in the Standard channel as of v1.5. Ingress could only point at Services in its own namespace, so most migrations do not need one, but a shared Gateway that routes into other namespaces' Services will.
What goes wrong
- Silent annotation loss. An annotation without a Gateway API equivalent is dropped, and the route works without the behaviour it used to have, such as an IP allow list or a rate limit. Reconcile the annotation inventory against the converted output line by line.
- TLS ownership moves. Certificates were referenced per Ingress. They now belong to Gateway listeners, so the team that manages the Gateway also manages certificate references. Decide who that is.
- Timeouts change meaning. Per-annotation proxy timeouts become implementation-specific settings or policy resources. Measure long uploads, streaming responses and WebSockets explicitly.
- Two controllers, one class. If an old and a new controller both claim the same load balancer or hostname, you get flapping. Keep their addresses and DNS names separate until the cutover.
Where to start
Run the pod check and the annotation inventory this week. Choose an implementation, put one non-critical hostname through conversion, comparison and cutover, and use what it teaches you to fix the process before the important hostnames go. A controller with no security updates is a risk that grows, so the migration is worth scheduling now rather than after the first advisory.