Skip to content

Feat: add support for deployment strategy#82

Merged
brendan-kellam merged 5 commits intosourcebot-dev:mainfrom
alekc:deployment-strategy
Apr 9, 2026
Merged

Feat: add support for deployment strategy#82
brendan-kellam merged 5 commits intosourcebot-dev:mainfrom
alekc:deployment-strategy

Conversation

@alekc
Copy link
Copy Markdown
Contributor

@alekc alekc commented Mar 29, 2026

Sourcebot mounts a PersistentVolumeClaim for its /data directory. The most common PVC storage class access mode is ReadWriteOnce (RWO), which allows the volume to be mounted by only one node at a time.

With the default RollingUpdate strategy, Kubernetes starts the new pod before terminating the old one. When both pods attempt to bind the same RWO volume simultaneously, the new pod gets stuck in Pending or ContainerCreating.

This makes rolling updates effectively broken for single-node PVC setups — which is the majority of self-hosted deployments.

What this PR does

  • Adds a sourcebot.strategy value to configure the Kubernetes deployment strategy
  • Defaults to RollingUpdate (Kubernetes default, correct for RWX volumes or no persistence)
  • Users with RWO volumes can now switch to Recreate to ensure the old pod is fully terminated before the new one starts, allowing the volume to detach cleanly
sourcebot:
  strategy:
    type: Recreate

Impact: no breaking change, default behaviour is maintained with type: RollingUpdate

Fixes #83

Summary by CodeRabbit

  • New Features
    • Added configurable deployment strategy support, letting users choose RollingUpdate or Recreate with sensible defaults.
  • Documentation
    • Added docs and examples explaining deployment strategy options, upgrade behavior, and guidance for zero-downtime upgrades on multi-node clusters.
  • Chores
    • Updated chart values schema and changelog to reflect the new strategy configuration.

… configuration

Signed-off-by: Alexander Chernov <alexander@chernov.it>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f2e90db4-e760-4767-bf6a-8fd36ec2e73f

📥 Commits

Reviewing files that changed from the base of the PR and between 741712a and 75dac5f.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • README.md
  • charts/sourcebot/README.md
✅ Files skipped from review due to trivial changes (3)
  • CHANGELOG.md
  • charts/sourcebot/README.md
  • README.md

Walkthrough

The Helm chart adds a configurable sourcebot.strategy value, validates it in the chart JSON schema, and conditionally renders a spec.strategy block in the Deployment template. Documentation and changelog entries were added to describe the new configuration.

Changes

Cohort / File(s) Summary
Deployment Template
charts/sourcebot/templates/deployment.yaml
Conditionally emit spec.strategy when sourcebot.strategy is set; rendered via toYaml with proper indentation.
Values Schema
charts/sourcebot/values.schema.json
Add sourcebot.strategy schema with oneOf branches for RollingUpdate (optional rollingUpdate) and Recreate, constraining type values.
Values Defaults
charts/sourcebot/values.yaml
Introduce sourcebot.strategy default block set to type: RollingUpdate (plus minor whitespace cleanup).
Documentation & Changelog
CHANGELOG.md, README.md, charts/sourcebot/README.md
Document the new sourcebot.strategy value, describe deployment strategy behavior and zero-downtime guidance for multi-node clusters; add changelog entry for the feature.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main feature addition: support for configurable deployment strategy in the Helm chart.
Linked Issues check ✅ Passed The PR fully addresses issue #83 objectives: exposes sourcebot.strategy in Deployment template, adds schema/values configuration with RollingUpdate default, and supports both RollingUpdate and Recreate types for single-replica RWO workloads.
Out of Scope Changes check ✅ Passed All changes directly support deployment strategy configuration: template logic, values schema, defaults, changelog, and documentation. No extraneous modifications detected beyond the stated objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@charts/sourcebot/values.schema.json`:
- Around line 39-50: The schema currently allows a "strategy" object with "type"
and "rollingUpdate" together even when "type" is "Recreate"; update the
"strategy" definition to validate that "rollingUpdate" is only permitted when
"type" is "RollingUpdate" (e.g., replace the loose properties with a
conditional/oneOf rule using "if": {"properties": {"type": {"const":
"Recreate"}}}, "then": {"not": {"required": ["rollingUpdate"]}} or equivalent,
or use oneOf branches for the two strategy shapes) so that the "strategy" object
rejects any object that has type "Recreate" and a "rollingUpdate" property while
still allowing "rollingUpdate" when type is "RollingUpdate".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 80eb5c3e-3cae-4a2c-957b-c2cd0649cd2d

📥 Commits

Reviewing files that changed from the base of the PR and between cc8e9b1 and 3cdbb59.

📒 Files selected for processing (4)
  • charts/sourcebot/Chart.yaml
  • charts/sourcebot/templates/deployment.yaml
  • charts/sourcebot/values.schema.json
  • charts/sourcebot/values.yaml

@brendan-kellam
Copy link
Copy Markdown
Contributor

@alekc thanks for the PR! will take a look today

Copy link
Copy Markdown
Contributor

@brendan-kellam brendan-kellam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm thanks for your contribution!

@brendan-kellam brendan-kellam merged commit b25c1ef into sourcebot-dev:main Apr 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deploymentStrategy not configurable — causes data loss with ReadWriteOnce persistent storage

2 participants