Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. [#154](https://github.com/sourcebot-dev/sourcebot-helm-chart/pull/154)

## [0.1.118] - 2026-10-31

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: "" # Default. New installs get 100Gi, existing volumes keep their size. Set e.g. 250Gi to resize.
storageClass: "" # Uses cluster default
accessModes:
- ReadWriteOnce
Expand Down
2 changes: 1 addition & 1 deletion charts/sourcebot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
12 changes: 11 additions & 1 deletion charts/sourcebot/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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: ""
Expand Down
107 changes: 107 additions & 0 deletions charts/sourcebot/tests/pvc_test.yaml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions charts/sourcebot/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading