Repository navigation
Fix precise-code-intel tmpdir PVC reclaim policy - #958
Merged
Merged
Conversation
The /tmp scratch volume is a generic ephemeral volume, so its claim is created and deleted with the pod. It took its class from storageClass.name, which is reclaimPolicy Retain for stateful data. Each worker restart therefore left a Released PV and its backing disk behind, and the disks accumulated until the cloud provider's SSD quota rejected new claims. The claim now reads preciseCodeIntel.storageClassName, which defaults to empty so the cluster default class applies. Cluster defaults are reclaimPolicy Delete, so the volume is reclaimed with the pod. The value is deliberately not a concrete class name, since those differ per cloud provider. storageType defaults to emptyDir, so the default render is unchanged.
devdinu
marked this pull request as ready for review
October 8, 2026 19:34
DaedalusG
approved these changes
Oct 8, 2026
2 of 3 tasks
filiphaftek
added a commit
that referenced
this pull request
Nov 3, 2026
The syntactic-code-intel-worker's `/tmp` scratch volume was always an unbounded `emptyDir`, which places its writes on the node boot disk. This brings it to parity with the precise-code-intel-worker options added in #956 and #958. ## Changes - Add `syntacticCodeIntel.storageType` to select the backing store for `/tmp`: `emptyDir` (default) or `pvc` - `pvc` mounts a generic ephemeral volume, so each pod gets its own claim that is created and deleted with the pod - Add `syntacticCodeIntel.storageSize`, required for `pvc` and applied as `sizeLimit` when left on `emptyDir` - Add `syntacticCodeIntel.storageClassName` for the scratch claim. Empty uses the cluster default class (`reclaimPolicy: Delete`); `storageClass.name` is `Retain` and is deliberately not used - On `pvc`, the pod `fsGroup` defaults to the container `runAsGroup` (with `fsGroupChangePolicy: OnRootMismatch`) so the non-root worker can write to the freshly provisioned volume; a user-set `podSecurityContext.fsGroup` wins The default renders `emptyDir: {}` exactly as before, so existing installs are unaffected. The mount path stays `/tmp`. Example: ```yaml syntacticCodeIntel: enabled: true storageType: pvc storageSize: 50Gi ``` ### Checklist - [x] Follow the [manual testing process](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/TEST.md) - [x] Update [changelog](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/charts/sourcegraph/CHANGELOG.md) - [ ] Update [Kubernetes update doc](https://docs.sourcegraph.com/admin/updates/kubernetes) ### Test plan - New `tests/syntacticCodeIntelStorage_test.yaml` (mirrors `preciseCodeIntelStorage_test.yaml`); its 7 behavior tests fail against the old template and pass with this change - `helm unittest` on all four charts: 237 passed - `helm lint charts/sourcegraph` with `storageType=pvc` passes - `helm template` with `syntacticCodeIntel.enabled=true` and default storage values is byte-identical before and after - `./scripts/helm-docs.sh` leaves no diff - CI Co-authored-by: Amp <[email protected]>
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.
The precise-code-intel-worker
/tmpscratch volume is a generic ephemeralvolume, so its claim is created and deleted with the pod. It took its class
from
storageClass.name, which isreclaimPolicy: Retainfor stateful data.Every worker restart left a Released PV and its backing disk behind, and the
disks accumulated until the cloud provider's SSD quota rejected new claims.
Changes
preciseCodeIntel.storageClassNamefor the/tmpscratch PVC, read instead ofstorageClass.namereclaimPolicy: Delete, so the volume is reclaimed with the podThe value is deliberately not a concrete class name. Those differ per cloud
provider (
premium-rwoon GKE,gp3on EKS,managed-csion AKS), and ahardcoded default would leave a PVC permanently Pending on clusters that do
not define it.
storageClassstaysRetainand continues to back thestateful volumes.
storageTypedefaults toemptyDir, so the default render is unchanged.Pre-existing Released PVs are not reclaimed by the upgrade. Operators already
on a Retain class need to delete those and their backing disks separately.
Test Plan