Kong contributed to the kubernetes-sigs project ingress2gateway
by creating a Kong provider able to convert ingress resources into Gateway resources. The ingress2Gateway
tool provides a print
command that gets ingress resources and displays the Gateway API equivalent. The output of this operation can be either directly applied to the cluster, or it can generate a new set of YAML files containing the converted configuration.
Migrating from Ingress to Gateway API
Supported Ingress features and annotations
Kong Ingress Controller provides an extensive set of annotations. The ingress2gateway
Kong Gateway provider currently supports the following annotations:
Annotation name |
Conversion |
---|---|
kubernetes.io/ingress.class
required |
gateway.spec.gatewayClassName
|
konghq.com/methods
|
httpRoute.spec.rules[*].matches[*].method
|
konghq.com/headers._
|
httpRoute.spec.rules[_].matches[*].headers
|
konghq.com/plugins
|
httpRoute.spec.rules[*].filters
|
Features
kubernetes.io/ingress.class
If configured on an Ingress resource, this value is used as the gatewayClassName
set on the corresponding generated Gateway.
konghq.com/methods
If configured on an Ingress resource, this value is used to set the HTTPRoute
method matching configuration. Since many methods can be set as a comma-separated list, each method creates a match copy. All the matches belonging to the same HTTPRoute
rule are put in OR
.
konghq.com/headers.*
If configured on an Ingress resource, this value sets the HTTPRoute
header matching configuration. Only exact matching is supported. Because many values can be set for the same header name as a comma-separated list, each header value is used to create a match copy. All the matches belonging to the same HTTPRoute
rule are put in OR
.
konghq.com/plugins
If configured on an Ingress resource, this value attaches plugins to Routes. Plugin references are converted into HTTPRoute
ExtensionRef
filters. Each plugin annotation is converted into a Kong Gateway Plugin instance.
Each value in the annotation must match the name of a KongPlugin
or KongClusterPlugin
.