Migration
This document provides a side-by-side comparison of the migration from Nginx Ingress to Gateway API.
Before: Nginx Ingress Configuration
Here's the original Nginx Ingress configuration:
After: Gateway API Configuration
Here's the migrated Gateway API configuration:
Resource Mapping
| Nginx Ingress | Gateway API | Notes |
|---|---|---|
| IngressClass | GatewayClass | Defines controller type |
| Ingress Controller Setup | Gateway | Network endpoints and TLS |
| Ingress Resource | HTTPRoute | Routing rules |
| Ingress TLS | Gateway TLS | Centralized at Gateway level |
| Ingress Backend | BackendRef | More powerful in Gateway API |
Annotation Mapping
| Nginx Annotation | Gateway API Equivalent |
|---|---|
nginx.ingress.kubernetes.io/rewrite-target | URLRewrite filter |
nginx.ingress.kubernetes.io/canary-weight | weight in backendRefs |
nginx.ingress.kubernetes.io/limit-rps | RateLimitPolicy |
nginx.ingress.kubernetes.io/proxy-connect-timeout | TimeoutPolicy |
nginx.ingress.kubernetes.io/enable-cors | CORSPolicy |
nginx.ingress.kubernetes.io/permanent-redirect | RequestRedirect filter |
Key Differences
1. Architecture
Nginx Ingress:
- Single
Ingressresource for all configuration - Controller deployed separately
- TLS configured per Ingress
Gateway API:
- Separate
Gateway(infrastructure) andHTTPRoute(application) - Gateway is a Kubernetes resource
- TLS configured once at Gateway level
2. Role Separation
Nginx Ingress:
- Infrastructure and application teams modify same resource
- Limited role separation
Gateway API:
- Infrastructure team: Gateway
- Application team: HTTPRoute
- Clear separation of concerns
3. Portability
Nginx Ingress:
- Nginx-specific annotations
- Not portable across implementations
Gateway API:
- Standard API
- Works across implementations (Nginx, Istio, Contour, etc.)
4. Expressiveness
Nginx Ingress:
- Limited native features
- Requires annotations for advanced features
Gateway API:
- Native support for advanced routing
- Rich filter system
- Policy attachments
Migration Benefits
- Better Organization: Clear separation between infrastructure and application
- Portability: Works with any Gateway API implementation
- Native Features: Advanced features built-in, not via annotations
- Scalability: Application teams can create routes independently
- Standard API: Follows Kubernetes API patterns
Migration Challenges
- Learning Curve: New concepts and resources
- Implementation Support: Some features vary by implementation
- Migration Effort: Requires updating all Ingress resources
- Testing: Need to test thoroughly after migration
Migration Checklist
- Install Gateway API CRDs
- Install Gateway implementation
- Create GatewayClass
- Create Gateway with TLS
- Migrate Ingress to HTTPRoute
- Migrate annotations to filters/policies
- Test routing
- Test TLS
- Test advanced features
- Monitor metrics
- Remove old Ingress resources
Related Documentation
- Migration Guide - Detailed migration steps
- Core Concepts - Understanding Gateway API
- Best Practices - Gateway API best practices
Sources & References
•
Gateway API Official Documentation(Version: v1)
•
NGINX Gateway Fabric Documentation(Version: 2.2.1)