Skip to content

Reserve capacity while a console waits for authorisation - #31

Merged
phroggyy merged 4 commits into
masterfrom
cursor/console-pending-capacity-b115
Oct 14, 2026
Merged

phroggyy merged 4 commits into
masterfrom
cursor/console-pending-capacity-b115

Conversation

@phroggyy

@phroggyy phroggyy commented Oct 14, 2026 •

Copy link
Copy Markdown

While a console is waiting for authorisation, the controller creates a Job owned by the Console. The Job runs the console template's own image with sleep, so that image is pulled onto the node, and it requests the same CPU, memory and ephemeral storage as the console pod. It copies the template's node selector, tolerations and affinity.

The Job's active deadline is --pending-capacity-ttl (default 15 minutes). After that the pods stop, and the Job object is left in place so another is not started while the console is still waiting. The console's own TTL is unchanged. The Job is deleted, with background propagation, when the console's own Job is created, or when the console stops or expires. Deleting the Console still collects it through the owner reference.

The behaviour is off unless --pending-capacity is set. The priority class is --pending-capacity-priority-class, and it has to be one a normal pod can preempt. The Job does not use the console service account. Creating it uses the manager's existing permission to manage Jobs.

Testing

No new tests. The existing console suites are unchanged. make vet passes.

Please merge with a merge commit. Do not squash.

Open in Web Open in Cursor 

cursoragent and others added 2 commits October 14, 2026 14:00
While a console waits for approval, hold a low-priority pause pod that
asks for the same resources, node selector, tolerations and affinity as
the console pod. Delete it once the job exists, or when the console
stops or expires. Off unless --pending-capacity is set.

Co-authored-by: Leo Sjöberg <phroggyy@users.noreply.github.com>
The placeholder's lifetime is its own creation time plus --pending-capacity-ttl, default 15m. After that it is deleted and not created again while the console stays pending. The console's TTL is unchanged.

Co-authored-by: Leo Sjöberg <phroggyy@users.noreply.github.com>
@phroggyy
phroggyy marked this pull request as ready for review October 14, 2026 14:32
The dedicated package and the names it was the only caller of are gone. The existing console suites are unchanged.

Co-authored-by: Leo Sjöberg <phroggyy@users.noreply.github.com>

@andy-paine andy-paine left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think using a Job for this would be simpler like we do in core as that can look after the TTL for you and all you would need to do is delete the top level Job object when creating the Console one. We also pre-pull the image for our warm capacity in core to ensure that is warmed too

The placeholder is a Job owned by the console. It runs the template image
with sleep, and its active deadline is the limit. Delete that Job when the
console's own Job is created, or when the console stops or expires.

Co-authored-by: Leo Sjöberg <phroggyy@users.noreply.github.com>
@cursor cursor Bot changed the title Reserve a pause pod while a console waits for authorisation Reserve capacity while a console waits for authorisation Oct 14, 2026

@andy-paine andy-paine left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Niceeee 👌

@phroggyy
phroggyy merged commit 3a26558 into master Oct 14, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants