Repository navigation
feat(sandbox): ask for the L2 golden store's volume instead of naming a cloud - #5806
Merged
Merged
Conversation
depsCache.remote now takes `bucketName` and renders the mountpoint-S3 PV and its PVC, named per release and mounted under `prefix=<envName>/`. Those objects used to be created by terraform under one namespace-wide name (`sandbox-golden-ro`). agent-sandbox-system holds a release per environment, so that made prod and stg mount the same bucket root — stg could publish an archive that prod then restored. Only the chart knows the release, so only the chart can name them apart and scope their keys. It also closes an unenforced contract: `pvcName` pointed at an object this chart did not own, so a rename on the other side left `helm template` passing while the pod failed at mount time. `pvcName` stays as the escape hatch for a claim this chart does not manage, now mutually exclusive with `bucketName`. Setting both fails the render (ambiguous authority) and setting neither fails too, instead of mounting an empty claimName. mountOptions are load-bearing, not decoration: mountpoint synthesises ownership, so without uid/gid 1000 every object presents as root-owned and the sandbox uid cannot open it — and publish is best-effort, so it swallows the EACCES and the failure surfaces as "the cache never hits". `read-only` is set at the mount as well as at the volumeMount so a consumer that forgets `readOnly: true` still cannot write. Also refreshes the values.yaml docs, which still described EFS and claimed a restore touches mtime to keep a live lockfile alive — true on EFS, false here: mountpoint has no utimes, so the bucket's lifecycle policy is the only reaper and an in-use archive still expires. Still default off; nothing renders unless depsCache.remote.enabled. Verified with `helm template` across all four paths (off, bucketName for prod and stg, pvcName) and all three validation failures, plus `helm lint`. Infra side: decocms/terraform-eks-cluster removes the four kubectl_manifest resources and keeps the bucket. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
pedrofrxncx
approved these changes
Aug 6, 2026
Replaces `bucketName` with three mutually-exclusive sources, so the chart stops
being AWS-only:
- `storageClassName` — dynamic. Renders only the PVC and lets the cluster's
provisioner create the volume. Nothing in the template names a driver, so any
RWX CSI backend works (EFS, gcsfuse, Azure Blob, NFS, JuiceFS). This is the
idiomatic self-host path: infrastructure installs the driver and a
StorageClass, the chart just claims.
- `volume.{driver,attributes,mountOptions}` — static. Renders PV + PVC. Needed
for drivers with no dynamic provisioner, which is exactly the AWS case:
mountpoint-S3 is static-provisioning only (the cluster has no StorageClass for
s3.csi.aws.com and the driver ships no provisioner), so the PV has to be
declared by hand and it is the PV that names the driver. Defaults keep the
AWS path batteries-included; only `attributes.bucketName` is needed.
- `pvcName` — an existing claim, unchanged.
Two set fails the render as ambiguous authority; none set fails too, rather
than emitting a PVC with neither a StorageClass nor a volumeName, which would
sit Pending forever without an obvious cause.
mountOptions are per-driver syntax, not portable, so the annotated defaults are
documented as mountpoint-specific and meant to be replaced wholesale. Each entry
passes through `tpl` so a driver can express per-release scoping in its own
syntax — the default uses `prefix={{ envName }}/`, which is what keeps two
releases sharing agent-sandbox-system from reading each other's archives.
Verified with `helm template`: off renders nothing; static renders PV + PVC with
the driver, bucket and prefix; dynamic renders only the PVC with the
StorageClass and names no driver; pvcName renders neither. All four validation
failures produce their intended message. `helm lint` clean.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This was referenced Aug 6, 2026
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.
depsCache.remotenow asks for a volume instead of having one handed over by terraform. Chart0.11.0. Still default off.Infra side: decocms/terraform-eks-cluster#92 (merged) removes the four
kubectl_manifestresources and keeps the bucket.Why move them here
Those objects were created by terraform (decocms/terraform-eks-cluster#88) under one namespace-wide name,
sandbox-golden-ro.agent-sandbox-systemholds a release per environment, so that made prod and stg mount the same store root — stg could publish an archive that prod then restored, and stg is where broken builds live. Only this chart knows the release, so only this chart can name the objects apart and scope their keys.It also closes an unenforced contract:
pvcNamepointed at an object this chart did not own, so a rename on the terraform side lefthelm templatepassing while the pod failed at mount time. And since this chart is delivered by Argo, a foreign-owned PVC sat outside self-heal, prune, and the UI next to the workload it serves.The split is now clean: installing a CSI driver is infrastructure; asking for a volume is workload config.
Three sources, exactly one
storageClassNamevolume.{driver,attributes,mountOptions}pvcNameWhy the static path has to exist. mountpoint-S3 is static-provisioning only — the cluster has no StorageClass for
s3.csi.aws.comand the driver ships no provisioner, so there is nothing to claim against and the PV must be declared by hand. The PV is what names the driver, which is the one genuinely cloud-specific part of the whole feature; everything else was already agnostic (the daemon writes a tarball to a path viaGOLDEN_CACHE_REMOTE).Why the dynamic path is the self-host answer. It renders only a PVC, so nothing in the template names a cloud. Bring EFS, gcsfuse, Azure Blob, NFS CSI, JuiceFS — install the driver, create a StorageClass, name it here.
Two sources set fails the render as ambiguous authority. None set fails too, rather than emitting a PVC with neither a StorageClass nor a
volumeName— that would sitPendingforever with no obvious cause. (Previously therequiredonpvcNamecovered this; dropping it without a replacement would have regressed into a silent failure.)mountOptions are load-bearing, and not portable
Mountpoint synthesises ownership, so a PV without
uid=1000/gid=1000presents every object as root-owned and the sandbox uid cannot open it. Publish is best-effort and swallows the resultingEACCES, so the symptom is "the cache never hits" rather than a permission error — this already cost a debug cycle on the terraform version.allow-otheris required for a non-root process to touch a FUSE mount it didn't create.read-onlyis set at the mount as well as at the pod'svolumeMount, so a consumer that forgetsreadOnly: truestill cannot write.Option names are per-driver, though, so the defaults are documented as mountpoint syntax and meant to be replaced wholesale rather than extended. Each entry passes through
tpl, so a driver can express per-release scoping in its own syntax — the default isprefix={{ envName }}/, which is what stops two releases from reading each other's archives.uid/gid are hardcoded to 1000 with a comment tracking the pod
securityContextinsandbox-template.yaml, which hardcodes them too. Not worth a value until something needs to disagree.Docs refresh
The
depsCache.remoteblock still described EFS throughout, and claimed the daemon's prune keeps a live lockfile alive because "a restore touches mtime". True on EFS, false on mountpoint — there is noutimes, so the store's own lifecycle policy is the only reaper and an archive in active use still expires (14d in terraform today), costing one cold install before it republishes.Kept as-is: the CROSS-REPO READS note. That trade-off was already stated and accepted, and this change doesn't move it — the mount still exposes the whole store, because warm-pool pods are bound before they know their repo. What it does add is that cross-release reads are now impossible.
Verification
helm template, every path:envName=prodstudio-sandbox-golden-prod,driver: s3.csi.aws.com, bucket,prefix=prod/envName=stgstudio-sandbox-golden-stg,prefix=stg/— distinct from prodstorageClassName: "efs-sc", no driver named anywherepvcNameclaimName: legacyAll four validation failures produce their intended message: remote without
depsCache.enabled, two sources, zero sources,attributeswithoutdriver.helm lintclean.Not validated on a real pod. Enabling this is gated on a first mountpoint mount actually working on the sandbox NodePool — that pool carries
decocms.com/sandbox=true:NoSchedule, and no mountpoint volume has ever been mounted in that cluster (themount-s3namespace is empty), so whether the driver's Mountpoint Pod tolerates the taint is unverified. That test comes before flippingenabled, not in this PR.