Documentation/network/servicemesh/ingress-to-gateway/nginx-annotations-migration.rst
.. only:: not (epub or latex or html)
WARNING: You are looking at unreleased Cilium documentation.
Please use the official rendered version released here:
https://docs.cilium.io
.. _gs_ingress_to_gateway_nginx_annotations:
NGINX Ingress Annotations to Gateway API Migration
This page provides a practical migration guide for NGINX Ingress annotations when moving to Gateway API in Cilium environments.
This guide focuses on common annotation patterns and their closest Gateway API equivalents or alternatives.
Migration Triage Model ######################
Use this order when migrating annotations:
.. note::
When a mapping references a GEP or experimental API, verify feature support in both your installed Gateway API version and Cilium release. Entries marked Not yet supported have no Cilium implementation today and may be added in future releases.
Inventory Existing NGINX Annotations ####################################
Extract currently used annotations before conversion:
.. code-block:: bash
kubectl get ingress -A -o json \
| jq -r '.items[]
| [.metadata.namespace, .metadata.name,
((.metadata.annotations // {}) | to_entries[]
| select(.key | startswith("nginx.ingress.kubernetes.io/"))
| "\(.key)=\(.value)")] | @tsv'
Prioritize by frequency and production criticality (auth, redirect, timeout, TLS, and source restriction annotations first).
Common Direct Mappings ######################
.. list-table:: :header-rows: 1
canary-weightHTTPRoute.rules.backendRefs[].weightTraffic Splitting Guide <https://gateway-api.sigs.k8s.io/guides/traffic-splitting/>__canary-by-headerHTTPRoute.rules.matches.headersTraffic Splitting Guide <https://gateway-api.sigs.k8s.io/guides/traffic-splitting/>__backendRefs for canary.use-regexHTTPRouteMatch.path.type: RegularExpressionHTTP Routing Guide <https://gateway-api.sigs.k8s.io/guides/http-routing/>_rewrite-targetHTTPRoute.filters.type: URLRewriteRedirects and Rewrites Guide <https://gateway-api.sigs.k8s.io/guides/http-redirect-rewrite/>__force-ssl-redirectHTTPRoute.filters.type: RequestRedirectRedirects and Rewrites Guide <https://gateway-api.sigs.k8s.io/guides/http-redirect-rewrite/>__permanent-redirectHTTPRoute.filters.type: RequestRedirectRedirects and Rewrites Guide <https://gateway-api.sigs.k8s.io/guides/http-redirect-rewrite/>__proxy-read-timeoutHTTPRoute.rules.timeouts.backendRequestHTTP Timeouts Guide <https://gateway-api.sigs.k8s.io/guides/http-timeouts/>_request timeout semantics.proxy-next-upstream-triesHTTPRoute.rules.retry.attemptsGEP-1731 <https://gateway-api.sigs.k8s.io/geps/gep-1731/>__proxy-next-upstream* behavior set.kubernetes.io/ingress.classGateway.spec.gatewayClassNameGateway API Overview <https://gateway-api.sigs.k8s.io/docs/concepts/api-overview/>__kubernetes.io/ prefix, not nginx.ingress.kubernetes.io/; won't appear in the NGINX-scoped inventory above.server-aliasHTTPRoute.spec.hostnamesGateway API Overview <https://gateway-api.sigs.k8s.io/docs/concepts/api-overview/>__backend-protocolService.spec.ports[].appProtocolGEP-1911 <https://gateway-api.sigs.k8s.io/geps/gep-1911/>_gatewayAPI.enableAppProtocol)enable-corsHTTPRoute.filters.type: CORSGEP-1767 <https://gateway-api.sigs.k8s.io/geps/gep-1767/>_proxy-ssl-secretBackendTLSPolicy.spec.validation.caCertificateRefsBackendTLSPolicy <https://gateway-api.sigs.k8s.io/reference/api-types/policy/backendtlspolicy/>__proxy-ssl-verifyBackendTLSPolicy.spec.validationBackendTLSPolicy <https://gateway-api.sigs.k8s.io/reference/api-types/policy/backendtlspolicy/>__secure-backendsBackendTLSPolicyBackendTLSPolicy <https://gateway-api.sigs.k8s.io/reference/api-types/policy/backendtlspolicy/>__Complex Mappings and Extension-Dependent Cases ################################################
The following annotations do not have a direct Gateway API equivalent today. Migration depends on implementation-specific extensions or the graduation of upstream GEPs into the Gateway API standard. Unless noted otherwise, Cilium does not yet support these mappings.
.. list-table:: :header-rows: 1
upstream-hash-bykeep-alive, keepalive-*, upstream-keepalive-*auth-type, auth-urlExternalAuth-style HTTPRoute filter (experimental)GEP-1494 <https://gateway-api.sigs.k8s.io/geps/gep-1494/>_auth-tls-secret, auth-tls-verify-clientGEP-91 <https://gateway-api.sigs.k8s.io/geps/gep-91/>_proxy-next-upstream* annotationsGEP-1731 <https://gateway-api.sigs.k8s.io/geps/gep-1731/>__,
GEP-1742 <https://gateway-api.sigs.k8s.io/geps/gep-1742/>_tcp-services-configmapTCPRoute resources (experimental channel)TCPRoute <https://gateway-api.sigs.k8s.io/reference/api-spec/main/spec/#tcproute>_use-forwarded-headerswhitelist-source-rangeNo Equivalent or Not Planned ############################
These are common examples that do not have a 1:1 Gateway API migration target:
configuration-snippet, server-snippet, server-snippets (won't add)sendfile (won't add)proxy-store (no direct equivalent)proxy-buffering and related proxy buffer tuning annotationsworker-processes (N/A)For these cases, prefer one of:
Validation ##########
For every migrated annotation, validate:
Related Content ###############
gs_ingress-to-gatewaygs_gateway_http_migrationgs_gateway_tls_migrationgs_gateway_api