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
{{ message }}
Repository navigation
Commit 6e9ed2f
Browse filesBrowse the repository at this point in the historyBrowse files
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
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 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.
11
12
- 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.
12
13
- Added `sourcegraph.selectorLabelsOverride`, `<serviceName>.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).
13
14
- Fixed `frontend.command` and `migrator.command` rendering a list as a single element, e.g. `["sh", "-c", "<script>"]` became `[sh -c <script>]`, so the container failed to start. Both are now rendered as YAML lists and documented in `values.yaml`. A string holding a YAML list, the only form that worked before, still renders unchanged.
Copy file name to clipboardExpand all lines: charts/sourcegraph/README.md
+61Lines changed: 61 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,6 +106,30 @@ Helm only takes over an existing object that has the
106
106
and `meta.helm.sh/release-namespace` annotations, or when installing with
107
107
`--take-ownership`(Helm 3.17 or later).
108
108
109
+
## Zoekt indexer and searchers
110
+
111
+
Experimental: requires Sourcegraph images that include the Zoekt indexer and
112
+
searchers.
113
+
114
+
The Zoekt indexer and searchers are a separate indexed search fleet. The
115
+
`zoekt-indexer`Deployment builds index generations and publishes them through
116
+
object storage, and the `zoekt-searcher` StatefulSet downloads and serves them.
117
+
They run next to the `indexed-search` StatefulSet, with different workload,
118
+
Service, and PVC names.
119
+
120
+
- `zoektIndexer.enabled`and `zoektSearcher.enabled` render the two services.
121
+
- `indexedSearch.enabled`renders the `indexed-search` StatefulSet and its
122
+
Services, PodDisruptionBudget, and ServiceAccount. When it is `false`, the
123
+
frontend gets empty `INDEXED_SEARCH_SERVERS` and `INDEXED_SEARCH_INDEXER`, so
124
+
it stops looking for the removed StatefulSet, unless `frontend.env` sets them.
125
+
Kubernetes keeps a StatefulSet's PVCs after the StatefulSet is deleted, so
126
+
delete the `data-indexed-search-*` PVCs to free their disks.
127
+
128
+
The chart does not configure the Zoekt indexer itself. It stays off until
129
+
`SRC_ZOEKT_INDEXER_ENABLED`is set, along with settings such as
130
+
`SRC_ZOEKT_SEARCHER_ROUTING`and `SRC_ZOEKT_WARM_REPLICAS`, identically in the
131
+
`env`of `frontend`, `worker`, `searcher`, `zoektSearcher`, and `zoektIndexer`.
132
+
109
133
## Configuration Options
110
134
111
135
Reference the below chart for all available configuration parameters.
@@ -264,6 +288,7 @@ In addition to the documented values, all services also support the following va
264
288
| grafana.storageSize | string | `"2Gi"` | PVC Storage Request for `grafana` data volume |
265
289
| grafana.storageSubPath | string | `""` | Optional subPath for the `grafana` primary data volume mount |
266
290
| indexedSearch.containerSecurityContext | object | `{"allowPrivilegeEscalation":false,"readOnlyRootFilesystem":true,"runAsGroup":101,"runAsUser":100}` | Security context for the `zoekt-webserver` container, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) |
291
+
| indexedSearch.enabled | bool | `true` | Enable the `indexed-search` StatefulSet (`zoekt-webserver` and `zoekt-indexserver`) and its Services, PodDisruptionBudget, and ServiceAccount. Set to `false` to remove it after searches have switched to the Zoekt indexer and searchers, see [Zoekt indexer and searchers](#zoekt-indexer-and-searchers). |
267
292
| indexedSearch.env | object | the chart will add some default environment values | Environment variables for the `zoekt-webserver` container |
268
293
| indexedSearch.image.defaultTag | string | `<appVersion>@sha256:<digest>`, pinned by each release | Docker image tag for the `zoekt-webserver` image |
269
294
| indexedSearch.image.name | string | `"indexed-searcher"` | Docker image name for the `zoekt-webserver` image |
@@ -538,3 +563,39 @@ In addition to the documented values, all services also support the following va
538
563
| worker.resources | object | `{"limits":{"cpu":"2","memory":"4G"},"requests":{"cpu":"500m","memory":"2G"}}` | Resource requests & limits for the `worker` container, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
539
564
| worker.serviceAccount.create | bool | `false` | Enable creation of ServiceAccount for `worker` |
540
565
| worker.serviceAccount.name | string | `""` | Name of the ServiceAccount to be created or an existing ServiceAccount |
566
+
| zoektIndexer.args | list | `[]` | Arguments for the indexer container |
567
+
| zoektIndexer.command | list | `[]` | Command for the indexer container, replacing the image's entrypoint |
568
+
| zoektIndexer.enabled | bool | `false` | Enable the `zoekt-indexer` Deployment, which builds indexed search shards and publishes them through object storage for the Zoekt searchers. Experimental: it does nothing until `SRC_ZOEKT_INDEXER_ENABLED` is set. See [Zoekt indexer and searchers](#zoekt-indexer-and-searchers). |
569
+
| zoektIndexer.env | object | `{"DEPLOY_TYPE":{"value":"helm"}}` | Environment variables for the `zoekt-indexer` container |
570
+
| zoektIndexer.image.defaultTag | string | `"{{ .Chart.AppVersion }}"` | Docker image tag for the `zoekt-indexer` image |
571
+
| zoektIndexer.image.name | string | `"zoekt-indexer"` | Docker image name for the `zoekt-indexer` image |
572
+
| zoektIndexer.image.repository | string | `""` | Override the global sourcegraph.image.repository for the `zoekt-indexer` image |
573
+
| zoektIndexer.image.tag | string | `""` | Override the tag of the `zoekt-indexer` image |
574
+
| zoektIndexer.name | string | `"zoekt-indexer"` | Name of the indexer Deployment and its metrics Service |
575
+
| zoektIndexer.replicaCount | int | `2` | Number of `zoekt-indexer` pods |
576
+
| zoektIndexer.resources | object | `{"limits":{"cpu":"4","memory":"4G"},"requests":{"cpu":"1","memory":"1G"}}` | Resource requests & limits for the `zoekt-indexer` container |
577
+
| zoektIndexer.scratch.persistentVolume | bool | `true` | Back each indexer pod's scratch directory, where it fetches repositories and builds shards, with its own PersistentVolumeClaim (a generic ephemeral volume). Kubernetes deletes the claim, and with a `Delete` reclaim policy its disk, when the pod goes away, such as on scale-down or a rollout. Set to `false` to use an `emptyDir` on the node's disk instead, with a matching `ephemeral-storage` request |
578
+
| zoektIndexer.scratch.size | string | `"100Gi"` | Size of the scratch volume: the claim's storage request, or the `emptyDir` size limit and `ephemeral-storage` request. Large monorepos need room for a fetch and its shards per concurrent job |
579
+
| zoektIndexer.scratch.storageClassName | string | `""` | Storage class of the scratch volume's claim. Its reclaim policy should be `Delete`, so disks go away with their pods. Defaults to `<storageClass.name>-scratch`, which the chart creates like `storageClass` but with the `Delete` reclaim policy, or to the cluster's default storage class if `storageClass.create` is false |
580
+
| zoektSearcher.args | list | `[]` | Arguments for the `zoekt-searcher` container |
581
+
| zoektSearcher.command | list | `[]` | Command for the `zoekt-searcher` container, replacing the image's entrypoint |
582
+
| zoektSearcher.containerSecurityContext | object | `{"allowPrivilegeEscalation":false,"readOnlyRootFilesystem":true,"runAsGroup":101,"runAsUser":100}` | Security context for the `zoekt-searcher` and `zoekt-indexer` containers, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) |
583
+
| zoektSearcher.enabled | bool | `false` | Enable the `zoekt-searcher` StatefulSet, which downloads and serves the shards the Zoekt indexers publish. Experimental: the frontend searches it only with `SRC_ZOEKT_INDEXER_ENABLED` set. The indexer pods share its ServiceAccount, security contexts, and scheduling settings. See [Zoekt indexer and searchers](#zoekt-indexer-and-searchers). |
584
+
| zoektSearcher.env | object | `{"DEPLOY_TYPE":{"value":"helm"}}` | Environment variables for the `zoekt-searcher` container |
585
+
| zoektSearcher.image.name | string | `"zoekt-searcher"` | Docker image name for the `zoekt-searcher` image. The tag defaults to the chart's appVersion. |
586
+
| zoektSearcher.image.repository | string | `""` | Override the global sourcegraph.image.repository for the `zoekt-searcher` image |
587
+
| zoektSearcher.image.tag | string | `""` | Override the tag of the `zoekt-searcher` image |
588
+
| zoektSearcher.livenessProbe | object | `{"failureThreshold":10,"initialDelaySeconds":120,"periodSeconds":60,"timeoutSeconds":5}` | Liveness probe tuning for the `zoekt-searcher` container (`/healthz` on port 6070) |
589
+
| zoektSearcher.name | string | `"zoekt-searcher"` | Name used by the `zoekt-searcher` StatefulSet, PodDisruptionBudget, and ServiceAccount. Does not affect service names or PVCs. The frontend finds the webservers through the StatefulSet named `zoekt-searcher` (`k8s+rpc://zoekt-searcher:6070?kind=sts`), so if you change it, also list the webservers in `SRC_ZOEKT_SEARCHERS` in `frontend.env`. |
590
+
| zoektSearcher.podDisruptionBudget | object | `{}` | Pod disruption budget for `zoekt-searcher`. Configure either `minAvailable` or `maxUnavailable` to enable it. |
591
+
| zoektSearcher.podSecurityContext | object | `{"fsGroup":101,"fsGroupChangePolicy":"OnRootMismatch"}` | Security context for the `zoekt-searcher` and `zoekt-indexer` pods, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) |
592
+
| zoektSearcher.readinessProbe | object | `{"failureThreshold":3,"periodSeconds":5,"timeoutSeconds":5}` | Readiness probe tuning for the `zoekt-searcher` container (`/ready` on port 6070) |
593
+
| zoektSearcher.replicaCount | int | `2` | Number of `zoekt-searcher` pods |
594
+
| zoektSearcher.resources | object | `{"limits":{"cpu":"2","memory":"4G"},"requests":{"cpu":"500m","memory":"2G"}}` | Resource requests & limits for the `zoekt-searcher` container, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
595
+
| zoektSearcher.serviceAccount.create | bool | `false` | Enable creation of ServiceAccount for `zoekt-searcher` and `zoekt-indexer` |
596
+
| zoektSearcher.serviceAccount.name | string | `""` | Name of the ServiceAccount to be created or an existing ServiceAccount |
597
+
| zoektSearcher.storageAnnotations | object | `{}` | Optional annotations to add to the `zoekt-searcher` PVC |
598
+
| zoektSearcher.storageClassName | string | `""` | Storage class of the `zoekt-searcher` data volume. Defaults to `storageClass.name`. |
599
+
| zoektSearcher.storageLabels | object | `{}` | Labels to add to the `data` volume claim template of the `zoekt-searcher` StatefulSet. Kubernetes does not allow changing them on an installed StatefulSet. |
600
+
| zoektSearcher.storageSize | string | `"200Gi"` | PVC Storage Request for the `zoekt-searcher` data volume, which caches the generations a webserver serves |
601
+
| zoektSearcher.storageSubPath | string | `""` | Optional subPath for the `zoekt-searcher` primary data volume mount |
0 commit comments