Skip to content

🤖 feat: complete the workspace pool how-to (#153 PR 16b) - #463

Merged
ThomasK33 merged 8 commits into
mainfrom
pool-howto-complete
Nov 1, 2026
Merged

ThomasK33 merged 8 commits into
mainfrom
pool-howto-complete

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Summary

The workspace pool how-to is now the complete guide that plan row 16 of #153 asks for. It adds a section on autoscaling (kubectl scale, HPA, KEDA scale to zero, and GitOps with an autoscaler), a cleanup table with one row per case, security notes, a link to troubleshooting, and the #451 warning for kept Share workspaces. This is plan PR 16b, the last PR of #153. PR 16a (#453) added the GitOps health rules and the troubleshooting section.

Background

The how-to grew one PR at a time. Autoscaling had one paragraph inside "Create a pool", cleanup was four bullets, and threat notes were spread over several sections. Plan row 16 asks for autoscaling recipes, cost, cleanup behavior per case, and threat notes in one guide. #153 can close only when every item of the issue and every plan row is on main or is a tracked follow-up issue (checklist below).

Implementation

Most changes are in docs/how-to/workspace-pools.md. Steps 1 to 6 keep their headings, so existing links stay valid.

  1. Step 3 points to the new "Autoscale a pool" section. That section takes over the kubectl scale example and 🤖 tests: pool Kind phases P10 to P12: scale to 0, KEDA cron autoscaling, active-version rollout (#153 PR 15b) #452's autoscaler paragraph with its Kind result. It also explains:
    • an HPA example with an External metric and the target type AverageValue, and why a Value target fails on the pool's selector,
    • why HPA stops at 1, and why KEDA reaches 0 (cooldownPeriod is 300 s by default), with a cron ScaledObject like the one that the Kind test runs,
    • GitOps with an autoscaler: leave spec.replicas out of Git, or use Argo CD ignoreDifferences together with RespectIgnoreDifferences=true (without that option, Argo CD writes the field back at each sync).
  2. Step 6 gets the 🤖 CoderWorkspacePool Share mode: an idle-reaped workspace that the pool keeps stays shared without policy checks #451 warning: when idle reaping keeps a Share workspace, the workspace stays shared without policy checks. The admin removes the user from the workspace's sharing settings in Coder, which keeps the work.
  3. Cost says that maxWorkspaces counts per control plane (moved from the Share warning, because it holds for every mode), and links 🤖 perf: pool members read GET /api/v2/users/me on every workspace read, doubling the request budget #443.
  4. Cleanup is a table: deleting a claim, a pool, or the namespace, lowering replicas, changing inputs, losing consent, idle reaping, a used member, a renamed kwp- workspace, and deleting the control plane. It ends with the kwp- audit. The namespace row adds that the control plane in that namespace is deleted too, so members that have not deleted their workspaces yet release without a Coder call.
  5. Security notes collect the owner token, plain-text parameters, RBAC, status hygiene (🤖 CoderWorkspaceClaim Share mode: claim reasons reveal facts about named Coder users #449), Share trust, and operator token transport.
  6. A Troubleshooting section links to the section from 🤖 feat: GitOps health rules and troubleshooting for workspace pools (#153 PR 16a) #453.
  7. Step 4's idle reaping warning now says that last_used_at is best-effort (plan section 16, line 783(d)), and step 3 points to it for Used. Coder v2.37.3 drops a batch of last_used_at updates when its database write fails (coderd/workspacestats/tracker.go, flush clears the set before the write, every 60 s by default).
  8. The AgentLost row in troubleshooting.md now says that while Coder is unreachable, the member waits: a failed read keeps AgentNotReady and its 5 min, and AgentLost comes with the first successful read after the 5 min (behavior from 🤖 fix: bound a stored bind target, and keep AgentNotReady across failed reads (#153 plan section 16) #464, wording from its verifier).
  9. Four wording fixes from the independent verifier of 🤖 feat: GitOps health rules and troubleshooting for workspace pools (#153 PR 16a) #453 also change troubleshooting.md and gitops.md:
    • Coder creates API users as dormant only by default. One request with the owner's credentials counts as a use, for example a password login, or an API token request for a service account, which cannot log in. Step 1 of the how-to says the same.
    • The troubleshooting intro now promises the 60 s re-read of Coder only for a stalled pool. A ready pool with a pinned version does not poll.
    • Only a change of spec.replicas raises the generation.
    • The Argo CD rules filter each condition by generation, and the Flux rules check the Ready condition's generation.

#153 closure checklist

Issue items:

Plan rows (workspace-13.md section 11):

Row Scope PRs
1 Fake Coder routes #243
2 Refactor 1: shared owner and template lookups #250
3 Refactor 2: shared workspace steps #255
4 CoderWorkspacePool types #261
4b CoderControlPlane.spec.workspacePools #270
5 Member and claim types #278, #279
6 Member checks and create request #300, #301
7 Confirm, readiness, keep warm #322, #324
8 Bind extension, watch rules, delete #339, #343, #344
9 Pool resolve and creation under the caps #357, #359
10 Failure runs, owner cap, delete order #364, #379, #380
11 Claims #387, #388
12 Activation (with #430, #433, #435, #436, #438 before it) #441
13 Kind phases P6 to P8 and offline stubs #445
14 Share mode #446
15 Refresh and idle reaping, Kind phases P10 to P12 with KEDA #447, #452
16 Health rules and troubleshooting, then this how-to #453, this PR

Earlier plan section 16 entries that the #463 verifier found open:

Plan section 16 entry Status
Line 783(c): a failed Coder read must not reset the AgentLost timer of a member with AgentNotReady Fixed in #464 (merged 8296834)
Line 783(d): the docs must say that last_used_at is best-effort This PR: the idle reaping warning in step 4, and step 3 for Used
Line 777(c): the bound and used counts check the member's owner against the pool's resolved owner Tracked in #465
Line 785: bound the stored status.bindExtendDeadline to a fresh now + max(template default TTL, 30 min) before use (status.lastExtendTime no longer decides an extension) Fixed in #464 (merged 8296834)

Deferred items (plan section 16), one tracked issue each: #455 (per-user pools), #456 (owner token in a Secret), #457 (Prometheus metrics), #458 (retain for members), #459 (strategy: Prebuilds), #460 (claim wait timeout), #461 (dedicated provisioner recipe), #462 (shipped admission policy).

Open follow-ups from the stack: #443, #444, #448, #449, #450, #451, #454.

Validation

Risks

  • Docs only.
  • Kind does not run the HPA example. It follows the Kubernetes rules in plan sections 7.1 and 7.2, and Kind tests the HPA that KEDA makes.

Fixes #153


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: xhigh

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T06:26:32.491395Z 6e527b0 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ThomasK33

Copy link
Copy Markdown
Member Author

Dogfood for plan row 16: nix develop -c make docs-serve on head 9467893, then agent-browser screenshots of the new how-to sections.

Desktop (1440 px):

Autoscale a pool, desktop
Autoscalers and GitOps, desktop
Share mode warnings with the idle reaping warning (#451), desktop
Cleanup table, desktop
Security notes, desktop

Mobile (390 px). The cleanup table scrolls sideways, like the other tables on the site:

Autoscale a pool, mobile
Autoscalers and GitOps, mobile
Cleanup table, mobile
Security notes, mobile

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9467893451

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/how-to/workspace-pools.md Resolved
Comment thread docs/how-to/workspace-pools.md Resolved
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Both findings are fixed in fa794ec. The Autoscale section now says that the CRD refuses a /scale value above 100 (it does not cap it), and that HPA maxReplicas and ScaledObject maxReplicaCount must be 100 or less. The scale-down row now says that the pool keeps the new value plus one unclaimed workspace for each waiting claim. Claims are never deleted.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: fa794ecb0b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

New commit: step 4's idle reaping warning now says that last_used_at is best-effort. With Coder's workspace-usage experiment, connections without a session, such as a port-forward or another raw tunnel, do not move it, and a failed database flush drops a batch (Coder v2.37.3 coderd/workspacestats/reporter.go and tracker.go). Step 3 points to that warning for Used. The scale-down row now says "each waiting claim that can bind".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 4cbd2415f6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

… case, security notes, #451 warning (#153)

Change-Id: I619a68661ca0c9e768a780f963909e3a1af5d0b4
Signed-off-by: Thomas Kosiewski <tk@coder.com>
Change-Id: Ia92306597cb8a76928b2f01da4ceb55fa53915ef
Signed-off-by: Thomas Kosiewski <tk@coder.com>
…on (#153)

Change-Id: Ibc422eb3e3f495572d1c17c265b110f5ce259e6a
Signed-off-by: Thomas Kosiewski <tk@coder.com>
… status notes (#153)

Change-Id: I94d6734f86732c15b72c907b1c89de6a9177f019
Signed-off-by: Thomas Kosiewski <tk@coder.com>
…he workspaces of waiting claims (#153)

Change-Id: Id3286f5c37357055045a339aed0bf88514b0f83d
Signed-off-by: Thomas Kosiewski <tk@coder.com>
Change-Id: I003b16cd1e63aabf22fa728fcb5c4441387c0c2f
Signed-off-by: Thomas Kosiewski <tk@coder.com>
#153)

Change-Id: I22351fefbf75e89def0636b6351aafda7213817e
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33
ThomasK33 force-pushed the pool-howto-complete branch from 4cbd241 to 166ec59 Compare November 1, 2026 06:05
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Rebased on main 8296834 (#464). New commit 166ec59: the AgentLost row in troubleshooting.md now says that while Coder is unreachable, the member waits. A failed read keeps AgentNotReady and its 5 min (poolMemberKeepAgentNotReady from #464), and AgentLost comes with the first successful read after the 5 min, if the agent is still not ready.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 166ec5941c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…arning (#153)

Change-Id: I3ac51852d7576c994eeb066f9b3934c7cd1f4c62
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

New commit 6e527b0 removes a wrong claim from step 4's idle reaping warning. Coder v2.37.3's agent stats path calls ReportAgentStats(..., false) even under the workspace-usage experiment, so any nonzero ConnectionCount (a port-forward included) moves last_used_at. The warning now keeps only the confirmed case: a failed database flush drops a batch of updates.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 6e527b0c46

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ThomasK33
ThomasK33 added this pull request to the merge queue Nov 1, 2026
Merged via the queue into main with commit b539271 Nov 1, 2026
12 of 13 checks passed
@ThomasK33
ThomasK33 deleted the pool-howto-complete branch November 1, 2026 06:56
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.

CoderWorkspacePool: prebuilt workspaces with a scale subresource

1 participant