🤖 docs: keep the standalone session token in a Secret - #135
Merged
Merged
Conversation
"Option B: standalone" passed the Coder session token as a literal --coder-session-token argument, so the token sat in plain text in the Deployment spec. Store it in a Secret instead, expose it to the container as CODER_SESSION_TOKEN with valueFrom.secretKeyRef, and pass --coder-session-token=$(CODER_SESSION_TOKEN) so Kubernetes expands it when the container starts. The Deployment then holds only a reference to the Secret. No code change. Part of #127. _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_ Change-Id: Ie11d1fdc4501b6d7843bddc3648e2057bfd68142 Signed-off-by: Thomas Kosiewski <tk@coder.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
@codex security review |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #127.
What changed
docs/how-to/deploy-aggregated-apiserver.md, "Option B: standalone", passed the Coder session token as a literal--coder-session-token=...argument, so the token sat in plain text in the Deployment spec. The step now:kubectl -n coder-system create secret generic coder-k8s-session-token --from-file=token=./coder-session-token).CODER_SESSION_TOKENto the container from that Secret withvalueFrom.secretKeyRef.--coder-session-token=$(CODER_SESSION_TOKEN). Kubernetes expands the variable when it starts the container, so the Deployment holds only a reference to the Secret.Docs only; no code change. This is about where the token is stored. It does not change what the aggregated API server does with requests.
Validation
A fresh KIND cluster with a real Coder v2.37.2, following the edited doc commands (only the token file path and Coder URL were substituted):
Available, and both resource lists are served.--coder-session-token=$(CODER_SESSION_TOKEN), and the env var comes fromsecretKeyRef.The token was never shown on screen. Docs gates on this head:
make docs-check, markdownlint-cli2 0.18.1 and cspell 8.19.4 pass.Screen recording of the run. Its timing lags the terminal by about 2 s in places; the screenshots are the primary evidence.
live-kind-run.webm
Not covered
A missing Secret and "Option A" were not tested. The env
addoperation replaces any env vars already set on the container;deploy/deployment.yamlsets none.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:medium• Cost:$1731.02