Skip to main content
Networking & service meshLesson 3 of 11

How a Gateway API HTTPRoute Reaches a Pod

Follow one request through the Gateway API: GatewayClass → Gateway → HTTPRoute → Service → Pod. Watch how the route attaches to a listener, and read what status.parents says when it does not.

Requestshop.example.com/
Accepted—
ResolvedRefs—
Backends—
Kubernetes clusterClientHTTPS requestHTTPRouteApp dev · ns shopGatewayOperator · listenersGatewayClassInfra providerService storens shopstore-v2ns backendReferenceGrantns backendPodstorePodstore-v2HTTPS
RequestWatchAppears in a later step

What you will learn

  • Three resources, three owners: GatewayClass, Gateway, HTTPRoute
  • Listeners and allowedRoutes decide which routes may attach
  • parentRefs, hostnames, rules and backendRefs in an HTTPRoute
  • Why a route fails to attach and how Accepted=False says so
  • Cross-namespace backends need a ReferenceGrant

Reading status.parents​

Each entry in an HTTPRoute's status.parents matches one parentRef and holds the conditions written by that Gateway's controller.

ConditionReasonMeaningFix
Accepted=TrueAcceptedThe Gateway took the route—
Accepted=FalseNotAllowedByListenersNo listener's allowedRoutes permits this route (namespace or kind)Change the listener's allowedRoutes, or label the route's namespace to match its selector
Accepted=FalseNoMatchingListenerHostnameNo listener hostname matches the route's hostnamesAlign the route hostnames with the listener hostname (for example *.example.com)
Accepted=FalseNoMatchingParentsectionName or port in the parentRef matches no listenerFix the parentRef to name an existing listener
Accepted=UnknownPendingThe controller has not reconciled the route yetCheck that the GatewayClass is Accepted and the controller is running
ResolvedRefs=TrueResolvedRefsAll backendRefs could be resolved—
ResolvedRefs=FalseRefNotPermittedA backendRef points to another namespace with no ReferenceGrantCreate a ReferenceGrant in the target namespace
ResolvedRefs=FalseBackendNotFoundThe referenced Service does not existFix the name, namespace or port, or create the Service
ResolvedRefs=FalseInvalidKindThe backendRef group or kind is unknown or unsupportedPoint to a Service, or a kind the implementation supports

If status.parents is empty, no controller has handled the route at all. Check the parentRef name and namespace, and the GatewayClass.

Try it yourself​

kubectl get gatewayclass # CONTROLLER and ACCEPTED
kubectl get gateway -A # CLASS, ADDRESS, PROGRAMMED
kubectl describe gateway infra-gw -n infra # Listeners, allowedRoutes, attachedRoutes
kubectl get httproute -A # HOSTNAMES per route
kubectl get httproute store -n shop \
-o jsonpath='{range .status.parents[*].conditions[*]}{.type}={.status} {.reason}{"\n"}{end}' # Accepted / ResolvedRefs
kubectl get referencegrant -A # Who allows cross-namespace refs

Check yourself

  1. kubectl apply of an HTTPRoute succeeds, but status.parents shows Accepted=False with reason NotAllowedByListeners. What is the fix?
  2. A route is Accepted, but ResolvedRefs=False with reason RefNotPermitted, and part of the traffic gets HTTP 500. What is missing?
  3. backendRefs list store with weight 90 and store-v2 with weight 10. How is traffic split?

Further reading: Gateway API docs · HTTPRoute · ReferenceGrant · Gateway API on kubernetes.io · Ingress Rules and TLS · Three Entry Points Compared