Skip to content

Gateway API: NotAllowedByListeners – route may not attach to the listener

Networkingtested on Envoy Gateway auf kind, Gateway API Standard-Channel

Accepted=False with NotAllowedByListeners means: the listener does not admit routes from this namespace. Usually that is intended – allowedRoutes separates the tenants.

Symptom

kubectl apply -f rogue.yaml
httproute.gateway.networking.k8s.io/kapern created

A foreign team attaches a route to the listener https-shop, which only admits namespaces labeled gw-lab/team=shop.

Diagnosis

Read the route conditions.

conds.sh httproute kapern rogue
parent infra/web/https-shop:
  Accepted=False (NotAllowedByListeners): No listeners included by this parent ref
allowed this attachment.
  ResolvedRefs=False (BackendNotFound): Failed to process route rule 0 backendRef 0:
service rogue/irgendwas not found.

Causes

allowedRoutesNamespace not permitted

The listener only admits namespaces whose label matches the selector in allowedRoutes. No label, no access.

kindsWrong route kind

If allowedRoutes.kinds restricts the kinds (for example only HTTPRoute), another route kind on the same listener is rejected as well.

BackendNotFoundSecond error in the same route

The route also names a service that does not exist. Read each condition separately.

Fix

If intended: do nothing, the separation works. If the team should be admitted, the platform team sets the namespace label – RBAC keeps the team itself from doing so.
kubectl apply -f ~/gw-lab/code/tag07/gateway-mandanten.yaml
gateway.gateway.networking.k8s.io/web configured

Don't: Setting allowedRoutes to from: All so that "it works" – then any team can hijack other teams' hostnames.

▶
Break it yourself and find it – free
Gateway API hands-on, Day 7: tenants with allowedRoutes, ReferenceGrants for backends and certificates, ListenerSets.
Go to day 7 →

FAQ

Who may set the namespace label?

Only someone allowed to patch namespaces – the platform team. Protect labels such as gw-lab/team with a policy as well (Kyverno, ValidatingAdmissionPolicy).

How is NoMatchingParent different?

NoMatchingParent means the route's sectionName matches no listener. NotAllowedByListeners means the listener exists but does not admit the route.

Related error patterns

More