Kubernetes Gateway API (Next-Gen Replacement for Ingress: GatewayClass, Gateway, HTTPRoute)
Model north-south traffic with GatewayClass, Gateway, and HTTPRoute resources.
In plain words
Gateway API is a data-center badge system: infrastructure owns doors, routing teams own floor directions, and a listener decides whose badge may enter. The simple Kubernetes rule is: Gateway API separates infrastructure in GatewayClass and Gateway listeners from application routing in HTTPRoute, with policy attachment and cross-namespace grants.
Think of it like…
Gateway API is a data-center badge system: infrastructure owns doors, routing teams own floor directions, and a listener decides whose badge may enter.
Where you’ve seen it
During a connectivity incident, the network owner runs kubectl get gatewayclass,gateway,httproute -A; kubectl describe httproute checkout. Expected evidence: Gateway API separates infrastructure in GatewayClass and Gateway listeners from application routing in HTTPRoute, with policy attachment and cross-namespace grants. If the run instead shows this symptom, stop and restore the last known state: Accepted and Programmed conditions differ from route readiness, and a listener's hostname, protocol, certificate reference, or allowedRoutes can reject an otherwise valid HTTPRoute.
Words you’ll hear
- Gateway API
- For this lesson, Gateway API is the controlling idea: Gateway API separates infrastructure in GatewayClass and Gateway listeners from application routing in HTTPRoute, with policy attachment and cross-namespace grants.
- HTTPRoute
- HTTPRoute is the checkpoint; run
kubectl get gatewayclass,gateway,httproute -A; kubectl describe httproute checkoutand inspect the owner chain. Accepted and Programmed conditions differ from route readiness, and a listener's hostname, protocol, certificate reference, or allowedRoutes can reject an otherwise valid HTTPRoute. - GatewayClass
- GatewayClass is the outcome to preserve; the cost is explicit: Role-oriented Gateway resources reduce annotation sprawl and improve portability, but controller conformance and attached-policy versions still vary.
- Verification evidence
- The evidence command is
kubectl get gatewayclass,gateway,httproute -A; kubectl describe httproute checkout. It connects the declaration to this behavior: Model north-south traffic with GatewayClass, Gateway, and HTTPRoute resources.
Visual diagram
Theory & deep dive
How Gateway API reaches the intended state
Model north-south traffic with GatewayClass, Gateway, and HTTPRoute resources. Gateway API separates infrastructure in GatewayClass and Gateway listeners from application routing in HTTPRoute, with policy attachment and cross-namespace grants.
The concrete checkpoint is kubectl get gatewayclass,gateway,httproute -A; kubectl describe httproute checkout; compare the Gateway API owner, HTTPRoute state, and GatewayClass outcome instead of treating YAML acceptance as proof.
Run kubectl get gatewayclass,gateway,httproute -A; kubectl describe httproute checkout after the change and correlate the result with Events and the owning object. Gateway API separates infrastructure in GatewayClass and Gateway listeners from application routing in HTTPRoute, with policy attachment and cross-namespace grants.
HTTPRoute: failure boundary and production cost
Accepted and Programmed conditions differ from route readiness, and a listener's hostname, protocol, certificate reference, or allowedRoutes can reject an otherwise valid HTTPRoute. The prerequisite contract is concrete: Gateway API separates infrastructure in GatewayClass and Gateway listeners from application routing in HTTPRoute, with policy attachment and cross-namespace grants.
Role-oriented Gateway resources reduce annotation sprawl and improve portability, but controller conformance and attached-policy versions still vary. A safe design limits blast radius, records the last good configuration, and uses kubectl get gatewayclass,gateway,httproute -A; kubectl describe httproute checkout as a deterministic rollback checkpoint.
Capture the current state with kubectl get gatewayclass,gateway,httproute -A; kubectl describe httproute checkout, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: Accepted and Programmed conditions differ from route readiness, and a listener's hostname, protocol, certificate reference, or allowedRoutes can reject an otherwise valid HTTPRoute.
How it works, step by step
Step 1 of 41. Define the reachability contract
Declare selectors, listeners, routes, or policy and keep endpoint readiness explicit: Gateway API separates infrastructure in GatewayClass and Gateway listeners from application routing in HTTPRoute, with policy attachment and cross-namespace grants.
- Goal
- Model north-south traffic with GatewayClass, Gateway, and HTTPRoute resources.
- Owner
- Gateway API
When to use it & trade-offs
What it is
Model north-south traffic with GatewayClass, Gateway, and HTTPRoute resources. Gateway API separates infrastructure in GatewayClass and Gateway listeners from application routing in HTTPRoute, with policy attachment and cross-namespace grants.
Why it matters: Accepted and Programmed conditions differ from route readiness, and a listener's hostname, protocol, certificate reference, or allowedRoutes can reject an otherwise valid HTTPRoute. The invariant at risk is specific: Gateway API separates infrastructure in GatewayClass and Gateway listeners from application routing in HTTPRoute, with policy attachment and cross-namespace grants. The quickest fact check before changing the design is kubectl get gatewayclass,gateway,httproute -A; kubectl describe httproute checkout.
When to reach for it
- Use Gateway API to enforce this invariant: Gateway API separates infrastructure in GatewayClass and Gateway listeners from application routing in HTTPRoute, with policy attachment and cross-namespace grants.
- Use HTTPRoute evidence from
kubectl get gatewayclass,gateway,httproute -A; kubectl describe httproute checkoutin reviews and incident timelines. Model north-south traffic with GatewayClass, Gateway, and HTTPRoute resources. - Choose the managed ingress or mesh route only when this cost is justified by governance or scale: Role-oriented Gateway resources reduce annotation sprawl and improve portability, but controller conformance and attached-policy versions still vary.
When to avoid or be careful
- Avoid assuming Gateway API is complete after YAML submission; the required behavior is concrete: Gateway API separates infrastructure in GatewayClass and Gateway listeners from application routing in HTTPRoute, with policy attachment and cross-namespace grants.
- Avoid treating the next symptom as random; check the owner and state with
kubectl get gatewayclass,gateway,httproute -A; kubectl describe httproute checkoutfirst: Accepted and Programmed conditions differ from route readiness, and a listener's hostname, protocol, certificate reference, or allowedRoutes can reject an otherwise valid HTTPRoute. - Avoid adopting a heavier platform wrapper before measuring its cost: Role-oriented Gateway resources reduce annotation sprawl and improve portability, but controller conformance and attached-policy versions still vary.
Native, manual, and managed paths for Gateway API
kubectl get gatewayclass,gateway,httproute -A; kubectl describe httproute checkout.Strengths: Gateway API separates infrastructure in GatewayClass and Gateway listeners from application routing in HTTPRoute, with policy attachment and cross-namespace grants.
Watch out: Role-oriented Gateway resources reduce annotation sprawl and improve portability, but controller conformance and attached-policy versions still vary. Recovery must also recognize this signal: Accepted and Programmed conditions differ from route readiness, and a listener's hostname, protocol, certificate reference, or allowedRoutes can reject an otherwise valid HTTPRoute.
kubectl get gatewayclass,gateway,httproute -A; kubectl describe httproute checkout; the expected invariant is: Gateway API separates infrastructure in GatewayClass and Gateway listeners from application routing in HTTPRoute, with policy attachment and cross-namespace grants.Strengths: kubectl get gatewayclass,gateway,httproute -A; kubectl describe httproute checkout gives immediate feedback without first building a platform layer.
Watch out: A manual change can hide drift, and unlike Gateway API, it does not make this symptom self-documenting: Accepted and Programmed conditions differ from route readiness, and a listener's hostname, protocol, certificate reference, or allowedRoutes can reject an otherwise valid HTTPRoute.
kubectl get gatewayclass,gateway,httproute -A; kubectl describe httproute checkout.Strengths: Platform controls can wrap this exact behavior in policy or dashboards: Gateway API separates infrastructure in GatewayClass and Gateway listeners from application routing in HTTPRoute, with policy attachment and cross-namespace grants.
Watch out: The added platform ownership buys value at this cost: Role-oriented Gateway resources reduce annotation sprawl and improve portability, but controller conformance and attached-policy versions still vary.
Interview signals & numbers to know
When this topic comes up
- Interview anchor: Gateway API separates infrastructure in GatewayClass and Gateway listeners from application routing in HTTPRoute, with policy attachment and cross-namespace grants.
- Trace Gateway API to GatewayClass through HTTPRoute; the invariant is: Gateway API separates infrastructure in GatewayClass and Gateway listeners from application routing in HTTPRoute, with policy attachment and cross-namespace grants.
- Recognize the symptom: Accepted and Programmed conditions differ from route readiness, and a listener's hostname, protocol, certificate reference, or allowedRoutes can reject an otherwise valid HTTPRoute.
- Justify the cost: Role-oriented Gateway resources reduce annotation sprawl and improve portability, but controller conformance and attached-policy versions still vary.
- Verify with kubectl get gatewayclass,gateway,httproute -A; kubectl describe httproute checkout instead of only inspecting YAML.
Benchmarks & rules of thumb
- 3
- core API roles: GatewayClass, Gateway, and Route
- 1
- listener can allow routes from one or multiple namespaces
- 2
- conditions to inspect: Accepted and Programmed
Common mistakes & follow-ups
Common interview mistakes
- Debugging only the child object misses the Gateway API owner contract: Gateway API separates infrastructure in GatewayClass and Gateway listeners from application routing in HTTPRoute, with policy attachment and cross-namespace grants.
- Ignoring this telltale condition leads to unrelated changes: Accepted and Programmed conditions differ from route readiness, and a listener's hostname, protocol, certificate reference, or allowedRoutes can reject an otherwise valid HTTPRoute.
- Repeating
kubectl get gatewayclass,gateway,httproute -A; kubectl describe httproute checkoutwithout an owner for remediation wastes retry cost. Role-oriented Gateway resources reduce annotation sprawl and improve portability, but controller conformance and attached-policy versions still vary.
Likely interviewer follow-ups
- How would API output and runtime evidence prove this behavior: Gateway API separates infrastructure in GatewayClass and Gateway listeners from application routing in HTTPRoute, with policy attachment and cross-namespace grants?
- Which owner object, logs, and Events would you inspect for this symptom-Accepted and Programmed conditions differ from route readiness, and a listener's hostname, protocol, certificate reference, or allowedRoutes can reject an otherwise valid HTTPRoute-?
- At what threshold would this cost become unacceptable: Role-oriented Gateway resources reduce annotation sprawl and improve portability, but controller conformance and attached-policy versions still vary?
kubectl get gatewayclass,gateway,httproute -A; kubectl describe httproute checkout, name the failure, then justify the cost. Invariant: Gateway API separates infrastructure in GatewayClass and Gateway listeners from application routing in HTTPRoute, with policy attachment and cross-namespace grants. Failure: Accepted and Programmed conditions differ from route readiness, and a listener's hostname, protocol, certificate reference, or allowedRoutes can reject an otherwise valid HTTPRoute. Cost: Role-oriented Gateway resources reduce annotation sprawl and improve portability, but controller conformance and attached-policy versions still vary.Knowledge check
Put it into practice
Practice related interview Q&A
Apply Kubernetes Gateway API (Next-Gen Replacement for Ingress: GatewayClass, Gateway, HTTPRoute) with generative AI interview Q&A and hands-on practice.