BNK
Two tenants, one factory
What keeps them apart, layer by layer
An AI factory rents the same GPUs, the same network and the same data plane to customers who must never see each other. Here there are two: tenant A, whose caller is an AI agent, and tenant B, whose caller is an app. They are kept apart five times over, at five different layers, because each layer only separates what it can see. An address range separates names. A routing table separates packets. A Gateway separates routes and policy. A pool separates GPUs, queues and cache. An egress address separates what the outside world sees. Follow one request from each tenant and watch where the lanes are drawn.
- Tenant a
- an AI agent · VRF tenant-a · VNI 10001
- Tenant b
- an app · VRF tenant-b · VNI 10002
- Shared
- the fabric, one TMM, the cluster
- Never shared
- routes, policy, GPU workers, queue, egress address
Read the whole lesson as text
1. A range each
Each tenant gets a Gateway, the Gateway API object that describes a way into the factory. A Gateway needs an address to be reached on, and nobody types one in. F5 IPAM holds a range for every tenant and hands out the next free address from the right one. Tenant A's Gateway gets 10.201.100.10. Tenant B's gets 10.202.100.10. From now on the address alone says whose service it is, and that makes every firewall rule and every route that follows easy to read.
- Tenant A's Gateway asks for an address and gets the next free one from tenant A's range.
- Tenant B's Gateway gets its address from a different range.
2. Tell the fabric, one tenant at a time
An address nobody knows the way to is useless. TMM announces each new address to the data center fabric with BGP. It does not use ordinary BGP routes, because an ordinary route has no idea of tenants. It uses EVPN, a BGP address family built for this. Each route TMM announces here carries two extra things: a route target, which says which tenant's routing table may import it, and a VNI in the route's label field, the number that will mark this tenant's packets on the wire. The leaf switch reads the route target and puts tenant A's address into tenant A's table only. In a lab run the address was reachable about ten seconds after the Gateway was ready.
- TMM tells the fabric how to reach tenant A's address, and tags the route as tenant A's.
- The same message for tenant B carries tenant B's tag and number.
- The leaf files each route into the one routing table whose tag matches.
3. The same address twice
Tenant A's agent and tenant B's app both have the address 10.1.0.20. Each opens a connection to its own factory address. On the wire between the leaf and TMM their packets would be impossible to tell apart by source, so the leaf doesn't send them as they are. It looks at the port a packet came in on, which belongs to exactly one VRF, and wraps the whole packet in a new one: outer addresses of the two tunnel endpoints, a UDP header, and eight bytes of VXLAN that carry the tenant's VNI. That number is the only thing in the frame that says whose packet this is.
- The agent opens a connection to tenant A's address in the factory.
- The leaf wraps the packet and stamps it with tenant A's number before it crosses the shared fabric.
- At the same moment tenant B's app, with the very same address, calls tenant B's service.
- Its packet crosses the same wires between the same two machines, with a different number on it.
4. One TMM, two routing tables
Both packets arrive at the same TMM. It takes the outer headers off and keeps the one thing they told it: the VNI. Each VNI is tied to one VRF, and a VRF is a complete routing table of its own. The agent's packet is looked up in tenant A's table, where the only listener is tenant A's Gateway. From there on it is an ordinary request: TLS ends at TMM with tenant A's certificate, tenant A's firewall policy and iRules run, and tenant A's HTTPRoute names the backend. Keys and budgets per tenant sit one layer up, in the AI gateway.
- TMM unwraps the packet and looks it up in the one table its number points to.
- With the connection up and encrypted, the agent sends the next turn of its loop.
- Tenant A's Gateway matches tenant A's route, which names tenant A's pool of GPU workers.
5. Own GPUs, own queue
Each tenant's route ends at an InferencePool of its own: its own GPU workers, picked by its own endpoint picker, with its own queue in front of them. Now the agent does what agents do. It splits its task into forty parts and sends them all at once. Pool A fills up. Its GPU memory is taken by KV cache and the rest of the calls wait in line. Tenant B's app sends one request in the middle of this and notices nothing, because none of what just filled up is shared. The queue is the thing to isolate. It is where one caller's load turns into another caller's wait.
- TMM asks tenant A's endpoint picker, which can only choose among tenant A's workers.
- The agent fires forty calls at once. Pool A's memory fills and the rest wait in its queue.
- Tenant B's request goes to tenant B's workers, where nobody is waiting.
6. No route across
Suppose the agent is told tenant B's address, by a careless config or by a prompt someone planted. It tries to connect. The packet reaches the leaf on tenant A's port and is looked up in tenant A's table. Tenant B's address was never imported there, so there is nothing to match. The leaf answers that the network is unreachable. No firewall rule fired and nobody had to remember to write one. Isolation by routing table fails closed: what was never connected stays unreachable.
- The agent tries to open a connection to tenant B's address.
- Tenant A's routing table has no entry for that address, so the leaf sends back an error and the packet goes nowhere.
7. The way out
Traffic also leaves the factory. A worker in pool A needs model files from storage that tenant A runs elsewhere, behind tenant A's firewall. Pod addresses change with every restart and mean nothing outside the cluster, so that firewall could never keep a list of them. Instead the Pod's traffic is sent out through TMM, in tenant A's VRF, and TMM rewrites the source to an address from tenant A's SNAT pool. Tenant A's security team allows exactly that one address. A Pod of tenant B that tried the same thing would arrive from tenant B's address and be dropped.
- A worker in pool A opens a connection to tenant A's storage outside the factory.
- TMM swaps the Pod's address for tenant A's egress address and sends the packet on.
- Tenant A's firewall finds the source on its short list and lets the connection in.
8. What a VRF does not split
It is tempting to stop at the network: give every tenant a VRF and call it isolation. A VRF separates packets. It knows nothing about what happens once two requests are inside the same GPU. If both tenants' routes pointed at one pool, their requests would sit in one queue and their prompts would be kept in one KV cache. A prompt that starts like one already cached gets its first token sooner, whoever sent the first one, and that speed can be measured from outside. So the rule is one layer per thing to separate, and none of them stands in for another.
- With one pool for both tenants, their prompts would share one queue and one KV cache, whatever the network says.
Summary
A tenant in an AI factory is a stack of separations, each made of ordinary Kubernetes objects. IPAM gives it an address range. BGP EVPN announces those addresses tagged for one routing table, and VXLAN carries the tenant's number on every packet, so two tenants can even use the same addresses. One TMM holds a VRF and a Gateway per tenant. Each Gateway routes to an InferencePool of its own, which is what keeps one tenant's flood out of another's queue and one tenant's prompts out of another's cache. On the way out, a SNAT pool gives each tenant one address the outside can trust. Leave any layer out and the others don't cover for it.
Next lesson: Which token comes next