Conversion Mapping
This document describes how Kubernetes Ingress fields are mapped to Gateway API resources.
Overview
A single Ingress resource is converted to:
One Gateway resource
One or more HTTPRoute resources (one per host rule)
GRPCRoute resources (if gRPC backends are detected)
Field Mapping
Ingress to Gateway
Ingress Field |
Gateway Field |
Notes |
|---|---|---|
|
|
Same name is used |
|
|
Same namespace |
|
|
Mapped to provider gateway class |
|
|
Creates HTTPS listeners |
|
|
TLS certificate reference |
|
|
Creates HTTP listeners for non-TLS hosts |
Ingress to HTTPRoute
Ingress Field |
HTTPRoute Field |
Notes |
|---|---|---|
|
|
Suffixed with host name |
|
|
Same namespace |
|
|
Host matching |
|
|
Path matching |
|
|
See path type mapping |
|
|
Service name |
|
|
Service port |
Path Type Mapping
Ingress pathType |
Gateway API path.type |
|---|---|
|
|
|
|
|
|
Annotation Mapping
Nginx Ingress Annotations
Annotation |
Gateway API Equivalent |
Notes |
|---|---|---|
|
|
URL rewrite filter |
|
|
Redirect to HTTPS |
|
Creates |
gRPC backend detection |
|
Warning generated |
No direct equivalent |
|
Warning generated |
Provider-specific |
|
Warning generated |
Requires policy attachment |
Traefik Annotations
Annotation |
Gateway API Equivalent |
Notes |
|---|---|---|
|
Warning generated |
Listener configuration |
|
Warning generated |
No direct equivalent |
|
Warning generated |
Requires policy attachment |
Istio Annotations
Annotation |
Gateway API Equivalent |
Notes |
|---|---|---|
|
|
Provider selection |
gRPC Detection
gRPC backends are detected based on:
Annotation:
nginx.ingress.kubernetes.io/backend-protocol: GRPCPort naming: Service port named
grpcorgrpc-*Port number: Common gRPC ports (9090, 50051)
When gRPC is detected, a GRPCRoute is created instead of HTTPRoute:
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: GRPCRoute
metadata:
name: grpc-service-route
spec:
parentRefs:
- name: gateway
hostnames:
- grpc.example.com
rules:
- backendRefs:
- name: grpc-service
port: 9090
Examples
Basic Ingress
Input:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example
namespace: default
spec:
ingressClassName: nginx
rules:
- host: example.com
http:
paths:
- path: /api
pathType: Prefix
backend:
service:
name: api-service
port:
number: 8080
Output:
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: example
namespace: default
spec:
gatewayClassName: istio
listeners:
- name: http-example-com
hostname: example.com
port: 80
protocol: HTTP
allowedRoutes:
namespaces:
from: Same
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: example-example-com
namespace: default
spec:
parentRefs:
- name: example
namespace: default
hostnames:
- example.com
rules:
- matches:
- path:
type: PathPrefix
value: /api
backendRefs:
- name: api-service
port: 8080
Ingress with TLS
Input:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: secure-app
namespace: default
spec:
tls:
- hosts:
- secure.example.com
secretName: tls-secret
rules:
- host: secure.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: secure-service
port:
number: 443
Output:
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: secure-app
namespace: default
spec:
gatewayClassName: istio
listeners:
- name: https-secure-example-com
hostname: secure.example.com
port: 443
protocol: HTTPS
tls:
mode: Terminate
certificateRefs:
- kind: Secret
name: tls-secret
allowedRoutes:
namespaces:
from: Same
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: secure-app-secure-example-com
namespace: default
spec:
parentRefs:
- name: secure-app
namespace: default
hostnames:
- secure.example.com
rules:
- matches:
- path:
type: PathPrefix
value: /
backendRefs:
- name: secure-service
port: 443
Ingress with Rewrite Annotation
Input:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: rewrite-example
namespace: default
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /api/$1
spec:
rules:
- host: example.com
http:
paths:
- path: /v1/(.*)
pathType: Prefix
backend:
service:
name: api-service
port:
number: 8080
Output:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: rewrite-example-example-com
namespace: default
spec:
parentRefs:
- name: rewrite-example
namespace: default
hostnames:
- example.com
rules:
- matches:
- path:
type: PathPrefix
value: /v1/
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplacePrefixMatch
replacePrefixMatch: /api/
backendRefs:
- name: api-service
port: 8080
Reverse Mapping (Gateway API to Ingress)
The tool also supports reverse conversion:
Gateway API Field |
Ingress Field |
Notes |
|---|---|---|
|
|
Same name |
|
|
Mapped to ingress class |
|
|
TLS configuration |
|
|
Host rules |
|
|
Path rules |
|
|
Backend services |
Supported Features
Feature |
Status |
|---|---|
Basic Ingress conversion |
✓ |
TLS/HTTPS listeners |
✓ |
Multi-host Ingress |
✓ |
Multi-document YAML |
✓ |
Nginx rewrite annotations |
✓ |
SSL redirect annotations |
✓ |
gRPC backend detection |
✓ |
GRPCRoute generation |
✓ |
Reverse conversion |
✓ |
Provider presets |
✓ |
Validation |
✓ |
Migration reports |
✓ |
Limitations
Some features require manual configuration after conversion:
Rate limiting: Requires provider-specific policy attachment
CORS: Requires provider-specific policy attachment
Authentication: Requires provider-specific policy attachment
Custom headers: May require HTTPRoute filters or policy
Session affinity: Provider-specific configuration
Canary deployments: Requires traffic splitting configuration