This episode covers domain-based routing across namespaces, gateway scoping and namespace isolation patterns, and managing shared gateways used by many tenant teams.

A platform usually serves many teams, each with its own domains and applications. Episode 10 covers multi-tenant routing and namespace isolation: how a single gateway can serve many namespaces, how to constrain the gateway's scope, and patterns for managing shared gateways safely and cleanly.
The key concept in this episode is ReferenceGrant. Without this explicit permission, cross-namespace routing won't work — it's the built-in access control of the Gateway API that limits each team's reach.
The most common pattern: the gateway belongs to the platform team in the multigress-system namespace, while each tenant's applications live in their own namespaces. Routing stays one HTTPRoute per tenant:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: tenant-a-route
namespace: team-a
spec:
parentRefs:
- name: main-gateway
namespace: multigress-system
hostnames:
- "a.example.com"
rules:
- backendRefs:
- name: app-a
port: 8080The route in the team-a namespace points to a Gateway in another namespace. To be accepted, tenant A must provide a ReferenceGrant in its own namespace:
apiVersion: gateway.networking.k8s.io/v1
kind: ReferenceGrant
metadata:
name: allow-gateway
namespace: team-a
spec:
from:
- group: gateway.networking.k8s.io
kind: HTTPRoute
namespace: team-a
to:
- group: gateway.networking.k8s.io
kind: Gateway
name: main-gatewayNotice the direction of permission: the ReferenceGrant is created in the namespace that hosts the route, and declares that the route may point to a specific Gateway. This makes cross-namespace access an explicit grant, not just a convention.
Adding the next tenant is just duplicating the pattern above with a different namespace, domain, and service:
kubectl get httproute -A
kubectl get referencegrant -AThe kubectl get httproute -A command shows all cross-namespace routes. It's also a quick way to detect routes missing a ReferenceGrant — their status becomes RefNotPermitted.
Platforms want to limit which namespaces may bind to their gateway. This is configured on the Gateway via allowedRoutes:
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: main-gateway
namespace: multigress-system
spec:
gatewayClassName: multigress
listeners:
- name: http
protocol: HTTP
port: 80
allowedRoutes:
namespaces:
from: Selector
selector:
matchLabels:
tenant: "true"With from: Selector, only namespaces labeled tenant: true may create routes to this gateway. This is a powerful form of gateway scoping to prevent rogue namespaces from siphoning traffic.
Three common isolation patterns you can choose from:
staging and prod gateways, isolated per environment.Choose the pattern based on organization size and compliance requirements.
A shared gateway succeeds when there's an explicit agreement. Recommended practices:
hostname on the listener.tenant label to split metrics in Prometheus.apiVersion: gateway.multigress.io/v1
kind: BackendTrafficPolicy
metadata:
name: tenant-a-policy
namespace: team-a
spec:
targetRefs:
- group: gateway.networking.k8s.io
kind: HTTPRoute
name: tenant-a-route
rateLimit:
type: Global
rps: 50The policy above limits tenant A to 50 requests per second. Rate limiting is covered in depth in episode 14.
The most common conflict is two tenants registering the same hostname. Detect it by checking whether a hostname is already in use:
kubectl get httproute -A -o jsonpath="{range .items[*]}{.metadata.namespace}{'/'}{.metadata.name}{' => '}{.spec.hostnames}{'\n'}{end}"The kubectl get httproute -A -o jsonpath=... command lists the hostnames per route. If two routes use the same hostname, traffic will be split nondeterministically — a sign that domain allocation needs to be tightened.
Warning
The Gateway API does not prevent hostname duplication between routes. A review process and labels are needed to guarantee domain allocation per tenant. Automating this validation is covered in episode 19.
Episode 10 equipped you with a multi-tenant structure: cross-namespace routing with ReferenceGrant, scope limits via allowedRoutes and labels, and a clear operating model for shared gateways between teams.
The key takeaways:
allowedRoutes on the listener limits which namespaces may bind.In the next episode 11 we'll discuss configuration management & GitOps — storing Multigress manifests in Git, validating configuration changes, applying safe rollout patterns, and managing overlays across environments. Your multi-tenant structure will become the basis of a real GitOps repo.