Skip to content

Add the Zoekt indexer and searchers - #1027

Draft
eseliger wants to merge 1 commit into
mainfrom
indexed-search-continuity
Draft

eseliger wants to merge 1 commit into
mainfrom
indexed-search-continuity

Conversation

@eseliger

@eseliger eseliger commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Adds the two services of the new Zoekt indexed search architecture (sourcegraph/sourcegraph#20044) as opt-in workloads, and lets the legacy indexed-search StatefulSet be removed once searches have switched. With default values, helm template renders the same manifests as main.

Like gitserver continuity, the chart only runs the workloads. It has no values for the Zoekt settings: SRC_ZOEKT_INDEXER_ENABLED, SRC_ZOEKT_SEARCHER_ROUTING, SRC_ZOEKT_WARM_REPLICAS and the rest are plain environment variables, set the same way in the env of frontend, worker, searcher, zoektSearcher and zoektIndexer. Sourcegraph Cloud renders them from the controller (sourcegraph/controller#2893). On-prem rollout will get its own design later, so the chart doesn't encode the migration.

New values

  • zoektIndexer.enabled (default false) renders the zoekt-indexer Deployment and a headless metrics Service. It's a stateless index job runner. Each pod gets a scratch PVC by default (scratch.persistentVolume, with a StorageClass whose disks are deleted when the claim goes away), or an emptyDir when that's false. Its settings are replicaCount, image, command/args, env, scratch and resources. It uses zoektSearcher's ServiceAccount, security contexts and scheduling.
  • zoektSearcher.enabled (default false) renders the zoekt-searcher StatefulSet and headless Service, plus an optional PDB and ServiceAccount. Its values are modelled on indexedSearch. The frontend finds it at k8s+rpc://zoekt-searcher:6070?kind=sts; the Service publishes not-ready addresses, so the frontend can tell a warming webserver from a missing one.
  • indexedSearch.enabled (default true) gates every indexed-search object. When it's false, the frontend gets empty INDEXED_SEARCH_SERVERS and INDEXED_SEARCH_INDEXER, so it stops looking for the removed StatefulSet.
  • Both new services support the standard graceful shutdown values, like the other services.

The legacy indexed-search objects render exactly as on main whether the new services are on or off. That includes its image, sourcegraph/indexed-searcher, which an earlier revision of this branch had renamed by mistake.

Test plan

  • helm unittest charts/sourcegraph: 282 tests pass. tests/zoekt_test.yaml covers the default (no new objects), each service on its own and both together, scratch PVC versus emptyDir, the shared ServiceAccount, and removing indexed-search. tests/gracefulShutdown_test.yaml covers both new services.
  • helm template with defaults is byte-identical to main.
  • With both services on and indexedSearch.enabled: false, the render has the expected objects and images (zoekt-indexer, zoekt-searcher, and no indexed-search objects), and the frontend gets an empty INDEXED_SEARCH_SERVERS.
  • The services ran on the dev instance throughout the #20044 test plan, deployed by the controller.

@github-actions

Copy link
Copy Markdown

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
@eseliger
eseliger force-pushed the indexed-search-continuity branch from 091ea29 to 6e9ed2f Compare December 1, 2026 00:39
@eseliger eseliger changed the title Add opt-in indexed search continuity Add the Zoekt indexer and searchers Dec 1, 2026

This branch has not been deployed

No deployments
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.

1 participant