From 3cdbb59c1143b3f29d985fea8b53ac1b889f5135 Mon Sep 17 00:00:00 2001 From: Alexander Chernov Date: Sun, 29 Mar 2026 12:54:24 +0100 Subject: [PATCH 1/4] chore: update sourcebot version to 0.1.67 and add deployment strategy configuration Signed-off-by: Alexander Chernov --- charts/sourcebot/Chart.yaml | 2 +- charts/sourcebot/templates/deployment.yaml | 4 ++++ charts/sourcebot/values.schema.json | 12 ++++++++++++ charts/sourcebot/values.yaml | 6 +++++- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/charts/sourcebot/Chart.yaml b/charts/sourcebot/Chart.yaml index b0194b7..8fdb510 100644 --- a/charts/sourcebot/Chart.yaml +++ b/charts/sourcebot/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 type: application name: sourcebot -version: 0.1.66 +version: 0.1.67 appVersion: v4.16.3 description: Sourcebot is a self-hosted tool that helps you understand your codebase. icon: https://raw.githubusercontent.com/sourcebot-dev/sourcebot/ebf6721836b8f878d42bb8c1e844bdc7867a74fe/packages/web/public/logo_512.png diff --git a/charts/sourcebot/templates/deployment.yaml b/charts/sourcebot/templates/deployment.yaml index 3598c67..6e5c00b 100644 --- a/charts/sourcebot/templates/deployment.yaml +++ b/charts/sourcebot/templates/deployment.yaml @@ -8,6 +8,10 @@ metadata: {{- include "sourcebot.labels" $ | nindent 4 }} spec: replicas: {{ $.Values.sourcebot.replicaCount }} + {{- with $.Values.sourcebot.strategy }} + strategy: + {{- toYaml . | nindent 4 }} + {{- end }} selector: matchLabels: {{- include "sourcebot.selectorLabels" $ | nindent 6 }} diff --git a/charts/sourcebot/values.schema.json b/charts/sourcebot/values.schema.json index 7a9232a..ce7fed7 100644 --- a/charts/sourcebot/values.schema.json +++ b/charts/sourcebot/values.schema.json @@ -36,6 +36,18 @@ "type": "integer", "minimum": 1 }, + "strategy": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["RollingUpdate", "Recreate"] + }, + "rollingUpdate": { + "type": "object" + } + } + }, "image": { "type": "object", "properties": { diff --git a/charts/sourcebot/values.yaml b/charts/sourcebot/values.yaml index 031e8cb..fa1d046 100644 --- a/charts/sourcebot/values.yaml +++ b/charts/sourcebot/values.yaml @@ -4,7 +4,7 @@ global: security: # -- Allow insecure images to use bitnami legacy repository. Can be set to false if secure images are being used (Paid). allowInsecureImages: true - + # -- Global Docker registry secret names as an array imagePullSecrets: [] @@ -19,6 +19,10 @@ sourcebot: # -- Set the number of replicas for the deployment replicaCount: 1 + # -- Deployment strategy configuration + strategy: + type: RollingUpdate + # Image configuration image: # -- Container image repository From 2d3e1a932eb096371cc3e331a5caf7f6dc62fce1 Mon Sep 17 00:00:00 2001 From: Alexander Chernov Date: Sun, 29 Mar 2026 13:06:57 +0100 Subject: [PATCH 2/4] Further hardening of values.schema.json --- charts/sourcebot/values.schema.json | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/charts/sourcebot/values.schema.json b/charts/sourcebot/values.schema.json index ce7fed7..e93009f 100644 --- a/charts/sourcebot/values.schema.json +++ b/charts/sourcebot/values.schema.json @@ -38,15 +38,23 @@ }, "strategy": { "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["RollingUpdate", "Recreate"] + "oneOf": [ + { + "additionalProperties": false, + "properties": { + "type": { "type": "string", "const": "RollingUpdate" }, + "rollingUpdate": { "type": "object" } + }, + "required": ["type"] }, - "rollingUpdate": { - "type": "object" + { + "additionalProperties": false, + "properties": { + "type": { "type": "string", "const": "Recreate" } + }, + "required": ["type"] } - } + ] }, "image": { "type": "object", From f1883732726812fe4ed7e5eaf980ebaaead5b349 Mon Sep 17 00:00:00 2001 From: Brendan Kellam Date: Wed, 8 Apr 2026 20:11:42 -0700 Subject: [PATCH 3/4] readme --- README.md | 56 ++++++++++++++++++++++++++++++++++++++ charts/sourcebot/README.md | 1 + 2 files changed, 57 insertions(+) diff --git a/README.md b/README.md index 7addfc1..bc1dde3 100644 --- a/README.md +++ b/README.md @@ -221,6 +221,37 @@ sourcebot: existingSecretKey: license-key ``` +## Deployment Strategy + +By default, the chart uses a `RollingUpdate` strategy, which creates the new pod before terminating the old one during upgrades. You can customize the rolling update behavior: +```yaml +sourcebot: + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 0 + maxSurge: 1 +``` + +On multi-node clusters with `ReadWriteOnce` persistent volumes, the new pod may fail to start if it gets scheduled on a different node than the old pod. To avoid this, you can pin pods to the same node using pod affinity: +```yaml +sourcebot: + affinity: + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchLabels: + app.kubernetes.io/name: sourcebot + topologyKey: kubernetes.io/hostname +``` + +Alternatively, you can use the `Recreate` strategy, which terminates the old pod before creating the new one. This avoids PVC conflicts but causes brief downtime during upgrades: +```yaml +sourcebot: + strategy: + type: Recreate +``` + ## Persistence Each component has its own persistent volume for storing data across pod restarts. @@ -325,6 +356,31 @@ sourcebot: secretName: sourcebot-tls ``` +### Zero-downtime upgrades on multi-node clusters + +Use a `ReadWriteMany` access mode so the old and new pods can mount the PVC simultaneously during rolling updates. This requires a storage class that supports `ReadWriteMany` (e.g., EFS on AWS, Filestore on GCP, Azure Files): + +```yaml +sourcebot: + persistence: + accessModes: + - ReadWriteMany + storageClass: "efs-sc" # example: AWS EFS storage class +``` + +Alternatively, you can keep `ReadWriteOnce` and use pod affinity to pin pods to the same node: + +```yaml +sourcebot: + affinity: + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchLabels: + app.kubernetes.io/name: sourcebot + topologyKey: kubernetes.io/hostname +``` + ### Using an existing PVC ```yaml diff --git a/charts/sourcebot/README.md b/charts/sourcebot/README.md index bac9c55..41c3842 100644 --- a/charts/sourcebot/README.md +++ b/charts/sourcebot/README.md @@ -130,6 +130,7 @@ Sourcebot is a self-hosted tool that helps you understand your codebase. | sourcebot.startupProbe.httpGet.path | string | `"/api/health"` | Path to check | | sourcebot.startupProbe.httpGet.port | string | `"http"` | Port to check | | sourcebot.startupProbe.periodSeconds | int | `30` | Initial delay before the first probe | +| sourcebot.strategy | object | `{"type":"RollingUpdate"}` | Deployment strategy configuration | | sourcebot.tolerations | list | `[]` | Set tolerations for pod scheduling See: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ | ---------------------------------------------- From 75dac5f73978ba676881e4d387c3ddb273501fab Mon Sep 17 00:00:00 2001 From: Brendan Kellam Date: Wed, 8 Apr 2026 20:12:58 -0700 Subject: [PATCH 4/4] changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4ca603..a37ba0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added +- Added configurable deployment strategy support, allowing users to switch between `RollingUpdate` and `Recreate` strategies. [#82](https://github.com/sourcebot-dev/sourcebot-helm-chart/pull/82) + ## [0.1.71] - 2026-04-09 ### Added