From 6e9ed2f1dc9e9970a43f01c4606f01972d37ed73 Mon Sep 17 00:00:00 2001 From: Erik Seliger Date: Tue, 1 Dec 2026 00:38:58 +0000 Subject: [PATCH 1/2] Add the Zoekt indexer and searchers Adds two opt-in services next to the legacy indexed-search StatefulSet: - zoekt-indexer (zoektIndexer.enabled): a Deployment that runs index jobs and publishes generations through object storage, with a scratch PVC per pod by default or an emptyDir. - zoekt-searcher (zoektSearcher.enabled): a StatefulSet of webservers that serve the active generations of their slots. Like gitserver continuity, the Zoekt settings (SRC_ZOEKT_*) are environment variables only; the chart has no values for them. indexedSearch.enabled removes the legacy StatefulSet once searches have switched, and the frontend then gets an empty INDEXED_SEARCH_SERVERS. Amp-Thread-ID: https://ampcode.com/threads/T-597f342f-9754-47be-8f3e-3c5ffc344e41 --- charts/sourcegraph/CHANGELOG.md | 1 + charts/sourcegraph/README.md | 61 ++ charts/sourcegraph/README.md.gotmpl | 24 + .../sourcegraph/templates/_helpers/_zoekt.tpl | 29 + .../sourcegraph-frontend.Deployment.yaml | 1 + .../indexed-search.IndexerService.yaml | 2 + .../indexed-search.PodDisruptionBudget.yaml | 2 +- .../indexed-search.Service.yaml | 2 + .../indexed-search.ServiceAccount.yaml | 2 +- .../indexed-search.StatefulSet.yaml | 2 + .../zoekt/zoekt-indexer.Deployment.yaml | 136 ++++ .../zoekt/zoekt-indexer.Service.yaml | 24 + .../zoekt/zoekt-indexer.StorageClass.yaml | 30 + .../zoekt-searcher.PodDisruptionBudget.yaml | 12 + .../zoekt/zoekt-searcher.Service.yaml | 39 ++ .../zoekt/zoekt-searcher.ServiceAccount.yaml | 11 + .../zoekt/zoekt-searcher.StatefulSet.yaml | 159 +++++ .../tests/gracefulShutdown_test.yaml | 40 ++ charts/sourcegraph/tests/zoekt_test.yaml | 616 ++++++++++++++++++ charts/sourcegraph/values.yaml | 131 +++- 20 files changed, 1321 insertions(+), 3 deletions(-) create mode 100644 charts/sourcegraph/templates/_helpers/_zoekt.tpl create mode 100644 charts/sourcegraph/templates/zoekt/zoekt-indexer.Deployment.yaml create mode 100644 charts/sourcegraph/templates/zoekt/zoekt-indexer.Service.yaml create mode 100644 charts/sourcegraph/templates/zoekt/zoekt-indexer.StorageClass.yaml create mode 100644 charts/sourcegraph/templates/zoekt/zoekt-searcher.PodDisruptionBudget.yaml create mode 100644 charts/sourcegraph/templates/zoekt/zoekt-searcher.Service.yaml create mode 100644 charts/sourcegraph/templates/zoekt/zoekt-searcher.ServiceAccount.yaml create mode 100644 charts/sourcegraph/templates/zoekt/zoekt-searcher.StatefulSet.yaml create mode 100644 charts/sourcegraph/tests/zoekt_test.yaml diff --git a/charts/sourcegraph/CHANGELOG.md b/charts/sourcegraph/CHANGELOG.md index a8b444320..4b1476b5a 100644 --- a/charts/sourcegraph/CHANGELOG.md +++ b/charts/sourcegraph/CHANGELOG.md @@ -8,6 +8,7 @@ Use `**BREAKING**:` to denote a breaking change ## Unreleased +- Added the experimental `zoekt-indexer` Deployment and `zoekt-searcher` StatefulSet behind `zoektIndexer.enabled` and `zoektSearcher.enabled` (both default `false`, which renders the same manifests as before). The indexer builds index generations and publishes them through object storage, and the searchers download and serve them, next to `indexed-search`. The chart does not configure the Zoekt indexer itself: it stays off until `SRC_ZOEKT_INDEXER_ENABLED` is set in the services' `env`. Added `indexedSearch.enabled` (default `true`) to remove the `indexed-search` objects; the frontend then stops discovering them. Prometheus scrapes the searchers and indexers on port `6060`. See [Zoekt indexer and searchers](README.md#zoekt-indexer-and-searchers). Requires Sourcegraph images that include the Zoekt indexer and searchers. - The `correct-data-dir-permissions` init containers of `pgsql`, `codeintel-db`, and `codeinsights-db` now run the database's own image instead of `sourcegraph/alpine-3.14`, which was based on an end-of-life Alpine release. The chart no longer pulls `alpine-3.14`, so private registries no longer need to mirror it. `alpine.image` has been removed and is ignored if set; `alpine.containerSecurityContext`, `alpine.resources`, and `codeInsightsDB.init.containerSecurityContext` still apply. - Added `sourcegraph.selectorLabelsOverride`, `.extraSelectorLabels`, and `storageLabels` on `gitserver`, `grafana`, `indexedSearch`, and `searcher`, so the chart can render the selectors and volume claim templates of workloads created outside it, such as with Kustomize, and a Helm release can take them over without deleting them. All default to empty, so existing releases render the same selectors. Never change them on an installed release: Kubernetes does not allow changing these fields. See [Adopting existing workloads](README.md#adopting-existing-workloads). - Fixed `frontend.command` and `migrator.command` rendering a list as a single element, e.g. `["sh", "-c", "