For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
Ingress NGINX
How ingress-nginx annotations map to Gateway API + agentgateway resources
The ingress-nginx provider defines the source resources to be translated, e.g. an Ingress resource with Ingress NGINX-specific annotations.
Note: Some annotations may be translated into agentgateway resources or user-facing notifications.
The mappings on this page describe ingress2gateway v0.5.0.
Ingress class selection
The provider selects the nginx Ingress class by default. To convert Ingresses with another class, set
--ingress-nginx-ingress-class=<class-name>. Generated Gateways still use gatewayClassName: agentgateway.
Supported Annotations
The ingress-nginx provider currently supports an Ingress with the following annotations.
Canary / Traffic Shaping
nginx.ingress.kubernetes.io/canary: If set totrue, enables weighted backends.nginx.ingress.kubernetes.io/canary-by-header: Specifies the header name used to generate an HTTPHeaderMatch.nginx.ingress.kubernetes.io/canary-by-header-value: Specifies the exact header value to match.nginx.ingress.kubernetes.io/canary-by-header-pattern: Specifies a regex pattern used in the header match.nginx.ingress.kubernetes.io/canary-weight: Specifies the backend weight for traffic shifting.nginx.ingress.kubernetes.io/canary-weight-total: Defines the total weight used when calculating backend percentages.
Request / Body Size
nginx.ingress.kubernetes.io/client-body-buffer-size: The emitter writesAgentgatewayPolicy.spec.frontend.http.maxBufferSizewhenproxy-body-sizeis not present. Quantities are converted to bytes.Note (regex-mode constraint): Ingress NGINX session cookie paths do not support regex. If regex-mode is enabled for a host (via
use-regex: "true"orrewrite-target) and cookie affinity is used,session-cookie-pathmust be set; the provider validates this and emits an error if it is missing.nginx.ingress.kubernetes.io/proxy-body-size: The emitter writesAgentgatewayPolicy.spec.frontend.http.maxBufferSizein bytes and takes precedence overclient-body-buffer-size. The resolved size must be greater than zero and fit in a signed 32-bit integer.
Warning
The generated policy targets the HTTPRoute. agentgateway accepts spec.frontend only when every target is a Gateway, so kubectl apply rejects the policy: the 'frontend' field can only target a Gateway.
Change targetRefs so the policy targets the generated Gateway, or move spec.frontend into a separate policy that targets that Gateway. A Gateway target applies the setting to every route on the Gateway.
CORS
nginx.ingress.kubernetes.io/enable-cors: Enables CORS policy generation. When set to “true”, enables CORS handling for the Ingress. For agentgateway, this maps toAgentgatewayPolicy.spec.traffic.cors.nginx.ingress.kubernetes.io/cors-allow-origin: Comma-separated list of origins (e.g. “https://example.com, https://another.com”). For agentgateway, this maps toAgentgatewayPolicy.spec.traffic.cors.allowOrigins.nginx.ingress.kubernetes.io/cors-allow-credentials: Controls whether credentials are allowed in cross-origin requests (“true” / “false”). For agentgateway, this maps toAgentgatewayPolicy.spec.traffic.cors.allowCredentials.nginx.ingress.kubernetes.io/cors-allow-headers: A comma-separated list of allowed request headers. For agentgateway, this maps toAgentgatewayPolicy.spec.traffic.cors.allowHeaders.nginx.ingress.kubernetes.io/cors-expose-headers: A comma-separated list of HTTP response headers that can be exposed to client-side scripts in response to a cross-origin request. For agentgateway, this maps toAgentgatewayPolicy.spec.traffic.cors.exposeHeaders.nginx.ingress.kubernetes.io/cors-allow-methods: A comma-separated list of allowed HTTP methods (e.g. “GET, POST, OPTIONS”). For agentgateway, this maps toAgentgatewayPolicy.spec.traffic.cors.allowMethods.nginx.ingress.kubernetes.io/cors-max-age: Controls how long preflight responses may be cached (in seconds). For the agentgateway implementation, this maps toAgentgatewayPolicy.spec.traffic.cors.maxAge.
Rate Limiting
nginx.ingress.kubernetes.io/limit-rps: Requests per second limit. For agentgateway, this maps toAgentgatewayPolicy.spec.traffic.rateLimit.local(requests, unit: Seconds).nginx.ingress.kubernetes.io/limit-rpm: Requests per minute limit. For agentgateway, this maps toAgentgatewayPolicy.spec.traffic.rateLimit.local(requests, unit: Minutes).nginx.ingress.kubernetes.io/limit-burst-multiplier: Burst multiplier for rate limiting. For agentgateway, this maps toburstin the samerateLimit.localentry.
Timeouts
nginx.ingress.kubernetes.io/proxy-send-timeout: Controls the request timeout. For agentgateway, this maps toAgentgatewayPolicy.spec.traffic.timeouts.request.nginx.ingress.kubernetes.io/proxy-read-timeout: Controls stream idle timeout. For agentgateway, this maps toAgentgatewayPolicy.spec.traffic.timeouts.request. If both are set, the emitter uses the larger value.
External Auth
nginx.ingress.kubernetes.io/auth-url: Specifies the URL of an external authentication service. For agentgateway, this maps toAgentgatewayPolicy.spec.traffic.extAuth(backendRef from URL host; only in-cluster*.svcURLs are supported).nginx.ingress.kubernetes.io/auth-response-headers: Comma-separated list of headers to pass to backend once authentication request completes. For agentgateway, this maps toAgentgatewayPolicy.spec.traffic.extAuth.http.allowedResponseHeaders.
Basic Auth
nginx.ingress.kubernetes.io/auth-type: Must be set to"basic"to enable basic authentication. For agentgateway, this maps toAgentgatewayPolicy.spec.traffic.basicAuthentication.nginx.ingress.kubernetes.io/auth-secret: Specifies the secret containing basic auth credentials innamespace/nameformat (or justnameif in the same namespace). For agentgateway, this maps toAgentgatewayPolicy.spec.traffic.basicAuthentication.secretRef.name. Agentgateway expects the Secret key.htaccess(ingress-nginx often usesauth); the emitter may emit an INFO notification about this.nginx.ingress.kubernetes.io/auth-secret-type: Only"auth-file"is supported (default). The secret must contain an htpasswd file in the key"auth". Only SHA hashed passwords are supported. For agentgateway, the emitter projects only the secretRef form; agentgateway expects key.htaccess.
Backend Protocol
nginx.ingress.kubernetes.io/backend-protocol: Indicates the L7 protocol that is used to communicate with the proxied backend.- Supported values (mapped):
GRPC,GRPCS— the emitter creates a backend-scoped AgentgatewayPolicy withspec.backend.http.version: HTTP2. It targets the Service, or the generated AgentgatewayBackend whenservice-upstream: "true"is also set. - Generated routes remain HTTPRoutes. The HTTP version policy does not configure backend TLS; the TLS requirements below also apply to GRPCS.
HTTPSandGRPCSalso enable backend TLS processing for theproxy-ssl-*annotations.HTTPandAUTO_HTTPuse default HTTP/1.x behavior.- Unsupported values (rejected):
FCGI(and others)
- Supported values (mapped):
Backend (Upstream) Configuration
nginx.ingress.kubernetes.io/proxy-connect-timeout: Controls the upstream connection timeout. For agentgateway, this maps toAgentgatewayPolicy.spec.backend.tcp.connectTimeout(per-Service policy targeting the backend Service).nginx.ingress.kubernetes.io/load-balance: Sets the algorithm to use for load balancing. The only supported value isround_robin. Note: The agentgateway emitter does not currently project this to AgentgatewayPolicy.
Note: For agentgateway, if multiple Ingress resources reference the same Service with different proxy-connect-timeout values, ingress2gateway emits warnings; the emitter produces one AgentgatewayPolicy per Service and conflicting values may result in warnings.
Service Upstream
nginx.ingress.kubernetes.io/service-upstream: "true": Creates an AgentgatewayBackend named<service>-service-upstreamwithspec.static.hostandspec.static.portderived from the Service. Matching HTTPRoute backend references are rewritten to target it. The host uses in-cluster Service DNS instead of individual Pod addresses.
Access Logging
nginx.ingress.kubernetes.io/enable-access-log: When explicitly set, the emitter writesAgentgatewayPolicy.spec.frontend.accessLogon an HTTPRoute target. A value of"true"emits an emptyaccessLogobject. A value of"false"setsfilter: "false". When the annotation is absent, no access log policy is emitted. Apply fails with the same Gateway-target error as body size. Use the same workaround: retarget the policy to the generated Gateway.
TLS Passthrough
nginx.ingress.kubernetes.io/ssl-passthrough: "true": Converts the affected HTTPRoute to a TLSRoute (apiVersion: gateway.networking.k8s.io/v1alpha2) and configures a Gateway listener withprotocol: TLSandtls.mode: Passthrough. The backend must terminate TLS. HTTP path matching and HTTP policies do not apply to passthrough traffic. Clusters that serve TLSRoutev1and notv1alpha2reject the resource:no matches for kind "TLSRoute" in version "gateway.networking.k8s.io/v1alpha2". If apply fails with that error, change the TLSRouteapiVersiontogateway.networking.k8s.io/v1. Leave the other fields as generated. A server-side dry run accepts that change.
Backend TLS
Set nginx.ingress.kubernetes.io/backend-protocol to HTTPS or GRPCS to enable backend TLS processing.
nginx.ingress.kubernetes.io/proxy-ssl-secret: Specifies a Secret containing client certificate (tls.crt), client key (tls.key), and optionally CA certificate (ca.crt) in PEM format. The secret name can be specified assecretName(same namespace) ornamespace/secretName. For agentgateway, this maps toAgentgatewayPolicy.spec.backend.tls.mtlsCertificateRef[0].name(emitter uses only the name; Secret must be in the same namespace as the policy).nginx.ingress.kubernetes.io/proxy-ssl-verify: Enables or disables verification of the proxied HTTPS server certificate. Values:"on"or"off"(default:"off"). For agentgateway,"off"maps toAgentgatewayPolicy.spec.backend.tls.insecureSkipVerify: All; when verification is on, the emitter does not setinsecureSkipVerifyand configures mTLS viamtlsCertificateRefwhen a secret is provided.nginx.ingress.kubernetes.io/proxy-ssl-name: Overrides the server name used to verify the certificate of the proxied HTTPS server. This value is also passed through SNI. For agentgateway, this maps toAgentgatewayPolicy.spec.backend.tls.sni.nginx.ingress.kubernetes.io/proxy-ssl-server-name: When set to"on", enables SNI; the SNI value still comes fromproxy-ssl-name. For agentgateway, the emitter projects SNI viaproxy-ssl-name.
Note: For agentgateway, backend TLS is emitted as one AgentgatewayPolicy per backend Service (name <service-name>-backend-tls), targeting the Service via spec.targetRefs. The emitter also emits a Gateway API BackendTLSPolicy with the same name. Its validation.caCertificateRefs entry is a ConfigMap with the same name as the secret. The command prints a warning that the BackendTLSPolicy cannot configure mTLS and only verifies the server CA. It also prints a notice that you must create that ConfigMap with the CA certificate under the key ca.crt. Creating the ConfigMap enables that server CA verification. It does not enable mTLS. If proxy-ssl-secret is given as namespace/name, the emitter uses only name (Secret must be in the same namespace as the policy). Conflicting settings for the same Service may result in warnings.
Session Affinity
nginx.ingress.kubernetes.io/affinity: Enables and sets the affinity type in all Upstreams of an Ingress. The only affinity type available for NGINX is “cookie”. Note: The agentgateway emitter does not support session affinity. It does not emit AgentgatewayPolicy or equivalent for cookie affinity. Other emitters (e.g. kgateway) may map this to BackendConfigPolicy/ringHash.nginx.ingress.kubernetes.io/session-cookie-name,session-cookie-path,session-cookie-domain,session-cookie-samesite,session-cookie-expires,session-cookie-max-age,session-cookie-secure: Define cookie attributes for session affinity. Not projected by the agentgateway emitter.
SSL Redirect
nginx.ingress.kubernetes.io/ssl-redirect: When set to"true"with TLS configured for the host, the provider generates an HTTP redirect route (RequestRedirect filter, 308 to HTTPS, no backends) and a separate HTTPS backend route.nginx.ingress.kubernetes.io/force-ssl-redirect: When set to"true", enables SSL redirect. Treated identically tossl-redirectby the agentgateway emitter.
Note: Both annotations are supported and treated identically. With the agentgateway emitter, SSL redirect is implemented using Gateway API only (no AgentgatewayPolicy).
Regex Path Matching and Rewrites
nginx.ingress.kubernetes.io/use-regex: When set to"true", indicates that the paths defined on that Ingress should be treated as regular expressions. Uses host-group semantics: if any Ingress contributing rules for a given host hasuse-regex: "true", regex-style path matching is enforced on all paths for that host (across all contributing Ingresses).nginx.ingress.kubernetes.io/rewrite-target: Rewrites the request path using regex rewrite semantics. Uses host-group semantics: if any Ingress contributing rules for a given host setsrewrite-target, regex-style path matching is enforced on all paths for that host (across all contributing Ingresses), consistent with ingress-nginx behavior.
For agentgateway:
- Regex path matching is not currently implemented for agentgateway output (emitter limitation).
rewrite-targetis projected intoAgentgatewayPolicy.spec.traffic.transformation.request.set(HTTP pseudo-header:path), using CEL for literal or regexReplace-style rewrites. The policy is attached viatargetRefsto the HTTPRoute (full coverage only; partial coverage causes an error).
Provider Limitations
- For this documentation, the agentgateway emitter is the supported target; session affinity and regex path matching are not supported by the agentgateway emitter.
- Some NGINX behaviors cannot be reproduced exactly due to differences between NGINX and semantics of other proxy implementations.
- Regex-mode is implemented by converting HTTPRoute path matches to
RegularExpression. Some ingress-nginx details (such as case-insensitive~*behavior) might not be reproduced exactly depending on the underlying Gateway API / Envoy behavior and the patterns provided.
If you rely on annotations not listed above, please open an issue or be prepared to apply post-migration manual adjustments.