Before You Migrate: Five Surpr... Note

Before You Migrate: Five Surprising Ingress-NGINX Behaviors You Need to Know

Kubernetes will retire Ingress-NGINX in March 2026, and users need to migrate to other solutions like Gateway API. Ingress-NGINX has several surprising defaults and side effects that can cause outages if not considered during migration. The blog post highlights these behaviors to help users migrate safely and make conscious decisions about which behaviors to keep. One of the key issues is that Ingress-NGINX treats regex patterns as prefix and case-insensitive matches, which can lead to unexpected routing. Gateway API, on the other hand, uses implementation-specific regex matching, and users need to check with their implementation to verify the semantics of regex matching. The post also discusses how to preserve Ingress-NGINX behavior in Gateway API, including using HTTP path matches with a type of RegularExpression and configuring redirects using the HTTP request redirect filter. Additionally, the post notes that Ingress-NGINX and NGINX Ingress are two separate Ingress controllers, and the blog post only discusses Ingress-NGINX. The nginx.ingress.kubernetes.io/use-regex annotation applies to all paths of a host across all Ingress-NGINX Ingresses, and the nginx.ingress.kubernetes.io/rewrite-target annotation silently adds the nginx.ingress.kubernetes.io/use-regex annotation, along with all its side effects. Ingress-NGINX also redirects requests missing a trailing slash to the same path with a trailing slash, which can cause outages if not explicitly configured in Gateway API. Overall, the post aims to help users understand the quirks of Ingress-NGINX and migrate to Gateway API safely. Users need to be aware of these behaviors and take steps to preserve them in Gateway API to avoid outages.