knative: serving.secretRef → envFrom worker bindings (DECO_BIND_ prefix) - #38
Merged
Merged
Conversation
Adds spec.serving.secretRef to the Deco CR: a reference to a K8s Secret whose keys the operator mounts on the runner ksvc via envFrom with the DECO_BIND_ prefix, so the workerd-runner exposes them to the worker as env.<KEY>. The CR carries only the reference (never the values) → portable, secret-free, materializable across clusters. The materializer owns the Secret: the admin from siteState today, the control-plane later — the operator/CR/mf-run contract doesn't change when the source moves. Regenerated CRD + deepcopy + chart. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
Why
TanStack-on-Knative sites need runtime env/secrets reaching the worker (site config, OTEL auth, tokens) — like the Deno sites get from the site state today. The workerd runner already bridges
DECO_BIND_*pod env into the worker's bindings (infra#237); this wires the operator side.What
spec.serving.secretRefon the Deco CR — a reference to a K8s Secret.envFrom { prefix: DECO_BIND_, secretRef }, so every key becomesenv.<KEY>in the worker (mf-run strips the prefix).Design (future-ready)
The materializer owns the Secret contents — the admin from siteState today, the control-plane later (per the observability-binding / control-plane RFC). The operator ↔ CR ↔ mf-run contract is unchanged when the source moves. Same pattern as the RFC's Studio binding: control-plane owns the truth, the executor consumes a reference.
Follow-up (admin)
The admin must materialize the
<site>-envSecret from siteState and setspec.serving.secretRefinbuildProduction— separate PR.Summary by cubic
Add
spec.serving.secretRefto the Deco CR and wire it to KnativeenvFromwithDECO_BIND_, so site env/secrets reach the worker asenv.<KEY>. The CR carries only a Secret reference, keeping configs portable and secret-free.New Features
spec.serving.secretRefon the Deco CR to reference a K8s Secret.ksvcviaenvFromwithDECO_BIND_.env.<KEY>(prefix stripped).Migration
<site>-env) with required keys and setspec.serving.secretRefduring build/deploy.Written for commit fa766eb. Summary will update on new commits.