From 391401a1ba162db206ae3566c2e340db525a412f Mon Sep 17 00:00:00 2001 From: Brendan Kellam Date: Tue, 3 Nov 2026 13:22:11 -0800 Subject: [PATCH 1/3] feat: default Sourcebot data volume to 100Gi for new installs The 10Gi default is below the sizing guide's smallest tier (50 GB for up to 100 repos). The typical k8s install indexes about 400 repos, and several deployments on the default have filled their volume. `sourcebot.persistence.size` now defaults to unset: - an explicit size always wins (unchanged behaviour) - when unset, an existing PVC keeps its current size, so the upgrade never tries to resize a live volume. Resizing fails on storage classes without allowVolumeExpansion. - when unset on a new install, the PVC gets 100Gi Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 1 + README.md | 4 +- charts/sourcebot/README.md | 2 +- charts/sourcebot/templates/pvc.yaml | 12 ++- charts/sourcebot/tests/pvc_test.yaml | 107 +++++++++++++++++++++++++++ charts/sourcebot/values.yaml | 6 +- 6 files changed, 126 insertions(+), 6 deletions(-) create mode 100644 charts/sourcebot/tests/pvc_test.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f70182..1d02bc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Changed the default `sourcebot.image.repository` to `ghcr.io/sourcebot-dev/sourcebot`, fixing `unauthorized` pull errors with CRI-O (OpenShift) and Podman. [#153](https://github.com/sourcebot-dev/sourcebot-helm-chart/pull/153) +- Raised the default Sourcebot data volume size (`sourcebot.persistence.size`) from 10Gi to 100Gi for new installs. Existing volumes keep their current size on upgrade unless `size` is set explicitly, so the upgrade does not fail on storage classes that can't resize volumes. Argo CD renders the chart without cluster access, so it can't see an existing volume. Argo CD users relying on the old default should set `sourcebot.persistence.size: 10Gi` to keep their current volume, or set a larger size if their storage class can resize volumes. ## [0.1.118] - 2026-10-31 diff --git a/README.md b/README.md index bf9102a..842a47a 100644 --- a/README.md +++ b/README.md @@ -258,13 +258,13 @@ Each component has its own persistent volume for storing data across pod restart ### Sourcebot -Stores cloned repositories and search indexes. Enabled by default with a 10Gi volume. +Stores cloned repositories and search indexes. Enabled by default. New installs get a 100Gi volume. On upgrade, an existing volume keeps its current size unless you set `size` explicitly. See the [sizing guide](https://docs.sourcebot.dev/docs/deployment/sizing-guide) to choose a size for your repo count. ```yaml sourcebot: persistence: enabled: true # Default - size: 10Gi # Increase for large or many repositories + size: 100Gi # Default for new installs when unset. Increase for large or many repositories storageClass: "" # Uses cluster default accessModes: - ReadWriteOnce diff --git a/charts/sourcebot/README.md b/charts/sourcebot/README.md index 02e25d4..0c02c4b 100644 --- a/charts/sourcebot/README.md +++ b/charts/sourcebot/README.md @@ -104,7 +104,7 @@ Sourcebot is a self-hosted tool that helps you understand your codebase. | sourcebot.persistence.annotations | object | `{}` | Annotations for the PersistentVolumeClaim | | sourcebot.persistence.enabled | bool | `true` | Enable persistent storage for repository data and search indexes | | sourcebot.persistence.existingClaim | string | `""` | Use an existing PersistentVolumeClaim (if set, other persistence settings are ignored) | -| sourcebot.persistence.size | string | `"10Gi"` | Size of the persistent volume | +| sourcebot.persistence.size | string | `""` (100Gi for new installs) | Size of the persistent volume. When unset, new installs get 100Gi and existing volumes keep their current size on upgrade. See the sizing guide: https://docs.sourcebot.dev/docs/deployment/sizing-guide | | sourcebot.persistence.storageClass | string | `""` | Storage class name. If not set, uses the cluster default storage class | | sourcebot.podAnnotations | object | `{}` | Add annotations to the pod metadata | | sourcebot.podDisruptionBudget.enabled | bool | `true` | Enable Pod Disruption Budget | diff --git a/charts/sourcebot/templates/pvc.yaml b/charts/sourcebot/templates/pvc.yaml index 504e0cc..dbd75ac 100644 --- a/charts/sourcebot/templates/pvc.yaml +++ b/charts/sourcebot/templates/pvc.yaml @@ -1,6 +1,16 @@ {{- if and .Values.sourcebot.persistence.enabled (not .Values.sourcebot.persistence.existingClaim) }} {{- $pvcName := printf "%s-%s" (include "sourcebot.fullname" .) "data" -}} {{- $existingPvc := (lookup "v1" "PersistentVolumeClaim" $.Release.Namespace $pvcName) -}} +{{- /* +An explicit `sourcebot.persistence.size` always wins. When it is unset, an +existing PVC keeps its current size, so changing the chart default never +resizes a live volume on upgrade (which fails on storage classes without +`allowVolumeExpansion`). New installs get the chart default. +*/ -}} +{{- $size := .Values.sourcebot.persistence.size -}} +{{- if not $size -}} +{{- $size = dig "spec" "resources" "requests" "storage" "100Gi" $existingPvc -}} +{{- end }} --- apiVersion: v1 kind: PersistentVolumeClaim @@ -21,7 +31,7 @@ spec: {{- end }} resources: requests: - storage: {{ .Values.sourcebot.persistence.size }} + storage: {{ $size }} {{- if .Values.sourcebot.persistence.storageClass }} {{- if (eq "-" .Values.sourcebot.persistence.storageClass) }} storageClassName: "" diff --git a/charts/sourcebot/tests/pvc_test.yaml b/charts/sourcebot/tests/pvc_test.yaml new file mode 100644 index 0000000..a6d1d4e --- /dev/null +++ b/charts/sourcebot/tests/pvc_test.yaml @@ -0,0 +1,107 @@ +suite: test sourcebot data PVC sizing +templates: + - pvc.yaml +release: + name: sourcebot + namespace: sourcebot +values: + - ../values.lint.yaml +tests: + - it: should default new installs to 100Gi + asserts: + - equal: + path: spec.resources.requests.storage + value: 100Gi + - notExists: + path: spec.volumeName + + - it: should use an explicitly set size on a new install + set: + sourcebot.persistence.size: 25Gi + asserts: + - equal: + path: spec.resources.requests.storage + value: 25Gi + + - it: should keep an existing PVC's size when size is unset + kubernetesProvider: + scheme: + "v1/PersistentVolumeClaim": + gvr: + version: "v1" + resource: "persistentvolumeclaims" + namespaced: true + objects: + - kind: PersistentVolumeClaim + apiVersion: v1 + metadata: + name: sourcebot-data + namespace: sourcebot + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi + volumeName: pvc-1234 + asserts: + - equal: + path: spec.resources.requests.storage + value: 10Gi + - equal: + path: spec.volumeName + value: pvc-1234 + + - it: should apply an explicitly set size to an existing PVC + set: + sourcebot.persistence.size: 50Gi + kubernetesProvider: + scheme: + "v1/PersistentVolumeClaim": + gvr: + version: "v1" + resource: "persistentvolumeclaims" + namespaced: true + objects: + - kind: PersistentVolumeClaim + apiVersion: v1 + metadata: + name: sourcebot-data + namespace: sourcebot + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi + volumeName: pvc-1234 + asserts: + - equal: + path: spec.resources.requests.storage + value: 50Gi + - equal: + path: spec.volumeName + value: pvc-1234 + + - it: should ignore a PVC with the same name in another namespace + kubernetesProvider: + scheme: + "v1/PersistentVolumeClaim": + gvr: + version: "v1" + resource: "persistentvolumeclaims" + namespaced: true + objects: + - kind: PersistentVolumeClaim + apiVersion: v1 + metadata: + name: sourcebot-data + namespace: other + spec: + resources: + requests: + storage: 10Gi + asserts: + - equal: + path: spec.resources.requests.storage + value: 100Gi diff --git a/charts/sourcebot/values.yaml b/charts/sourcebot/values.yaml index 45076c3..ae0a5d7 100644 --- a/charts/sourcebot/values.yaml +++ b/charts/sourcebot/values.yaml @@ -319,8 +319,10 @@ sourcebot: enabled: true # -- Use an existing PersistentVolumeClaim (if set, other persistence settings are ignored) existingClaim: "" - # -- Size of the persistent volume - size: 10Gi + # -- Size of the persistent volume. When unset, new installs get 100Gi and existing volumes keep their current size on upgrade. + # See the sizing guide: https://docs.sourcebot.dev/docs/deployment/sizing-guide + # @default -- `""` (100Gi for new installs) + size: "" # -- Storage class name. If not set, uses the cluster default storage class storageClass: "" # -- Access modes for the persistent volume From 2842ec4b9875be613967573ea1a94513c688e0cc Mon Sep 17 00:00:00 2001 From: Brendan Kellam Date: Tue, 3 Nov 2026 13:22:33 -0800 Subject: [PATCH 2/3] chore: update changelog Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d02bc2..6a50088 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Changed the default `sourcebot.image.repository` to `ghcr.io/sourcebot-dev/sourcebot`, fixing `unauthorized` pull errors with CRI-O (OpenShift) and Podman. [#153](https://github.com/sourcebot-dev/sourcebot-helm-chart/pull/153) -- Raised the default Sourcebot data volume size (`sourcebot.persistence.size`) from 10Gi to 100Gi for new installs. Existing volumes keep their current size on upgrade unless `size` is set explicitly, so the upgrade does not fail on storage classes that can't resize volumes. Argo CD renders the chart without cluster access, so it can't see an existing volume. Argo CD users relying on the old default should set `sourcebot.persistence.size: 10Gi` to keep their current volume, or set a larger size if their storage class can resize volumes. +- Raised the default Sourcebot data volume size (`sourcebot.persistence.size`) from 10Gi to 100Gi for new installs. Existing volumes keep their current size on upgrade unless `size` is set explicitly, so the upgrade does not fail on storage classes that can't resize volumes. Argo CD renders the chart without cluster access, so it can't see an existing volume. Argo CD users relying on the old default should set `sourcebot.persistence.size: 10Gi` to keep their current volume, or set a larger size if their storage class can resize volumes. [#154](https://github.com/sourcebot-dev/sourcebot-helm-chart/pull/154) ## [0.1.118] - 2026-10-31 From 8ae7e89a2f10d9e29116b4f9f303461e95c7e71f Mon Sep 17 00:00:00 2001 From: Brendan Kellam Date: Tue, 3 Nov 2026 13:39:32 -0800 Subject: [PATCH 3/3] docs: leave persistence size unset in README example Copying an explicit size into an upgrade would resize an existing volume, which fails on storage classes without allowVolumeExpansion. Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 842a47a..edabf88 100644 --- a/README.md +++ b/README.md @@ -264,7 +264,7 @@ Stores cloned repositories and search indexes. Enabled by default. New installs sourcebot: persistence: enabled: true # Default - size: 100Gi # Default for new installs when unset. Increase for large or many repositories + size: "" # Default. New installs get 100Gi, existing volumes keep their size. Set e.g. 250Gi to resize. storageClass: "" # Uses cluster default accessModes: - ReadWriteOnce