feat: add Helm chart for standalone AI Gateway - #27256
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
4e23a5a to
d65696c
Compare
d65696c to
531f6b8
Compare
|
/coder-agents-review |
|
Chat: Review posted | View chat Review history
deep-review v0.9.0 | Round 4 | Last posted: Round 4, 32 findings (1 P2, 13 P3, 1 P4, 10 Nit, 7 Note), COMMENT. Review Finding inventoryFinding inventory - PR #27256Law analysisR1: Effective +2469 -7 (40 files), head 531f6b8. R2: Effective +3054 -7 (51 files, 1001 production / 2053 test), head 2f1347a. Verdict: Don't split (advisory), unchanged both rounds. Growth is schema + docs + golden fixtures within the single concern. Findings
Contested and acknowledgedCRF-9 (P3, templates/ingress.yaml:32) - listenerTLS + ingress plaintext-to-TLS backend
CRF-9 (P3, templates/ingress.yaml:32) - listenerTLS + ingress plaintext-to-TLS backend
CRF-18 (Note, templates/_aigateway.tpl:91) - metrics listener always-on
CRF-22 (Note, templates/_aigateway.tpl:130) - readiness probe coupled to coderd DRPC
CRF-1 (Nit, tests/chart_test.go:75) -
|
| Reviewer | Focus |
|---|---|
| Bisky | tests |
| Chopper | ops/errors |
| Churn-guard | change verification |
| Ging | language modernization |
| Gon | naming |
| Hisoka | edge cases |
| Killua | perf |
| Kite | change integrity |
| Knov | contracts |
| Knuckle | SQL |
| Komugi | flake/determinism |
| Kurapika | security |
| Law | decomposition |
| Leorio | docs |
| Luffy | product |
| Mafu-san | process |
| Mafuuu | contracts |
| Melody | dispatch/pairing |
| Meruem | structural |
| Nami | frontend |
| Netero | mechanical checks |
| Pariston | premise testing |
| Pen-botter | product gaps |
| Razor | verification |
| Robin | duplication |
| Ryosuke | Go arch |
| Takumi | concurrency |
| Zoro | shape |
🤖 Managed by Coder Agents.
There was a problem hiding this comment.
This is a well-built chart. It reuses the libcoder library the way the coder and provisioner charts do, keeps the imperative surface to a few template helpers, ships render-time validation with precise field-level error messages, and backs it with a deterministic golden-file suite (63% test density) that the panel ran green under -race and a GOMAXPROCS sweep. Bisky's take: "this test suite is lovely... These are real gems." No scope drift: every one of the 40 files belongs to the chart or its mechanical build/release wiring, which mirrors the existing chart entries line-for-line.
Severity count: 1 P2, 10 P3, 4 Nit, 6 Note. No P0/P1, so this is a COMMENT, not a block. The one finding to fix before shipping is the liveness/startup race (CRF-4): three reviewers independently traced that the process does not open its /healthz listener until it has connected to coderd and loaded providers, so on a fresh co-install or during a coderd outage the gateway crashloops. The rest cluster into contract-narrowing (CRF-5, CRF-6, CRF-7), operator-signal correctness (CRF-8, CRF-9, CRF-23), and convention drift (CRF-12, CRF-13).
Process notes, not inline findings:
- The commit subject / PR title misspells "helm" as "heml" (CRF-16). It squash-merges into
mainpermanently. Suggestfeat(helm/ai-gateway): add Helm chart for standalone AI Gateway. - The PR description claims the suite covers "all validation error cases," but 6 of the 13
failbranches have no test (this is CRF-2). Mafu-san flagged this as fake completeness: a reviewer trusting the description approves ~46% of the validation logic as tested when it is not. Either add the cases or scope the wording. - Netero's round-1
tc := tcnit was dropped: Komugi empirically proved the copy is load-bearing for the parallel multi-namespace subtests (deleting it failsdefault_valuesdeterministically). Do not remove it.
No findings against the build/release plumbing: the charts list drives the build/ai-gateway_helm_$(VERSION).tgz target before signing, and the attestation ./build/*_helm_*.tgz glob already covers the artifact.
🤖 This review was automatically generated with Coder Agents.
|
/coder-agents-review |
There was a problem hiding this comment.
Strong round-2 turnaround. Every one of the 19 round-1 findings the author marked fixed was independently verified against the tree, and the important ones were fixed at the root rather than patched at the symptom: the chart-owned env guard now derives its protected list from the rendered ownedEnv (no more hand-maintained duplicate), automountServiceAccountToken: false moved to the pod spec so it holds on the disableCreate path, extraTemplates delegates to libcoder's coder.renderTemplate again, and the HTTPRoute CRD guard is now actually testable via per-case apiVersions. Bisky: "this test suite is a genuine gem, and I do not say that often" - all 13 validation branches now have a verbatim-message test. TestRenderChart passes.
Contested CRF-9 (listenerTLS behind ingress/httproute): the panel agrees unanimously with the author that a hard validate reject would be wrong, because backend-TLS to the HTTPS listener is legitimate for controllers that re-originate TLS and the chart cannot know the controller's annotation dialect. Kurapika confirmed it fails closed, so there is no security exposure. Five reviewers accept the new README section as a sufficient ceiling. Two (Pariston, Leorio) re-raised a cheap residual: the docs teach the fix but never name the symptom (a 502 / TLS handshake error), and there is no install-time signal even though NOTES.txt already computes the exact condition. Kept open at P3 as a non-blocking doc/UX ask, not a request for validation. See the reply on that thread.
Severity count this round: 2 P3, 1 P4, 4 Nit (all new; no regressions of prior fixes). Two are follow-on consequences of round-1 fixes rather than the original issues re-opening (CRF-27 is the sibling of CRF-7; CRF-28 is guidance that can undo CRF-4).
Acknowledged as intentional by the author and accepted: CRF-18 (metrics listener always-on, matches sibling charts) and CRF-22 (readiness coupled to the coderd DRPC connection).
Process notes:
- The CI
titlecheck is red (✗ title). The current PR title parses clean against the conventional-commit validator, so this may be a stale run after the "heml" -> "Helm" rename, but reviewers could not read the failing run (no GitHub credentials in the worktree). Please confirm it is green before merge rather than assume the rename cleared it; a failing check is a bug until proven stale. - The branch commits still read
feat: add heml chart for standalone AI Gatewayandagentic review 1. The PR title is corrected, so a squash merge lands a clean subject and this is cosmetic, but if the branch is rebase- or merge-committed the "heml" typo reaches main history. Squash, or reword both subjects.
🤖 This review was automatically generated with Coder Agents.
2f1347a to
022bf63
Compare
|
/coder-agents-review |
There was a problem hiding this comment.
Round 3 review is blocked on one unaddressed finding, so the panel did not run this round.
The rest of the round looks good: seven findings from round 2 received targeted fixes and per-thread replies (CRF-27 env/envFrom guard wording, CRF-28 probe-comment rewrite, CRF-29 livenessProbe golden coverage, CRF-30 secret-ref naming, CRF-31 grace-period comment, CRF-32 README --namespace, CRF-34 probe-template dedup). Those are queued for panel verification and will be checked on the next round.
Blocking item, needs a response before the panel re-engages:
CRF-9 (P3, listenerTLS behind ingress/httproute). In round 2 the panel agreed with you that a hard validate reject is wrong and accepted the README section as the right layer. Two reviewers left a small, concrete residual open: the README teaches the correct backend-TLS config but never names the failure symptom, so an operator debugging a 502 has nothing to search for. The ask was one sentence, for example: "If the entry point is not configured for backend TLS, it speaks plaintext HTTP to the HTTPS listener and every request fails with a TLS handshake error, typically surfaced as an HTTP 502." An install-time NOTES.txt hint was suggested as optional. This round's commit touches README.md but neither README.md nor NOTES.txt contains "502" or "handshake," and there is no reply on the thread; it was resolved without a code change or response. A resolved thread with no fix and no explanation is not a resolution.
To unblock, do one of: add the symptom sentence to the README TLS section; file a tracking issue and link it here; or reply explaining why it should not be done. Any of the three clears the block.
Transparency on our side: the round-2 re-raise was posted as a reply that tried to reopen the thread, but our bot token lacks the permission to unresolve threads (the API rejected it), so the thread stayed marked resolved and the residual was easy to miss. That is on us. The finding itself still stands.
🤖 This review was automatically generated with Coder Agents.
|
/coder-agents-review |
41c0f78 to
e3686d1
Compare
There was a problem hiding this comment.
Round 4 is in good shape. All eight fixes from rounds 2-3 (the seven that round 3's blocked panel never got to verify, plus the round-4 CRF-9 doc sentence) were independently checked against the current tree and confirmed real, structural fixes rather than symptom patches: the env guard now derives its owned-set from the rendered ownedEnv and documents the envFrom gap honestly, the probe comments no longer misdirect, the three probe blocks are collapsed into one coder-ai-gateway.probe template with golden coverage, the secret-ref naming is uniform, and the grace-period coupling is documented on both sides. TestRenderChart passes and Komugi re-forced the parallel-namespace schedule with no flake. Hisoka: "The seams I expected to split held under load. A worthy opponent."
Four new findings this round, severity count 1 P3, 2 Nit, 1 Note. The P3 is a pre-existing correctness gap the panel reached this round, not a regression. The two Nits are the tail of the round-2 namespace-flag fix (the sweep fixed two commands and missed two) and a comment-wording risk. None are blocking; this stays a COMMENT.
Komugi withdrew the round-2 CRF-35 note (goldens hardcoding 0.1.0 matches Chart.yaml and the sibling charts; not a defect). CRF-18 and CRF-22 remain accepted as intentional by the author.
🤖 This review was automatically generated with Coder Agents.
8249272 to
27e7f4c
Compare
Documentation CheckThis PR adds a new The release/build wiring ( New Documentation Needed
Updates Needed
Automated review via Coder Agents |
| {{- define "coder-ai-gateway.ownedEnv" -}} | ||
| - name: CODER_AI_GATEWAY_HTTP_ADDRESS | ||
| value: 0.0.0.0:4001 | ||
| - name: CODER_AI_GATEWAY_KEY_FILE | ||
| value: /etc/coder/ai-gateway-auth/key | ||
| - name: CODER_URL | ||
| value: {{ include "coder-ai-gateway.coderURL" . | quote }} | ||
| - name: CODER_PROMETHEUS_ENABLE | ||
| value: "true" | ||
| - name: CODER_PROMETHEUS_ADDRESS | ||
| value: 0.0.0.0:2112 | ||
| {{- if .Values.aigateway.listenerTLS.name }} | ||
| - name: CODER_AI_GATEWAY_TLS_CERT_FILE | ||
| value: /etc/coder/ai-gateway-listener/tls.crt | ||
| - name: CODER_AI_GATEWAY_TLS_KEY_FILE | ||
| value: /etc/coder/ai-gateway-listener/tls.key | ||
| {{- end }} | ||
| {{- if .Values.aigateway.coderTLS.caSecret.name }} | ||
| - name: CODER_CLIENT_TLS_CA_FILE | ||
| value: /etc/coder/coder-client-ca/ca.crt | ||
| {{- end }} | ||
| {{- if .Values.aigateway.coderTLS.clientSecret.name }} | ||
| - name: CODER_CLIENT_TLS_CERT_FILE | ||
| value: /etc/coder/coder-client-tls/tls.crt | ||
| - name: CODER_CLIENT_TLS_KEY_FILE | ||
| value: /etc/coder/coder-client-tls/tls.key | ||
| {{- end }} | ||
| {{- end -}} |
There was a problem hiding this comment.
Why do we need to protect these environment variables like this? Is there absolutely no situation where a deployment administrator might want to override them in some way?
There was a problem hiding this comment.
Maybe my assumption is wrong but I though knobs provided by chart would be more convenient to use. Having 2nd source of truth I think would be worse so either knobs are removed or env vars need to be set.
Most of the knobs are boilerplate around K8s secrets or address / port synchronization between pod / service.
CODER_AI_GATEWAY_TLS_CERT_FILE, CODER_AI_GATEWAY_TLS_KEY_FILE, CODER_CLIENT_TLS_CA_FILE, CODER_CLIENT_TLS_CERT_FILE, CODER_CLIENT_TLS_KEY_FILE -> configurable though aigateway.{listenerTLS, caSecret, clientSecret} options.
It helps by keeping mounting paths of secrets + flag / env var values in sync.
Similar CODER_AI_GATEWAY_KEY_FILE is managed by aigateway.keySecret although maybe there could be a use for setting CODER_AI_GATEWAY_KEY directly as env var instead of mounting a secret. I think mounting a secret is better / good practice so I though it would be ok to force it this way?
CODER_AI_GATEWAY_HTTP_ADDRESS and CODER_PROMETHEUS_ADDRESS are blocked so ports between binary / pod / services are in sync. Those are not configurable.
CODER_PROMETHEUS_ENABLE -> always enabled, not configurable maybe should be?
CODER_URL -> configurable by aigateway.coderURL or aigateway.coderService, maybe overengineered a bit.
There was a problem hiding this comment.
I think mounting a secret is better / good practice so I though it would be ok to force it this way?
You're not wrong, but some orgs have different 'best practices'. A deployment admin might want to:
- Change the interface or port
- Change the paths of the various
_FILEs - Disable prometheus entirely
My recommendation would be to just stick to ensuring that either _KEY xor _KEY_FILE are set (not both), but allow the user to override the others. CODER_URL is also probably fine to manage directly.
27e7f4c to
9f4f825
Compare
9f4f825 to
fe8af0a
Compare
…te README to reflect changes
fe8af0a to
12ca765
Compare

Adds the
coder-ai-gatewayHelm chart for deploying the Coder AI Gateway as a standalone Kubernetes workload.The chart requires an existing key Secret and either an explicit Coder URL or Coder Service configuration. It supports listener and Coder-facing TLS, configurable probes and workload settings, and optional Service, Ingress, and Gateway API HTTPRoute resources.
Integrates the chart with existing Helm build, lint, golden generation, release artifact, Helm repository, and OCI publishing workflows.