Istio Ingress Gateway API: Configure Kubernetes Gateway API, HTTPRoute, TLS and Traffic Splitting
An Istio ingress Gateway API migration can fail quietly: the YAML applies, the Gateway gets an address, and users still receive 404 responses. This guide builds Istio ingress Gateway API traffic step by step, proves each status condition, then migrates an existing Istio Gateway and VirtualService without guessing.
1. Istio ingress Gateway API: what changes from Istio Gateway and VirtualService
Istio ingress Gateway API configuration uses the standard Kubernetes Gateway API to expose services through Istio's gateway controller. Istio still supports its own traffic management API, but the project states that it supports the Kubernetes Gateway API and intends to make it the default API for traffic management in the future. For new ingress work, that direction matters. You are not only choosing YAML syntax; you are choosing the API your platform team will teach, review and debug for years.
The biggest mental shift is deployment ownership. In the Istio API, a Gateway configures an existing gateway Deployment and Service that you deployed separately. In Kubernetes Gateway API, a Gateway both configures and deploys a gateway. With Istio's automated deployment, each Gateway provisions a Service and Deployment named<gateway-name>-<gateway-class-name>, except for the waypoint class. That removes one common source of drift: the listener ports in the Gateway and the ports on a hand-maintained ingress Service no longer need to be kept in sync by memory.
The second shift is protocol separation. A VirtualService can carry HTTP, TCP and TLS routing in one resource. Kubernetes Gateway API splits that work into route kinds such as HTTPRoute, GRPCRoute, TCPRoute and TLSRoute. For ingress teams, the split is useful because HTTPRoute status, matches and backend references stay focused on HTTP behaviour. It also makes ownership clearer: the platform team owns the Gateway listener, while the application team owns the HTTPRoute that attaches to it.
The third shift is portability with limits. Kubernetes Gateway API gives you a vendor-neutral model for GatewayClass, Gateway and routes, but it does not cover every Istio feature. Retries, timeouts, fault injection, subset routing and some policy behaviour may still need Istio-specific resources or implementation-specific policy objects. A good Istio ingress Gateway API design keeps the portable routing core in Gateway API and isolates Istio-specific behaviour where reviewers can see it. If you are still deciding the broader model, read Ingress vs Gateway API vs Service Mesh before you migrate production traffic.
2. Kubernetes Gateway API architecture for Istio ingress
Kubernetes Gateway API separates ingress into three layers. The GatewayClass names the implementation. The Gateway defines listeners and infrastructure. The HTTPRoute defines application routing rules and attaches to a Gateway through parentRefs. That separation is the core of the API, and it is why a route can be valid YAML but still not receive traffic.
For Istio, the GatewayClass is normally named istio and is accepted by Istio's gateway controller. You usually do not create this class by hand for a standard Istio install; you verify that it exists and is Accepted. The Gateway then references gatewayClassName: istio. Each listener binds a port and protocol, optionally narrows hostnames, carries TLS settings for HTTPS, and states which routes may attach through allowedRoutes. The HTTPRoute points back to the Gateway with parentRefs, narrows traffic with hostnames, evaluates matches, and forwards to backend Services through backendRefs.
This model changes review boundaries. A platform engineer can approve a new HTTPS listener without reviewing every application path rule. An application engineer can change a canary weight without editing the shared Gateway. A security reviewer can inspect allowedRoutes and ReferenceGrant objects to see which namespaces may attach routes or reference secrets and Services across namespace boundaries. Those boundaries are not paperwork; they are the controls that prevent one team's route from silently claiming another team's hostname.
The data path is still Envoy. Istio's controller watches Gateway API resources, provisions or configures the gateway workload, and programs Envoy listeners, routes and clusters. When traffic fails, separate the layers: API acceptance, gateway programming, load balancer address assignment, DNS, TLS, route matching, backend endpoint health and mesh policy. The generic build order is covered in the Kubernetes Gateway API tutorial; this article focuses on the Istio-specific parts: automated provisioning, migration from Istio APIs, policy attachment and status troubleshooting.
3. Istio ingress Gateway API prerequisites: CRDs, GatewayClass and backend health
Istio ingress Gateway API setup starts before the first Gateway. The Gateway API CRDs do not come installed by default on most Kubernetes clusters, so check for them first. If the CRDs are missing, kubectl apply fails with no matches for kind Gateway. If the CRDs exist but no controller accepts the GatewayClass, YAML applies and nothing routes. Both failures are preventable with a five-minute preflight.
Run these checks before you write routes:
Install the Gateway API CRDs only if they are absent, using the version your Istio release supports. The Istio documentation example checked for this guide uses Gateway API CRD ref v1.6.1. Do not copy a CRD version blindly into production; align it with your Istio version and test the upgrade path in staging. Gateway API conformance and supported features are version-sensitive, and the GatewayClass status should be read as part of the platform contract.
Next, prove the backend without the gateway. Gateway API routes to Services; it does not repair a Service with no ready endpoints. From a temporary pod or an existing debug pod, curl the Service DNS name and port. If that fails, fix selectors, readiness probes, NetworkPolicy or application health first. The Kubernetes Service Has No Endpoints runbook covers that failure mode in depth. Skipping this check turns a simple endpoint problem into a gateway debugging session.
Finally, decide namespace ownership. Put shared Gateways in a platform namespace such as istio-ingress. Put HTTPRoutes in application namespaces. Label application namespaces that may attach to the shared Gateway, for example gateway-access=true. That label becomes the listener's allowedRoutes selector. It is a small control with large blast-radius value: a new namespace cannot attach routes to the public Gateway until the platform team labels it.
4. Istio ingress Gateway API: create the Gateway and first HTTPRoute
Istio ingress Gateway API traffic starts with a Gateway that uses gatewayClassName: istio. The example below creates an HTTP listener for *.example.com and allows routes only from namespaces labelled gateway-access=true. This is stricter than the simplest documentation example, and that is deliberate. A public Gateway that accepts routes from every namespace is easy to demo and hard to govern.
Apply the Gateway, then read status before creating routes:
You want the Gateway to be Accepted and Programmed, with an address in status. With automated deployment, Istio should create the generated Deployment and Service for the Gateway. If the Gateway is not Programmed, do not debug HTTPRoute rules yet. Read the condition reason and message. Common causes are a missing GatewayClass, a listener conflict, an unsupported TLS reference, or infrastructure that cannot assign an address.
Now attach an HTTPRoute from the application namespace. The route hostname must overlap the listener hostname. The parentRef namespace must name the Gateway namespace. Use sectionName when the route should attach to one listener rather than every compatible listener.
Check the route status immediately:
The route parent status should show Accepted and ResolvedRefs as true. If Accepted is false, the Gateway listener rejected the attachment. Read the reason before changing the path. Hostname mismatch, namespace selector mismatch and wrong sectionName are more common than Envoy faults. If ResolvedRefs is false, the route cannot resolve a backend or reference. Check the Service name, port, namespace and ReferenceGrant requirements.
Test with an explicit Host header before DNS is ready:
A 200 response proves the listener, route and backend path. A 404 usually means the request reached Envoy but no route matched the hostname and path. A 503 usually means the route matched but the backend cluster has no healthy endpoints or the mesh policy rejected the call. Keep those meanings separate; they point to different owners.
5. Kubernetes Gateway API HTTPS for Istio ingress: TLS termination and redirects
Kubernetes Gateway API HTTPS configuration belongs on the Gateway listener. For Istio ingress, terminate TLS at the gateway when the platform team owns certificates and the backend hop stays inside the cluster or mesh. Use TLS passthrough only when the backend must see the original TLS connection or when a non-HTTP TLS protocol requires SNI routing. Most public HTTP APIs should terminate at the Gateway and then use mesh policy for the east-west hop.
Add an HTTPS listener with a certificate secret in the Gateway namespace. Keeping the secret in the same namespace avoids a cross-namespace ReferenceGrant for the certificate. If the secret must live elsewhere, create the grant deliberately and review it as a security change.
Attach production routes to the HTTPS listener with sectionName: https. Then add an HTTP redirect route for the same hostname. Redirects should be explicit and tested; a catch-all redirect can hide health-check or ACME challenge paths if your certificate workflow depends on HTTP validation.
Certificate failures present as listener or route status problems before they present as browser errors. If the Gateway is not Programmed after adding HTTPS, check whether the secret exists, whether it contains a valid key pair, whether the hostname matches the certificate, and whether a ReferenceGrant is required. If certificates are issued by cert-manager, use the cert-manager troubleshooting guide to separate issuer, challenge and secret problems from gateway programming problems.
Do not treat TLS termination as the end of security design. The gateway terminates the client connection, but the request still enters the mesh. Use AuthorizationPolicy, PeerAuthentication and telemetry policy for the service-to-service hop. Gateway API decides how traffic enters; Istio policy decides what that traffic may do after entry.
6. Istio ingress Gateway API traffic splitting: canary weights and header routing
Istio ingress Gateway API traffic splitting is expressed with weighted backendRefs in an HTTPRoute rule. That gives application teams a typed canary control without a second VirtualService. Use weights for percentage rollouts, and use header matching for internal testers who need deterministic access to the canary.
Precedence matters. The header rule is more specific than the plain path rule, so requests with x-canary: true go to the canary Service. Other /api requests split 90/10. Keep canary Services separate when you need clean metrics and rollback. A single Service with mixed pod versions makes weight changes harder to reason about because endpoint selection and version selection collapse into one object.
Weights are not a release strategy by themselves. Pair them with dashboards for request rate, error rate, latency and saturation by backend Service. Change weights in small steps, and keep the old route version in Git so rollback is a revert, not an edit under pressure. If the canary needs retries, timeouts, circuit breaking or fault injection, check whether the behaviour belongs in Gateway API policy, Istio DestinationRule, or application configuration. Do not hide release-critical behaviour in an unreviewed EnvoyFilter.
Header routing also needs restraint. A public header that selects a canary is a test hook, not an authentication control. Use it for internal validation, then remove or protect it before broad release. If the header reaches production, document who may send it and what data the canary may access.
7. Kubernetes Gateway API migration from Istio Gateway and VirtualService
Kubernetes Gateway API migration from Istio APIs should be a parallel run, not a delete-and-replace. Keep the old Istio Gateway and VirtualService serving traffic while the new Gateway API resources prove status, TLS and route behaviour on a test hostname or a low-risk path. Cut over by DNS or by moving one hostname at a time. Rollback should mean returning traffic to the old path, not rebuilding it during an incident.
Map the resources before you write YAML:
| Istio API | Kubernetes Gateway API | Migration note |
|---|---|---|
| Gateway servers | Gateway listeners | Ports, protocols, hostnames and TLS move to listener fields. |
| Gateway selector | GatewayClass plus automated provisioning | The Gateway now deploys or links the gateway workload. |
| VirtualService hosts | HTTPRoute hostnames | Route hostnames must overlap listener hostnames. |
| VirtualService gateways | HTTPRoute parentRefs | The route points to the Gateway and optional listener section. |
| VirtualService http routes | HTTPRoute rules | Matches, rewrites, redirects and backendRefs become typed fields. |
| DestinationRule subsets | Separate Services or policy | Prefer separate Services for canary clarity. |
| AuthorizationPolicy targetRef | Gateway or Service policy attachment | Verify generated gateway labels and target references. |
The risky fields are the ones with no exact portable equivalent. VirtualService retries, timeouts, fault injection, CORS policy, mirror rules and subset routing may map differently depending on Istio version and Gateway API feature support. Inventory them before migration. For each field, decide whether it moves to Gateway API, stays in Istio policy, moves to the application, or is dropped because it was dead configuration. That decision list is the migration plan; the YAML is only its output.
Use a staged cutover:
- Create the new Gateway in
istio-ingresswith HTTP and HTTPS listeners. - Create HTTPRoutes for one hostname in the application namespace.
- Verify Accepted, Programmed and ResolvedRefs.
- Test with Host header and
curl --resolveagainst the new address. - Compare response headers, status codes, latency and logs with the old path.
- Move DNS or the load balancer weight for one hostname.
- Watch error budget burn for a defined window.
- Repeat hostname by hostname, keeping the old resources until the rollback window closes.
If you are migrating from Ingress NGINX rather than Istio APIs, use the Gateway API migration from Ingress NGINX guide for annotation translation. The Istio migration is different because the old model already has Gateway and VirtualService concepts; the work is mapping ownership and policy, not escaping annotations alone.
8. Istio ingress Gateway API production guardrails: namespaces, grants and scaling
Istio ingress Gateway API production design needs guardrails around attachment, references and gateway capacity. The API gives you the fields; your platform process must use them consistently.
Start with namespace attachment. Shared Gateways should use allowedRoutes selectors, not from: All, unless the cluster is single-tenant and the risk is accepted. Label namespaces deliberately. Review label changes like route changes, because adding gateway-access=true grants a namespace the ability to attach routes to a public listener.
Use ReferenceGrant for cross-namespace references. A Gateway may need a TLS secret in another namespace. An HTTPRoute may need a backend Service in another namespace. Those references should not work by accident. The grant lives in the target namespace and states which source kind and namespace may reference which target kind. Treat missing grants as a security signal, not as friction to bypass by moving secrets casually.
Scale the generated gateway like any other edge workload. With automated deployment, customise generated resources through the Gateway infrastructure field or parametersRef when you need annotations, labels, replicas, resources, HPA or PDB behaviour. Attach HPA and PDB resources to the generated Deployment and Service using the well-known gateway labels and names. Do not scale by editing generated objects directly; the controller owns them and will reconcile your change away.
Manual deployment remains available for advanced cases, but it reintroduces sync work. If you link a Gateway to an existing Service, keep ports aligned and add the gateway name label to gateway pods when policy attachment needs it. Most teams should prefer automated deployment for new Gateways and reserve manual deployment for shared ingress patterns that already have operational tooling.
Observability should name the route, not only the gateway. Dashboards need request rate, 4xx and 5xx rate, latency percentiles, TLS errors, upstream connection failures and saturation for the gateway pods. Logs should include hostname, route name where available, backend Service, response code and trace ID. During migration, compare old and new paths by hostname. A single aggregate gateway dashboard hides the one route that is failing.
9. Istio ingress Gateway API troubleshooting: read status before logs
Istio ingress Gateway API troubleshooting starts with status conditions. Logs explain what Envoy did; status explains what the controller accepted, programmed or rejected. Read GatewayClass, Gateway and HTTPRoute status in that order. Do not change path rules when the Gateway is not Programmed. Do not change TLS when the route is not Accepted. Do not blame DNS when the Gateway has no address.
Use this matrix during incidents:
| Symptom | First check | Likely cause | Fix |
|---|---|---|---|
| GatewayClass not Accepted | kubectl get gatewayclass istio -o yaml |
Istio controller not installed, wrong class name, unsupported parameters | Install or upgrade Istio, correct gatewayClassName, read condition message. |
| Gateway not Programmed | kubectl get gateway -n istio-ingress -o yaml |
Listener conflict, TLS secret problem, address assignment failure | Fix listener fields, secret reference, cloud or Service address path. |
| Gateway has no address | Gateway status addresses and generated Service | LoadBalancer pending, manual Service link wrong, cloud quota or subnet issue | Check Service events and cloud load balancer state. |
| HTTPRoute not Accepted | Route parent status | Hostname mismatch, allowedRoutes selector mismatch, wrong sectionName | Align hostnames, namespace labels and listener name. |
| ResolvedRefs false | Route status and backend Service | Wrong Service name or port, missing ReferenceGrant, unsupported filter | Correct backendRefs and grants; verify Service port. |
| 404 from Envoy | Host header, route hostnames, path match | Request reached gateway but no rule matched | Test with explicit Host header; check PathPrefix and precedence. |
| 503 from Envoy | Backend endpoints and mesh policy | No healthy endpoints, AuthorizationPolicy deny, upstream connection failure | Check endpoints, readiness, policy and Envoy upstream logs. |
| TLS handshake failure | Listener status, secret, certificate hostname | Wrong secret, expired cert, SNI mismatch, missing grant | Fix certificate and listener hostname; verify with openssl s_client. |
| Canary weight not shifting | HTTPRoute rule order and backend Services | Header rule shadows weight rule, weights on wrong rule, stale route status | Read route status, test header and non-header requests separately. |
Two commands settle many arguments:
If status is healthy and traffic still fails, move down the stack. Check DNS resolution, load balancer health, gateway pod readiness, backend endpoints, NetworkPolicy, mesh policy and application logs. DNS problems can imitate gateway problems when clients resolve to an old address; the Kubernetes DNS troubleshooting guide covers CoreDNS and ndots checks. NetworkPolicy can also block the gateway-to-backend hop after routing is correct; use the NetworkPolicy troubleshooting guide when endpoints exist but connections time out.
10. Kubernetes Gateway API vs Istio APIs: when to choose each
Kubernetes Gateway API should be the default for new Istio ingress when the required routing fits the standard model: hostnames, paths, headers, methods, query parameters, redirects, rewrites, weighted backends and TLS termination. It gives platform and application teams separate objects, clearer status and a migration path that is not tied to one vendor's ingress annotations.
Keep Istio APIs where they still carry behaviour that Gateway API does not express cleanly for your version. Examples include advanced traffic policy, some fault injection patterns, subset-based routing that cannot be split into Services yet, or policy attachment patterns your platform already operates safely. Keeping those resources is not failure. The failure mode is mixing models without a boundary, so nobody knows whether a route change belongs in HTTPRoute, VirtualService or DestinationRule.
Use Ingress only for existing simple routes that are stable and low risk. New public ingress should not start with annotation-heavy Ingress unless the platform has a specific reason. The comparison in Ingress vs Gateway API vs Service Mesh covers the decision at the architecture level. For mesh selection beyond ingress, compare data plane models in Istio Ambient vs Linkerd vs Cilium rather than treating ingress configuration as a mesh decision.
A practical rule: put entry routing in Gateway API, put service-to-service policy in Istio policy resources, and put release mechanics in your deployment system. When a requirement crosses those boundaries, write the exception down. Future engineers should be able to see why one route still uses a VirtualService while the rest of the edge uses HTTPRoute.
11. Istio ingress Gateway API checklist
Istio ingress Gateway API work is ready for production when these checks pass:
- Gateway API CRDs are installed at a version supported by the Istio release.
- GatewayClass
istioexists and is Accepted. - The Gateway is Accepted and Programmed, with an address assigned.
- Generated gateway Deployment and Service are healthy, scaled and covered by PDB/HPA where required.
- Listeners use explicit hostnames and allowedRoutes selectors.
- HTTPRoutes show Accepted and ResolvedRefs true for every parent.
- TLS secrets are valid, hostname-matched and referenced with grants where cross-namespace access is required.
- Backend Services have ready endpoints before route testing.
- Host-header tests pass before DNS cutover.
- Canary weights are tested with and without header routing.
- Dashboards split metrics by hostname, route and backend Service.
- Rollback keeps the old Istio Gateway/VirtualService path available until the migration window closes.
Frequently Asked Questions
What is Istio ingress Gateway API?
Istio ingress Gateway API is the use of Kubernetes Gateway API resources to configure Istio's ingress gateway. A GatewayClass named istio selects Istio's controller, a Gateway defines listeners, and HTTPRoutes attach to those listeners to route traffic to Services.
Does Istio support Kubernetes Gateway API for ingress?
Yes. Istio supports the Kubernetes Gateway API for exposing services outside the mesh and intends to make it the default API for traffic management in the future. You still need the Gateway API CRDs and an Istio installation whose gateway controller accepts the istio GatewayClass.
What is the difference between Istio Gateway and Kubernetes Gateway API Gateway?
An Istio Gateway configures an existing gateway Deployment and Service. A Kubernetes Gateway API Gateway both configures and deploys a gateway when used with Istio automated deployment. The Gateway API resource also carries listener status and allowedRoutes controls for route attachment.
Can I migrate VirtualService routes to HTTPRoute?
Yes, for common HTTP routing. Map VirtualService hosts to HTTPRoute hostnames, gateways to parentRefs, and HTTP route rules to HTTPRoute matches and backendRefs. Inventory retries, timeouts, fault injection, CORS and subset routing separately because those behaviours may need policy resources or separate Services.
Why is my HTTPRoute not Accepted by the Istio Gateway?
The most common causes are hostname mismatch, allowedRoutes namespace selector mismatch, wrong sectionName, or a parentRef pointing to the wrong Gateway namespace. Read the HTTPRoute parent status first; it usually names the rejection reason.
Should I use Gateway API or VirtualService for new Istio ingress?
Use Gateway API for new ingress when the routing fits HTTPRoute, GRPCRoute, TCPRoute or TLSRoute and the platform wants standard status and ownership boundaries. Keep VirtualService only for behaviour that your Istio version cannot express cleanly through Gateway API or policy resources.