feat(supervisor): parameterize worker pod annotations, securityContext, SA, envFrom#14
Draft
ConProgramming wants to merge 1 commit into
Draft
feat(supervisor): parameterize worker pod annotations, securityContext, SA, envFrom#14ConProgramming wants to merge 1 commit into
ConProgramming wants to merge 1 commit into
Conversation
…t, SA, envFrom The Kubernetes workload manager now reads five new env vars from the supervisor process and applies them to every spawned worker pod: - KUBERNETES_WORKER_POD_ANNOTATIONS (JSON, Record<string,string>) - KUBERNETES_WORKER_POD_SECURITY_CONTEXT (JSON, V1PodSecurityContext) - KUBERNETES_WORKER_CONTAINER_SECURITY_CONTEXT (JSON, V1SecurityContext) - KUBERNETES_WORKER_SERVICE_ACCOUNT (string, SA name) - KUBERNETES_WORKER_ENV_FROM_SECRET (string, Secret name) All five are optional. When unset, behavior matches today. Lets compliance-sensitive deployments (Red Hat OpenShift, FedRAMP/IL5 environments, restricted PSA namespaces) configure worker pods through the Helm chart instead of patching the supervisor image. Also unblocks operators who need worker pods to: - Carry custom annotations (e.g. service mesh sidecar opt-out, audit tags) - Run under specific UIDs / capabilities / seccomp profiles - Use a non-default ServiceAccount (e.g. for IRSA / Workload Identity) - Inherit a batch of env vars from a Secret via envFrom Includes envUtil helper + tests for JSON parsing of the structured envs. The supervisor.yaml Helm template emits these env vars from values when set; schema added under supervisor.config.kubernetes.* in values.yaml. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Parameterizes worker pod metadata, securityContext, ServiceAccount, and envFrom-Secret via five new optional env vars on the supervisor process, plus matching Helm values. Lets operators configure compliance-required pod settings (annotations, runAsNonRoot, capabilities.drop, seccompProfile, etc.) without patching the supervisor image.
Discovered while rebasing our trigger.dev fork for a FedRAMP environment — Red Hat OpenShift's restricted SCC + pod-security admission policy reject worker pods that don't carry these settings.
Changes
KUBERNETES_WORKER_POD_ANNOTATIONS,_POD_SECURITY_CONTEXT,_CONTAINER_SECURITY_CONTEXT,_SERVICE_ACCOUNT,_ENV_FROM_SECRET(all optional, JSON-encoded for structured ones)envUtil.tshelper for JSON parsing + Zod validation, with testsworkloadManager/kubernetes.tsapplies parsed values to V1Pod specsupervisor.yamlemits the env vars when corresponding values are set; newsupervisor.config.kubernetes.workerPod*keys invalues.yamlTest plan
Notes
Made with Cursor