Skip to content

js-executor: drop backend-shared env inheritance + resize resources#304

Merged
JatinNanda merged 2 commits into
r2-cleanupfrom
jatin/jse-cleanup
Jun 5, 2026
Merged

js-executor: drop backend-shared env inheritance + resize resources#304
JatinNanda merged 2 commits into
r2-cleanupfrom
jatin/jse-cleanup

Conversation

@JatinNanda
Copy link
Copy Markdown
Contributor

Part of the r2-cleanup integration branch (merges into r2-cleanup, which later merges into r2).

Changes

1. Stop inheriting backend-shared env
The js-executor deployment looped over the backend-shared .Values.env, .Values.environmentSecrets, and .Values.environmentVariables unfiltered, injecting db creds, auth/encryption secrets, the license key, and other backend config into a sandbox pod that needs none of it. Replaced with per-workload overrides jsExecutor.env / jsExecutor.environmentSecrets / jsExecutor.environmentVariables (all default empty), matching the self-contained pattern already used by the mcp and agent_sandbox workloads.

Verified against the js_executor service in retool_development: it reads zero backend-shared env vars (no Postgres/DB, JWT, encryption, license, or auth secrets) — only deployment/telemetry metadata and config that all have defaults.

2. Resize resources
Bump CPU to 6000m and set memory to 6Gi, with requests == limits (Guaranteed QoS). Memory request is kept equal to the limit because JSE reads its memory limit and rejects requests at 80% of it.

Audit note

The env bleed only affected js-executor — agent_sandbox and mcp were already self-contained and need no change. (mcp still inherits .Values.files/PVC/commandline.args, left as a separate follow-up.)

Verification

helm template confirms backend .Values.env/.Values.environmentSecrets no longer render in the js-executor pod, resources show 6000m/6Gi req=limit; both values.yaml copies stay in sync; helm lint passes.

🤖 Generated with Claude Code

JatinNanda and others added 2 commits June 4, 2026 15:54
The js-executor deployment looped over the backend-shared .Values.env and
.Values.environmentSecrets (and .Values.environmentVariables) unfiltered,
injecting db creds, auth/encryption secrets, license key, and other backend
config into a pod that needs none of it. This pollutes the workload and
widens the blast radius of any change to shared env.

js-executor is a standalone nsjail JS sandbox that reads none of the
backend-shared env vars. Replace the inheritance with per-workload overrides:
jsExecutor.env / jsExecutor.environmentSecrets / jsExecutor.environmentVariables
(all default empty), matching the self-contained pattern already used by the
mcp and agent_sandbox workloads.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Bump js-executor CPU rather than shrinking memory. Set requests == limits at
cpu: 6000m / memory: 6Gi (Guaranteed QoS). The memory request is kept equal
to the limit because JSE reads its memory limit and rejects requests at 80%
of it, so the request must reserve the full amount.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@JatinNanda JatinNanda marked this pull request as ready for review June 5, 2026 17:36
@JatinNanda JatinNanda merged commit 015e98f into r2-cleanup Jun 5, 2026
24 checks passed
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.

1 participant