feat: add CTRL_URL environment variable to dashboard#3980
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
📝 WalkthroughWalkthroughAdds a Service resource for the dashboard in Kubernetes and introduces a CTRL_URL environment variable in both Kubernetes deployment and local bootstrap script. The YAML deployment formatting is adjusted without semantic changes. The local dashboard bootstrap now writes ControlPlane.CTRL_URL to the generated environment. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thank you for following the naming conventions for pull request titles! 🙏 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
go/k8s/manifests/dashboard.yaml (3)
22-29: Init wait loop can hang indefinitely; add timeout/backoffAn endless loop can stall rollout. Add a bounded retry with small TCP timeout.
- - | - until nc -z planetscale 3900; do - echo waiting for planetscale - sleep 2 - done + - | + for i in $(seq 1 60); do + if nc -z -w 2 planetscale 3900; then + exit 0 + fi + echo "waiting for planetscale" + sleep 2 + done + echo "planetscale did not become ready in time" >&2 + exit 1
33-33: imagePullPolicy: Never — ensure this is gated to local-only overlaysFine for local clusters with preloaded images; risky elsewhere. Gate via an overlay or set IfNotPresent in base.
67-83: Service exposure: confirm LoadBalancer is intendedIf the dashboard shouldn’t be publicly reachable in all environments, consider ClusterIP in base and promote to LoadBalancer via env-specific overlay. Also ensure auth is enforced.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
go/k8s/manifests/dashboard.yaml(1 hunks)tools/local/src/cmd/dashboard.ts(1 hunks)
🧰 Additional context used
🪛 Checkov (3.2.334)
go/k8s/manifests/dashboard.yaml
[medium] 42-43: Basic Auth Credentials
(CKV_SECRET_4)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Test API / API Test Local
- GitHub Check: Test Go API Local / Test
- GitHub Check: Build / Build
🔇 Additional comments (2)
go/k8s/manifests/dashboard.yaml (1)
51-52: Verified — CTRL_URL is correct (Service ctrl exists:7091 in namespace unkey)
go/k8s/manifests/ctrl.yaml defines Service metadata.name: ctrl, metadata.namespace: unkey with port: 7091 and targetPort: 7091; http://ctrl:7091 is valid for in-cluster DNS.tools/local/src/cmd/dashboard.ts (1)
35-37: Verify CTRL_URL marshaling & consumption
- Local default exists: tools/local/src/cmd/dashboard.ts — ControlPlane.CTRL_URL = "http://localhost:7091".
- Dashboard reads the value via env().CTRL_URL (apps/dashboard/lib/trpc/routers/deploy/deployment/rollback.ts:23); apps/dashboard/lib/env.ts declares CTRL_URL as z.string().url().optional().
- Verify the env generator (marshalEnv or the tool that emits the local env) flattens ControlPlane.CTRL_URL → CTRL_URL (top-level, not namespaced). If marshalEnv isn't used, identify the generator and confirm it outputs a plain CTRL_URL for the dashboard to consume.
chronark
left a comment
There was a problem hiding this comment.
ah well that's dumb, I thought I changed it to 2 tabs, I'll send a fix later

What does this PR do?
Adds the
CTRL_URLenvironment variable to the dashboard configuration in both Kubernetes manifests and local development setup. This allows the dashboard to communicate with the control plane service.Fixes # (issue)
Type of change
How should this be tested?
Checklist
Required
pnpm buildpnpm fmtconsole.logsgit pull origin mainSummary by CodeRabbit