Control plane
One GPU pool, many owners
Quota first, priority only for what is left over
GPUs are too expensive to leave idle, so one pool of them usually serves several owners. Here there are three. A customer who pays for a dedicated model endpoint. A public endpoint anyone can call. And batch jobs that can wait. All of them want more at peak time, and there are only eight GPUs. Kubernetes has a tool for this, Pod priority, and it gives the wrong answer: the most important workload can take everything. What you actually want has two parts. Each owner has a number of GPUs that are theirs no matter what. Anything beyond that is spare, and spare capacity goes to whoever matters most right now and can be taken back. This lesson runs both designs on the same pool.
- The pool
- 2 nodes × 4 GPUs · one GPU per Pod
- Owners
- a dedicated endpoint, a public endpoint, batch jobs
- Priority alone
- the top workload can take all eight
- What is wanted
- a guaranteed share, then priority for the rest
Read the whole lesson as text
1. Eight GPUs, three owners
Look at the two nodes. Each slot is one GPU with one Pod on it. The dedicated endpoint runs three replicas, the public endpoint runs three, and two batch jobs use what is left. Nothing is idle. The scheduler that placed them was told one thing about importance, through a PriorityClass on each Pod: dedicated first, public second, batch last. While demand is steady this looks like a perfectly good design.
- All eight GPUs are in use: three for the dedicated endpoint, three for the public one, two for batch.
2. Priority alone takes everything
The customer behind the dedicated endpoint gets a traffic spike and its autoscaler asks for eight replicas. With Pod priority as the only rule, the scheduler does what it was told. The new Pods outrank everything else, so it evicts batch, and then it evicts the public endpoint, all of it. One customer now holds the whole pool and a service that other people depend on is gone. Nobody decided that. Being less important than a customer when capacity is spare was read as being less important than that customer always.
- The dedicated endpoint scales from three replicas to eight, and five new Pods wait for a GPU.
- Priority is the only rule, so both batch jobs and all three public replicas are evicted to make room.
3. Give every owner a queue
Start again with a scheduler built for this. KAI Scheduler adds an object called a Queue, one per owner. A queue has a quota: the number of GPUs that owner is guaranteed. Add the quotas up and they should fit in the pool. Here that is three, three and none, six of eight. A queue also has a priority, and it means something narrower than before. It only decides who gets capacity beyond quota. A Pod joins a queue with one label, and asks for this scheduler by name. From now on every decision starts with the same question: is this owner within what it is owed.
- Three Queue objects are created, each with a guaranteed number of GPUs and a priority.
- Each Pod carries its queue as a label and asks for this scheduler by name.
4. Spare GPUs are lent out
The same pool, read the new way. The dedicated endpoint holds three GPUs and is owed three. The public endpoint holds three and is owed three. Batch is owed nothing and holds two. Those two are the spare capacity, lent to the only queue that asked. This is why a pool with quotas runs fuller than separate clusters would: capacity an owner is not using this minute does useful work for someone else. The loan has one condition, and batch accepted it by having no quota. It can be called in.
- Six GPUs are held by owners within their quota, and two are on loan to batch.
5. The spike, again
The dedicated endpoint spikes again and asks for eight replicas. It already holds its three, so the five new Pods are all above quota. Above quota, queues compete by priority, and this queue has the highest. So the scheduler looks for capacity it is allowed to take: GPUs held above quota by a queue of lower priority. There are exactly two, the batch jobs. They are evicted and two of the new Pods start. The other three stay pending, because every remaining GPU is held by a queue within its quota, and quota is not for sale at any priority. The public endpoint did not lose a single replica.
- Five new Pods arrive for a queue that already holds everything it is owed.
- The two batch Pods are evicted. They were above quota, in a queue of lower priority.
- Two of the new Pods are bound to the freed GPUs, and three stay pending.
6. Quota beats priority
Now run it the other way round. It is night, the public endpoint has scaled down to one replica, and the dedicated endpoint has grown into everything that was free. It holds seven GPUs, four of them above its quota. In the morning the public endpoint scales back to three. Its queue has a lower priority than the one holding those GPUs. It does not matter. The public queue is below its quota, and a queue below quota that asks for capacity gets it, from whoever is above theirs. Two of the customer's replicas are evicted. The talk points to one setting that softens this: a delay before the eviction, long enough for the cluster autoscaler to add a node, so that often nothing has to be evicted at all.
- The public endpoint scales from one replica to three, back up to its quota.
- Two replicas of the dedicated endpoint are evicted. They were above quota, and the public queue is owed those GPUs.
- The two public replicas are bound to the freed GPUs.
7. What a GPU scheduler can't see
This design gives each owner its GPUs. It knows nothing about what runs on them, and two gaps follow. First, eviction is about Pods, and a model server is in the middle of answers. Once a Pod is marked for removal no new request is sent to it, and it gets its grace period, 30 seconds unless changed. A long answer from an agent can outlast that. Second, a quota guarantees GPUs, not what you get out of them. How many requests those GPUs serve depends on where each request is sent, which is the endpoint picker's job. The better that works, the less often an owner has to go above quota at all. Capacity is decided here. Requests are decided in front of it.
- An evicted model server stops getting new requests and has its grace period to finish the ones in flight.
Summary
One GPU pool can serve several owners if two questions are kept apart. What is each owner guaranteed, and who gets what is left. Pod priority answers both with one number, so the most important workload can take everything. A queue per owner separates them. Its quota is a guarantee that no priority can touch, and capacity beyond quota is lent by priority and taken back when its owner asks. That keeps the pool full and keeps promises. It decides which Pods hold GPUs and nothing about the requests on them, so draining long answers and placing each request well are left to the layer in front.
Next lesson: Reconcile loops