This provider converts NGINX Ingress Controller resources to Gateway API resources.
Note: This provider is specifically for NGINX Ingress Controller, not the community ingress-nginx controller. If you're using the community ingress-nginx controller, please use the ingress-nginx provider instead.
- Ingress - Core Kubernetes Ingress resources with NGINX-specific annotations
- Service - Kubernetes Services referenced by Ingress backend configurations
nginx.org/ssl-services- SSL/TLS backend connectionsnginx.org/grpc-services- gRPC backend connectionsnginx.org/websocket-services- WebSocket backend connectionsnginx.org/proxy-hide-headers- Hide headers from responsesnginx.org/proxy-set-headers- Set custom headersnginx.org/listen-ports- Custom HTTP portsnginx.org/listen-ports-ssl- Custom HTTPS portsnginx.org/path-regex- Regex path matchingnginx.org/rewrites- URL rewritingnginx.org/redirect-to-https- SSL/HTTPS redirectsingress.kubernetes.io/ssl-redirect- Legacy SSL redirect (for compatibility)nginx.org/hsts- HTTP Strict Transport Security headersnginx.org/hsts-max-age- HSTS max-age directivenginx.org/hsts-include-subdomains- HSTS includeSubDomains directive
# Convert NGINX Ingress Controller resources from cluster
ingress2gateway print --providers=nginx
# Convert from file
ingress2gateway print --providers=nginx --input-file=nginx-ingress.yaml| NGINX Annotation | Gateway API Resource |
|---|---|
nginx.org/ssl-services |
BackendTLSPolicy |
nginx.org/grpc-services |
GRPCRoute |
nginx.org/websocket-services |
Informational notification only |
nginx.org/proxy-hide-headers |
HTTPRoute ResponseHeaderModifier |
nginx.org/proxy-set-headers |
HTTPRoute RequestHeaderModifier |
nginx.org/rewrites |
HTTPRoute URLRewrite filter |
nginx.org/listen-ports* |
Gateway custom listeners |
nginx.org/path-regex |
HTTPRoute RegularExpression paths |
nginx.org/redirect-to-https |
HTTPRoute RequestRedirect filter |
ingress.kubernetes.io/ssl-redirect |
HTTPRoute RequestRedirect filter |
nginx.org/hsts* |
HTTPRoute ResponseHeaderModifier |
The provider supports two SSL redirect annotations with identical behavior:
nginx.org/redirect-to-https- Redirects all HTTP traffic to HTTPS with a 301 status codeingress.kubernetes.io/ssl-redirect- Redirects all HTTP traffic to HTTPS with a 301 status code (legacy compatibility)
When adding support for new NGINX Ingress Controller annotations:
- Add the annotation constant to
annotations/constants.go - Implement the conversion logic in the appropriate
annotations/*.gofile - Add comprehensive tests in
annotations/*_test.go - Update this README with the new annotation details
For more information on the provider architecture, see PROVIDER.md.