#0000 - Size workspace pods and put them in the platform-critical tier #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/resource-sizing-and-priority"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Adds resource requests, limits and
priorityClassName: platform-criticalto the workspace pods this template creates.Why critical
Coder is the emergency entry point into the cluster when there is no local machine and no VPN. A workspace you cannot start is as bad as no Coder at all, so the workspace pods share the server's tier rather than sitting below it. At anything lower they would be preempted before
app-standardworkloads like Mastodon, which is exactly backwards when you are trying to get back in.The resource wiring
requests.cpu750m(measured p95 over 14 days)requests.memorymemoryparameterrequests.ephemeral-storage8Gilimits.cpucpuparameterlimits.memorymemoryparameterlimits.ephemeral-storage32GiThree deliberate asymmetries, all commented in the file:
Memory is symmetric (request equals limit). The picker then means what it says: you asked for 8 GB, the workspace reserves 8 GB and is capped at 8 GB. It also gives the memory dimension Guaranteed-style treatment, which is what you want for the workspace someone is relying on to get back into the cluster. As a bonus it means every option in the picker is valid by construction, since a limit can never fall below the request.
CPU is asymmetric: a fixed
750mreservation with the user's pick as the ceiling. Workspaces idle, then compile. Reserving the full pick would strand cores cluster-wide for no benefit.A CPU limit at all is an exception to the no-CPU-limits rule used everywhere else in this exercise. That rule exists because throttling a stalled server makes it hold its memory longer. A ceiling the user chose themselves on a shared dev workspace is a different thing: it stops one workspace starving a node.
Ephemeral storage is fixed because there is no parameter for disk. The observed 5.4 MiB is meaningless (the workspace was idle when sampled); people clone repos and build in these, so it gets real headroom.
Parameters
Every original option is preserved. Only defaults changed.
The default moves from 2 GB to 8 GB because the measured p95 for a real workspace is about 6.7 GiB. A 2 GB default would OOMKill anyone doing actual work, and now that the value is also the reservation, it is worth defaulting to something that works.
Validation
terraform validatefrom thehashicorp/terraform:1.9container image (Terraform is not installed on this host, and nothing was installed system-wide), run on a copy so no.terraform/directory landed in the repo:The warnings are pre-existing and unrelated to these edits (deprecated
kubernetes_*resource names, andcoder_agent.dir). No new ones appeared.validatetype-checks against the provider schema, which is what confirmspriority_class_nameis a real attribute oftemplate.spec.terraform fmt -checkstill exits 3, exactly as it did on the pristine file before any of these edits, so this PR does not change that either way.Prerequisite
platform-criticalalready exists in the cluster (merged and applied viacore#2):Without it, workspace pods would be rejected at admission.
See
RESOURCE-SIZING-PLAN.mdat the workspace root for the full sequencing.🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.