feat: optional read-only root filesystem for run pods in the Kubernetes supervisor

オープン
#5,078 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
72/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
kubernetes, typescript

調査の方向性

Start with apps/supervisor/src/env.ts, workloadManager/kubernetes.ts, and workloadManager/kubernetesPodSpec.ts; trace how runner security context settings and pod volumes are configured. Check the existing unit tests for runnerSecurityContext and the proposed runnerTmpVolume helper. Done means both opt-in environment variables work as described, default behavior stays unchanged, and the related tests pass.

索引モデルが issue の本文から書いたものです。

説明

Is your feature request related to a problem? Please describe.

Self-hosters running Trigger.dev on Kubernetes with Pod Security / policy engines (Kyverno, OPA Gatekeeper, CIS benchmarks, some compliance scanners) are often required to run containers with readOnlyRootFilesystem: true. The supervisor's KUBERNETES_RUNNER_SECURITY_CONTEXT (off/baseline/restricted) doesn't set it, and no Pod Security Standards level requires it, so there is currently no way to get it on run pods without patching the supervisor.

Describe the solution you'd like to see

Add two opt-in supervisor env vars:

  • KUBERNETES_RUNNER_READ_ONLY_ROOT_FILESYSTEM (boolean, default false). When true, sets securityContext.readOnlyRootFilesystem: true on the run-controller container. It composes with any KUBERNETES_RUNNER_SECURITY_CONTEXT level, including off.
  • KUBERNETES_RUNNER_TMP_VOLUME_SIZE_LIMIT (default 256Mi, blank = no per-volume cap). When read-only is enabled, an emptyDir is mounted at /tmp so tasks keep a writable os.tmpdir().

The runner runtime itself doesn't write to disk (IPC over socketpair, logs to stdout, OTLP over HTTP), so a single /tmp volume is sufficient. Default behavior is unchanged.

Describe alternate solutions
  • A mutating admission webhook injecting readOnlyRootFilesystem and a /tmp volume. This works but adds cluster-side machinery for something the supervisor can do natively.
  • Maintaining a fork of the supervisor. This is what we do today and what we'd like to stop doing.
  • Making KUBERNETES_RUNNER_SECURITY_CONTEXT=restricted imply the flag. This would break existing users, since restricted doesn't imply a read-only root.
Additional information

We already run this in a private fork (including unit tests for runnerSecurityContext and the new runnerTmpVolume helper). The change touches apps/supervisor/src/env.ts, workloadManager/kubernetes.ts and workloadManager/kubernetesPodSpec.ts, and is roughly 60 lines of source. If this direction is acceptable, we'd be happy to open a PR once vouched, so we can drop our fork.

主要言語
TypeScript
スター
16.5k
フォーク
1.5k
平均マージ
1日 15時間
マージ済み PR(30日)
17

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

triggerdotdev/trigger.dev のほかの issue

triggerdotdev/trigger.dev の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。