You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(worker): support per-replica replicaCount override (#887)
## Summary
Follow-up to #582, which added support for scaling `worker` horizontally
by configuring dedicated replicas per set of jobs.
This PR adds a `replicaCount` override for each distinct worker replica.
Previously every generated worker deployment (the primary `worker` and
each dedicated `worker-N`) inherited the single top-level
`worker.replicaCount`. Now each entry under `worker.replicas` can set
its own `replicaCount`, falling back to `worker.replicaCount` when
unset.
This lets operators scale individual dedicated workers horizontally only
for jobs that are safe to scale that way.
```yaml
worker:
replicas:
- replicaCount: 3 # make sure jobs are safe to scale horizontally
jobs:
- job1
- job2
- jobs:
- job3 # inherits worker.replicaCount
```
## Changes
- `templates/_worker.tpl`: added a `$replicaCount` parameter to the
`sourcegraph.worker` helper and use it for `spec.replicas`.
- `templates/worker/worker.Deployment.yaml`: pass `worker.replicaCount`
for the primary worker, and per-replica `replicaCount` (defaulting to
`worker.replicaCount`) for each dedicated replica.
- `values.yaml`: documented the new per-replica `replicaCount` option.
- `tests/worker_test.yaml`: added tests covering the default-inheritance
and per-replica override behaviour.
- `CHANGELOG.md`: added an entry.
## Test plan
- `helm unittest charts/sourcegraph` — all 99 tests pass (7 in the
worker suite).
- `./scripts/helm-docs.sh` produces no uncommitted changes.
Slack thread:
https://sourcegraph.slack.com/archives/C0ATB8N5P3Q/p1781106413632049
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L76QgBN8t9M3gbJo5NdyZo)_
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: charts/sourcegraph/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ Use `**BREAKING**:` to denote a breaking change
8
8
9
9
## Unreleased
10
10
11
+
- Added support for overriding `replicaCount` per dedicated `worker` replica via `worker.replicas[].replicaCount`, falling back to `worker.replicaCount` when unset
11
12
- Added support for overriding the image repository on a per-service basis via `<serviceName>.image.repository`, falling back to the global `sourcegraph.image.repository` when unset
12
13
- Added livenessProbe to zoekt-webserver in indexed-search to detect and restart hung pods
13
14
- Fix Pod Disruption Budget for sourcegraph-frontend
0 commit comments