Skip to content

[feat] Add optional dedicated service accounts for the code and JS executors - #432

Open
cameronattard wants to merge 1 commit into
tryretool:mainfrom
cameronattard:feat/per-workload-service-accounts
Open

cameronattard wants to merge 1 commit into
tryretool:mainfrom
cameronattard:feat/per-workload-service-accounts

Conversation

@cameronattard

Copy link
Copy Markdown

What

Adds codeExecutor.serviceAccount and rr.jsExecutor.serviceAccount, so the two executors that run user code can use a different service account from the rest of Retool.

codeExecutor:
  serviceAccount:
    create: false       # true: the chart creates <fullname>-code-executor (or `name`)
    name: ''            # with create: false, an existing account; empty uses the shared one
    annotations: {}     # on the created account
    automountToken: false

rr.jsExecutor.serviceAccount is the same (default name <fullname>-js-executor). With both left at their defaults, the executors keep the top-level serviceAccount and the render is unchanged.

Why

Every Retool workload uses the one top-level service account. On EKS the usual way to give Retool AWS access (S3, Bedrock, Secrets Manager) is an IRSA annotation on that account, and GKE Workload Identity works the same way. The pod identity webhook then projects a cloud token into every pod that uses the account, including the code executor and JS executor. Those pods run user-supplied code, so they hold credentials they never need. nsjail limits what sandboxed code can reach, but a sandbox escape, or code in the JS executor, would get the backend's cloud role.

With create: true the executor gets its own account without the annotation, so the webhook injects no token. The account has automountServiceAccountToken: false by default; neither executor calls the Kubernetes API.

This is limited to the two executors. Other workloads (backend, workflows, workers, MCP) need the same permissions as the backend in practice, and the agent sandbox controller already has its own account.

Verified

  • New .github/test_executor_service_accounts.py, wired into ci.yaml, covers:
    • the defaults: shared account, no extra ServiceAccount;
    • create: true with and without name, while the backend keeps the shared account and its annotation;
    • annotations and automountToken on the created account;
    • an existing name without create;
    • no account when the executor is disabled.
  • A default render diffed against main differs only in the chart version label.
  • helm lint and schema/generate.sh --check pass; the two values.yaml files are in sync.
  • New charts/retool/ci/test-executor-service-accounts-option.yaml, so kubeconform validates the new path (passes locally with kubeconform 0.6.7 against Kubernetes 1.31.1).
  • Chart version bump 6.14.2 -> 6.14.3.

…ecutors

Every workload shared one service account, so a cloud identity annotation on
it (EKS IRSA, GKE Workload Identity) also reached the executors, which run
user code. codeExecutor.serviceAccount and rr.jsExecutor.serviceAccount can
now create a dedicated account (create: true, optional name, annotations,
automountToken) or point at an existing one (name). Left unset, both keep
using the top-level serviceAccount, so existing installs render identically.
@greptile-apps

greptile-apps Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge and preserves existing account choices by default.

Reviews (1) · Last reviewed commit: "[feat] Add optional dedicated service ac..." · Reviewed by Greptile

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