diff --git a/charts/sourcegraph/CHANGELOG.md b/charts/sourcegraph/CHANGELOG.md index ef3559ebc..a2b8fbc0d 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. - `sourcegraph.labels` and `.labels` are now also rendered on each component's ConfigMaps, Secrets, standalone PersistentVolumeClaims, ServiceAccounts, RBAC objects, PodDisruptionBudgets, and Ingress, not only on its workload, and `sourcegraph.serviceLabels`, documented but not used before, on every Service. Nothing changes unless these values are set: renders with them unset are identical. A label key set in more than one value, e.g. in both `sourcegraph.podLabels` and `sourcegraph.selectorLabelsOverride`, is now rendered once instead of twice, which Kustomize and `kubeconform -strict` rejected. **BREAKING**: the render now fails if these values set a label the chart sets itself (`app`, `deploy`, `group`, `type`, `worker-replica`, `category`, `app.kubernetes.io/component`, or a standard Helm label), or if a pod label sets `app`, `deploy`, `group`, `type`, or `worker-replica`, or gives a selector label a different value. Pod labels may set `app.kubernetes.io/component`, which the chart does not set on pods. Before, the key was rendered twice, and Helm kept the last one, so e.g. `serviceLabels` could replace `app` on a Service. Remove such keys from your values before upgrading. See [Labels](README.md#labels) - Added `frontendInternal.serviceLabels`, `frontendInternal.serviceAnnotations`, and `frontendInternal.serviceType` for the `sourcegraph-frontend-internal` Service, so it can have different labels, annotations, and type from the `sourcegraph-frontend` Service. If unset, they fall back to `frontend.serviceLabels`, `frontend.serviceAnnotations`, and `frontend.internalServiceType`, as before; set `frontendInternal.serviceLabels` or `serviceAnnotations` to `{}` for none. - Added `openTelemetry.gateway.podSecurityContext`, `openTelemetry.gateway.extraVolumes`, and `openTelemetry.gateway.extraVolumeMounts`, like other components have, so e.g. an `extraInitContainers` container can write an exporter API key to a volume the `otel-collector` container reads with `openTelemetry.gateway.command` diff --git a/charts/sourcegraph/README.md b/charts/sourcegraph/README.md index 62744503d..03045168d 100644 --- a/charts/sourcegraph/README.md +++ b/charts/sourcegraph/README.md @@ -127,6 +127,30 @@ pod labels may set them, except on `jaeger`. Services do not get `sourcegraph.labels`, because Prometheus copies a Service's labels onto the metrics it scrapes from it. +## Zoekt indexer and searchers + +Experimental: requires Sourcegraph images that include the Zoekt indexer and +searchers. + +The Zoekt indexer and searchers are a separate indexed search fleet. The +`zoekt-indexer` Deployment builds index generations and publishes them through +object storage, and the `zoekt-searcher` StatefulSet downloads and serves them. +They run next to the `indexed-search` StatefulSet, with different workload, +Service, and PVC names. + +- `zoektIndexer.enabled` and `zoektSearcher.enabled` render the two services. +- `indexedSearch.enabled` renders the `indexed-search` StatefulSet and its + Services, PodDisruptionBudget, and ServiceAccount. When it is `false`, the + frontend gets empty `INDEXED_SEARCH_SERVERS` and `INDEXED_SEARCH_INDEXER`, so + it stops looking for the removed StatefulSet, unless `frontend.env` sets them. + Kubernetes keeps a StatefulSet's PVCs after the StatefulSet is deleted, so + delete the `data-indexed-search-*` PVCs to free their disks. + +The chart does not configure the Zoekt indexer itself. It stays off until +`SRC_ZOEKT_INDEXER_ENABLED` is set, along with settings such as +`SRC_ZOEKT_SEARCHER_ROUTING` and `SRC_ZOEKT_WARM_REPLICAS`, identically in the +`env` of `frontend`, `worker`, `searcher`, `zoektSearcher`, and `zoektIndexer`. + ## Configuration Options Reference the below chart for all available configuration parameters. @@ -288,6 +312,7 @@ In addition to the documented values, all services also support the following va | grafana.storageSize | string | `"2Gi"` | PVC Storage Request for `grafana` data volume | | grafana.storageSubPath | string | `""` | Optional subPath for the `grafana` primary data volume mount | | 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) | +| 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). | | indexedSearch.env | object | the chart will add some default environment values | Environment variables for the `zoekt-webserver` container | | indexedSearch.image.defaultTag | string | `@sha256:`, pinned by each release | Docker image tag for the `zoekt-webserver` image | | indexedSearch.image.name | string | `"indexed-searcher"` | Docker image name for the `zoekt-webserver` image | @@ -565,3 +590,42 @@ In addition to the documented values, all services also support the following va | 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/) | | worker.serviceAccount.create | bool | `false` | Enable creation of ServiceAccount for `worker` | | worker.serviceAccount.name | string | `""` | Name of the ServiceAccount to be created or an existing ServiceAccount | +| zoektIndexer.args | list | `[]` | Arguments for the indexer container | +| zoektIndexer.command | list | `[]` | Command for the indexer container, replacing the image's entrypoint | +| 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). | +| zoektIndexer.env | object | `{"DEPLOY_TYPE":{"value":"helm"}}` | Environment variables for the `zoekt-indexer` container | +| zoektIndexer.image.defaultTag | string | `"{{ .Chart.AppVersion }}"` | Docker image tag for the `zoekt-indexer` image | +| zoektIndexer.image.name | string | `"zoekt-indexer"` | Docker image name for the `zoekt-indexer` image | +| zoektIndexer.image.repository | string | `""` | Override the global sourcegraph.image.repository for the `zoekt-indexer` image | +| zoektIndexer.image.tag | string | `""` | Override the tag of the `zoekt-indexer` image | +| zoektIndexer.name | string | `"zoekt-indexer"` | Name of the indexer Deployment, its metrics Service, PodDisruptionBudget, and ServiceAccount | +| zoektIndexer.podDisruptionBudget | object | `{}` | Pod disruption budget for `zoekt-indexer`. Configure either `minAvailable` or `maxUnavailable` to enable it. | +| zoektIndexer.replicaCount | int | `2` | Number of `zoekt-indexer` pods | +| zoektIndexer.resources | object | `{"limits":{"cpu":"4","memory":"4G"},"requests":{"cpu":"1","memory":"1G"}}` | Resource requests & limits for the `zoekt-indexer` container | +| 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 | +| 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 | +| 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 `-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 | +| zoektIndexer.serviceAccount.create | bool | `false` | Enable creation of ServiceAccount for `zoekt-indexer` | +| zoektIndexer.serviceAccount.name | string | `""` | Name of the ServiceAccount to be created or an existing ServiceAccount | +| zoektSearcher.args | list | `[]` | Arguments for the `zoekt-searcher` container | +| zoektSearcher.command | list | `[]` | Command for the `zoekt-searcher` container, replacing the image's entrypoint | +| 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) | +| 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 security contexts and scheduling settings. See [Zoekt indexer and searchers](#zoekt-indexer-and-searchers). | +| zoektSearcher.env | object | `{"DEPLOY_TYPE":{"value":"helm"}}` | Environment variables for the `zoekt-searcher` container | +| zoektSearcher.image.name | string | `"zoekt-searcher"` | Docker image name for the `zoekt-searcher` image. The tag defaults to the chart's appVersion. | +| zoektSearcher.image.repository | string | `""` | Override the global sourcegraph.image.repository for the `zoekt-searcher` image | +| zoektSearcher.image.tag | string | `""` | Override the tag of the `zoekt-searcher` image | +| zoektSearcher.livenessProbe | object | `{"failureThreshold":10,"initialDelaySeconds":120,"periodSeconds":60,"timeoutSeconds":5}` | Liveness probe tuning for the `zoekt-searcher` container (`/healthz` on port 6070) | +| 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`. | +| zoektSearcher.podDisruptionBudget | object | `{}` | Pod disruption budget for `zoekt-searcher`. Configure either `minAvailable` or `maxUnavailable` to enable it. | +| 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) | +| zoektSearcher.readinessProbe | object | `{"failureThreshold":3,"periodSeconds":5,"timeoutSeconds":5}` | Readiness probe tuning for the `zoekt-searcher` container (`/ready` on port 6070) | +| zoektSearcher.replicaCount | int | `2` | Number of `zoekt-searcher` pods | +| 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/) | +| zoektSearcher.serviceAccount.create | bool | `false` | Enable creation of ServiceAccount for `zoekt-searcher` | +| zoektSearcher.serviceAccount.name | string | `""` | Name of the ServiceAccount to be created or an existing ServiceAccount | +| zoektSearcher.storageAnnotations | object | `{}` | Optional annotations to add to the `zoekt-searcher` PVC | +| zoektSearcher.storageClassName | string | `""` | Storage class of the `zoekt-searcher` data volume. Defaults to `storageClass.name`. | +| 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. | +| zoektSearcher.storageSize | string | `"200Gi"` | PVC Storage Request for the `zoekt-searcher` data volume, which caches the generations a webserver serves | +| zoektSearcher.storageSubPath | string | `""` | Optional subPath for the `zoekt-searcher` primary data volume mount | diff --git a/charts/sourcegraph/README.md.gotmpl b/charts/sourcegraph/README.md.gotmpl index 0d6ef4ba0..35bca665b 100644 --- a/charts/sourcegraph/README.md.gotmpl +++ b/charts/sourcegraph/README.md.gotmpl @@ -127,6 +127,30 @@ pod labels may set them, except on `jaeger`. Services do not get `sourcegraph.labels`, because Prometheus copies a Service's labels onto the metrics it scrapes from it. +## Zoekt indexer and searchers + +Experimental: requires Sourcegraph images that include the Zoekt indexer and +searchers. + +The Zoekt indexer and searchers are a separate indexed search fleet. The +`zoekt-indexer` Deployment builds index generations and publishes them through +object storage, and the `zoekt-searcher` StatefulSet downloads and serves them. +They run next to the `indexed-search` StatefulSet, with different workload, +Service, and PVC names. + +- `zoektIndexer.enabled` and `zoektSearcher.enabled` render the two services. +- `indexedSearch.enabled` renders the `indexed-search` StatefulSet and its + Services, PodDisruptionBudget, and ServiceAccount. When it is `false`, the + frontend gets empty `INDEXED_SEARCH_SERVERS` and `INDEXED_SEARCH_INDEXER`, so + it stops looking for the removed StatefulSet, unless `frontend.env` sets them. + Kubernetes keeps a StatefulSet's PVCs after the StatefulSet is deleted, so + delete the `data-indexed-search-*` PVCs to free their disks. + +The chart does not configure the Zoekt indexer itself. It stays off until +`SRC_ZOEKT_INDEXER_ENABLED` is set, along with settings such as +`SRC_ZOEKT_SEARCHER_ROUTING` and `SRC_ZOEKT_WARM_REPLICAS`, identically in the +`env` of `frontend`, `worker`, `searcher`, `zoektSearcher`, and `zoektIndexer`. + ## Configuration Options Reference the below chart for all available configuration parameters. diff --git a/charts/sourcegraph/templates/_helpers/_zoekt.tpl b/charts/sourcegraph/templates/_helpers/_zoekt.tpl new file mode 100644 index 000000000..424c9b1e2 --- /dev/null +++ b/charts/sourcegraph/templates/_helpers/_zoekt.tpl @@ -0,0 +1,29 @@ +{{/* +Render the image reference for a Zoekt indexer or searcher image. +Usage: include "sourcegraph.zoekt.image" (list . .Values.zoektSearcher.image) +The tag defaults to the chart appVersion when the image sets no defaultTag. +*/}} +{{- define "sourcegraph.zoekt.image" -}} +{{- $top := index . 0 -}} +{{- $image := index . 1 -}} +{{- $repository := default $top.Values.sourcegraph.image.repository $image.repository -}} +{{- $defaultTag := tpl (toString (default "{{ .Chart.AppVersion }}" $image.defaultTag)) $top -}} +{{- if $top.Values.sourcegraph.image.useGlobalTagAsDefault }}{{ $defaultTag = (tpl $top.Values.sourcegraph.image.defaultTag $top) }}{{ end -}} +{{- $repository }}/{{ $image.name }}:{{ default $defaultTag $image.tag }} +{{- end }} + +{{/* +Render empty INDEXED_SEARCH_SERVERS and INDEXED_SEARCH_INDEXER for the frontend when the +indexed-search StatefulSet is not rendered. Without them the frontend falls back to discovering +the indexed-search StatefulSet, which no longer exists. Settings in frontend.env take precedence. +*/}} +{{- define "sourcegraph.indexedSearch.disabledEnv" -}} +{{- if not .Values.indexedSearch.enabled -}} +{{- range $name := list "INDEXED_SEARCH_SERVERS" "INDEXED_SEARCH_INDEXER" }} +{{- if not (hasKey $.Values.frontend.env $name) }} +- name: {{ $name }} + value: "" +{{- end }} +{{- end }} +{{- end -}} +{{- end }} diff --git a/charts/sourcegraph/templates/frontend/sourcegraph-frontend.Deployment.yaml b/charts/sourcegraph/templates/frontend/sourcegraph-frontend.Deployment.yaml index e80772e60..7f540568c 100644 --- a/charts/sourcegraph/templates/frontend/sourcegraph-frontend.Deployment.yaml +++ b/charts/sourcegraph/templates/frontend/sourcegraph-frontend.Deployment.yaml @@ -99,6 +99,7 @@ spec: {{- end }} {{- include "sourcegraph.redisConnection" .| nindent 8 }} {{- include "sourcegraph.openTelemetryEnv" . | nindent 8 }} + {{- with include "sourcegraph.indexedSearch.disabledEnv" . }}{{ . | nindent 8 }}{{- end }} terminationMessagePolicy: FallbackToLogsOnError livenessProbe: httpGet: diff --git a/charts/sourcegraph/templates/indexed-search/indexed-search.IndexerService.yaml b/charts/sourcegraph/templates/indexed-search/indexed-search.IndexerService.yaml index b575d57bc..11129b018 100644 --- a/charts/sourcegraph/templates/indexed-search/indexed-search.IndexerService.yaml +++ b/charts/sourcegraph/templates/indexed-search/indexed-search.IndexerService.yaml @@ -1,3 +1,4 @@ +{{- if .Values.indexedSearch.enabled -}} apiVersion: v1 kind: Service metadata: @@ -27,3 +28,4 @@ spec: {{- include "sourcegraph.selectorLabels" (list . .Values.indexedSearch) | nindent 4 }} app: indexed-search type: {{ .Values.indexedSearch.serviceType | default "ClusterIP" }} +{{- end }} diff --git a/charts/sourcegraph/templates/indexed-search/indexed-search.PodDisruptionBudget.yaml b/charts/sourcegraph/templates/indexed-search/indexed-search.PodDisruptionBudget.yaml index 1aca2a506..81ebaff39 100644 --- a/charts/sourcegraph/templates/indexed-search/indexed-search.PodDisruptionBudget.yaml +++ b/charts/sourcegraph/templates/indexed-search/indexed-search.PodDisruptionBudget.yaml @@ -1,4 +1,4 @@ -{{- if .Values.indexedSearch.podDisruptionBudget }} +{{- if and .Values.indexedSearch.enabled .Values.indexedSearch.podDisruptionBudget }} apiVersion: policy/v1 kind: PodDisruptionBudget metadata: diff --git a/charts/sourcegraph/templates/indexed-search/indexed-search.Service.yaml b/charts/sourcegraph/templates/indexed-search/indexed-search.Service.yaml index 748a45019..8fc658c84 100644 --- a/charts/sourcegraph/templates/indexed-search/indexed-search.Service.yaml +++ b/charts/sourcegraph/templates/indexed-search/indexed-search.Service.yaml @@ -1,3 +1,4 @@ +{{- if .Values.indexedSearch.enabled -}} apiVersion: v1 kind: Service metadata: @@ -30,3 +31,4 @@ spec: {{- include "sourcegraph.selectorLabels" (list . .Values.indexedSearch) | nindent 4 }} app: indexed-search type: {{ .Values.indexedSearch.serviceType | default "ClusterIP" }} +{{- end }} diff --git a/charts/sourcegraph/templates/indexed-search/indexed-search.ServiceAccount.yaml b/charts/sourcegraph/templates/indexed-search/indexed-search.ServiceAccount.yaml index 8a7996fd0..4f632e700 100644 --- a/charts/sourcegraph/templates/indexed-search/indexed-search.ServiceAccount.yaml +++ b/charts/sourcegraph/templates/indexed-search/indexed-search.ServiceAccount.yaml @@ -1,4 +1,4 @@ -{{- if .Values.indexedSearch.serviceAccount.create -}} +{{- if and .Values.indexedSearch.enabled .Values.indexedSearch.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount metadata: diff --git a/charts/sourcegraph/templates/indexed-search/indexed-search.StatefulSet.yaml b/charts/sourcegraph/templates/indexed-search/indexed-search.StatefulSet.yaml index a3b783555..422730785 100644 --- a/charts/sourcegraph/templates/indexed-search/indexed-search.StatefulSet.yaml +++ b/charts/sourcegraph/templates/indexed-search/indexed-search.StatefulSet.yaml @@ -1,3 +1,4 @@ +{{- if .Values.indexedSearch.enabled -}} apiVersion: apps/v1 kind: StatefulSet metadata: @@ -168,3 +169,4 @@ spec: requests: storage: {{ .Values.indexedSearch.storageSize }} storageClassName: {{ .Values.storageClass.name }} +{{- end }} diff --git a/charts/sourcegraph/templates/zoekt/zoekt-indexer.Deployment.yaml b/charts/sourcegraph/templates/zoekt/zoekt-indexer.Deployment.yaml new file mode 100644 index 000000000..5785af05e --- /dev/null +++ b/charts/sourcegraph/templates/zoekt/zoekt-indexer.Deployment.yaml @@ -0,0 +1,136 @@ +{{- if .Values.zoektIndexer.enabled -}} +{{- $indexer := .Values.zoektIndexer -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + description: Builds indexed search shards and publishes them through object storage for Zoekt searchers. + labels: + deploy: sourcegraph + app.kubernetes.io/component: zoekt-indexer + {{- include "sourcegraph.helmLabels" . | nindent 4 }} + {{- with include "sourcegraph.objectLabels" (list . .Values.zoektSearcher) }} + {{- . | nindent 4 }} + {{- end }} + name: {{ $indexer.name }} +spec: + replicas: {{ $indexer.replicaCount }} + revisionHistoryLimit: {{ .Values.sourcegraph.revisionHistoryLimit }} + selector: + matchLabels: + {{- include "sourcegraph.selectorLabels" (list . .Values.zoektSearcher) | nindent 6 }} + app: zoekt-indexer + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + type: RollingUpdate + template: + metadata: + annotations: + kubectl.kubernetes.io/default-container: zoekt-indexer + {{- if .Values.sourcegraph.podAnnotations }} + {{- toYaml .Values.sourcegraph.podAnnotations | nindent 8 }} + {{- end }} + {{- if .Values.zoektSearcher.podAnnotations }} + {{- toYaml .Values.zoektSearcher.podAnnotations | nindent 8 }} + {{- end }} + labels: + {{- include "sourcegraph.selectorLabels" (list . .Values.zoektSearcher) | nindent 8 }} + {{- with include "sourcegraph.podLabels" (list . (dict "extraSelectorLabels" .Values.zoektSearcher.extraSelectorLabels)) }} + {{- . | nindent 8 }} + {{- end }} + app: zoekt-indexer + deploy: sourcegraph + spec: + {{- include "sourcegraph.terminationGracePeriodSeconds" (list . "zoektIndexer") | nindent 6 }} + containers: + - name: zoekt-indexer + image: {{ include "sourcegraph.zoekt.image" (list . $indexer.image) }} + imagePullPolicy: {{ .Values.sourcegraph.image.pullPolicy }} + {{- with $indexer.command }} + command: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with $indexer.args }} + args: + {{- toYaml . | nindent 8 }} + {{- end }} + terminationMessagePolicy: FallbackToLogsOnError + env: + {{- range $name, $item := $indexer.env }} + - name: {{ $name }} + {{- $item | toYaml | nindent 10 }} + {{- end }} + - name: HOSTNAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: TMPDIR + value: /data + {{- include "sourcegraph.gracefulShutdownEnv" (list . "zoektIndexer") | nindent 8 }} + - name: HOME + value: /data + # The indexer deletes this directory's contents at startup. + - name: SRC_ZOEKT_INDEXER_SCRATCH_DIR + value: /data/scratch + {{- if not .Values.sourcegraph.disableKubernetesSecrets }} + {{- include "sourcegraph.databaseAuth" (list . "pgsql" "PG") | nindent 8 }} + {{- end }} + {{- include "sourcegraph.redisConnection" . | nindent 8 }} + {{- include "sourcegraph.openTelemetryEnv" . | nindent 8 }} + {{- if .Values.openTelemetry.enabled }} + - name: OPENTELEMETRY_DISABLED + value: "false" + {{- end }} + ports: + - name: http-debug + containerPort: 6060 + {{- if not .Values.sourcegraph.localDevMode }} + resources: + {{- $resources := deepCopy $indexer.resources }} + {{- if not $indexer.scratch.persistentVolume }} + {{- $_ := set $resources "requests" (merge (dict "ephemeral-storage" $indexer.scratch.size) (default (dict) $resources.requests)) }} + {{- end }} + {{- toYaml $resources | nindent 10 }} + {{- end }} + securityContext: + {{- toYaml .Values.zoektSearcher.containerSecurityContext | nindent 10 }} + volumeMounts: + - mountPath: /data + name: scratch + securityContext: + {{- toYaml .Values.zoektSearcher.podSecurityContext | nindent 8 }} + {{- include "sourcegraph.nodeSelector" (list . "zoektSearcher" ) | trim | nindent 6 }} + {{- include "sourcegraph.affinity" (list . "zoektSearcher" ) | trim | nindent 6 }} + {{- with include "sourcegraph.priorityClassName" (list . "zoektSearcher" ) | trim }}{{ . | nindent 6 }}{{- end }} + {{- include "sourcegraph.tolerations" (list . "zoektSearcher" ) | trim | nindent 6 }} + {{- with .Values.sourcegraph.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- include "sourcegraph.renderServiceAccountName" (list . "zoektIndexer") | trim | nindent 6 }} + volumes: + - name: scratch + {{- if $indexer.scratch.persistentVolume }} + ephemeral: + volumeClaimTemplate: + metadata: + labels: + deploy: sourcegraph + app.kubernetes.io/component: zoekt-indexer + spec: + accessModes: ["ReadWriteOnce"] + {{- if $indexer.scratch.storageClassName }} + storageClassName: {{ $indexer.scratch.storageClassName }} + {{- else if .Values.storageClass.create }} + storageClassName: {{ .Values.storageClass.name }}-scratch + {{- end }} + resources: + requests: + storage: {{ $indexer.scratch.size }} + {{- else }} + emptyDir: + sizeLimit: {{ $indexer.scratch.size }} + {{- end }} +{{- end }} diff --git a/charts/sourcegraph/templates/zoekt/zoekt-indexer.PodDisruptionBudget.yaml b/charts/sourcegraph/templates/zoekt/zoekt-indexer.PodDisruptionBudget.yaml new file mode 100644 index 000000000..d14857086 --- /dev/null +++ b/charts/sourcegraph/templates/zoekt/zoekt-indexer.PodDisruptionBudget.yaml @@ -0,0 +1,16 @@ +{{- if and .Values.zoektIndexer.enabled .Values.zoektIndexer.podDisruptionBudget }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + {{- with include "sourcegraph.objectLabels" (list . .Values.zoektSearcher) }} + labels: + {{- . | nindent 4 }} + {{- end }} + name: {{ .Values.zoektIndexer.name }} +spec: + {{- toYaml .Values.zoektIndexer.podDisruptionBudget | nindent 2 }} + selector: + matchLabels: + {{- include "sourcegraph.selectorLabels" (list . .Values.zoektSearcher) | nindent 6 }} + app: zoekt-indexer +{{- end }} diff --git a/charts/sourcegraph/templates/zoekt/zoekt-indexer.Service.yaml b/charts/sourcegraph/templates/zoekt/zoekt-indexer.Service.yaml new file mode 100644 index 000000000..c7a925c21 --- /dev/null +++ b/charts/sourcegraph/templates/zoekt/zoekt-indexer.Service.yaml @@ -0,0 +1,27 @@ +{{- if .Values.zoektIndexer.enabled -}} +{{- $indexer := .Values.zoektIndexer -}} +apiVersion: v1 +kind: Service +metadata: + annotations: + description: Exposes the the Zoekt indexers' metrics to Prometheus. + prometheus.io/port: "6060" + sourcegraph.prometheus/scrape: "true" + labels: + {{- with include "sourcegraph.serviceLabels" (list . (dict)) }} + {{- . | nindent 4 }} + {{- end }} + app: {{ $indexer.name }} + deploy: sourcegraph + app.kubernetes.io/component: zoekt-indexer + name: {{ $indexer.name }} +spec: + clusterIP: None + ports: + - name: http-debug + port: 6060 + targetPort: http-debug + selector: + {{- include "sourcegraph.selectorLabels" (list . .Values.zoektSearcher) | nindent 4 }} + app: zoekt-indexer +{{- end }} diff --git a/charts/sourcegraph/templates/zoekt/zoekt-indexer.ServiceAccount.yaml b/charts/sourcegraph/templates/zoekt/zoekt-indexer.ServiceAccount.yaml new file mode 100644 index 000000000..72c478de6 --- /dev/null +++ b/charts/sourcegraph/templates/zoekt/zoekt-indexer.ServiceAccount.yaml @@ -0,0 +1,14 @@ +{{- if and .Values.zoektIndexer.enabled .Values.zoektIndexer.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + {{- with include "sourcegraph.objectLabels" (list . .Values.zoektSearcher) }} + {{- . | nindent 4 }} + {{- end }} + category: rbac + deploy: sourcegraph + app.kubernetes.io/component: zoekt-indexer + {{- include "sourcegraph.serviceAccountAnnotations" (list . "zoektIndexer") | trim | nindent 2 }} + name: {{ include "sourcegraph.serviceAccountName" (list . "zoektIndexer") }} +{{- end }} diff --git a/charts/sourcegraph/templates/zoekt/zoekt-indexer.StorageClass.yaml b/charts/sourcegraph/templates/zoekt/zoekt-indexer.StorageClass.yaml new file mode 100644 index 000000000..303e640bf --- /dev/null +++ b/charts/sourcegraph/templates/zoekt/zoekt-indexer.StorageClass.yaml @@ -0,0 +1,33 @@ +{{- $scratch := .Values.zoektIndexer.scratch -}} +{{- if and .Values.zoektIndexer.enabled $scratch.persistentVolume .Values.storageClass.create (not $scratch.storageClassName) -}} +{{- /* +The indexer's scratch volumes hold nothing worth keeping, so unlike the +storageClass volumes, their disks are deleted with their claims, which go +away with their pods. +*/ -}} +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: {{ .Values.storageClass.name }}-scratch + labels: + {{- include "sourcegraph.helmLabels" . | nindent 4 }} + {{- with include "sourcegraph.userLabels" (list .Values.sourcegraph.labels) }} + {{- . | nindent 4 }} + {{- end }} + deploy: sourcegraph-storage +provisioner: {{ .Values.storageClass.provisioner }} +parameters: + {{- with .Values.storageClass.type }} + type: {{ . }} + {{- end }} + {{- if .Values.storageClass.parameters }} + {{- toYaml .Values.storageClass.parameters | nindent 2 }} + {{- end }} +allowVolumeExpansion: true +reclaimPolicy: Delete +volumeBindingMode: WaitForFirstConsumer +{{- if .Values.storageClass.allowedTopologies }} +allowedTopologies: + {{- toYaml .Values.storageClass.allowedTopologies | nindent 2 }} +{{- end }} +{{- end -}} diff --git a/charts/sourcegraph/templates/zoekt/zoekt-searcher.PodDisruptionBudget.yaml b/charts/sourcegraph/templates/zoekt/zoekt-searcher.PodDisruptionBudget.yaml new file mode 100644 index 000000000..38f6465ec --- /dev/null +++ b/charts/sourcegraph/templates/zoekt/zoekt-searcher.PodDisruptionBudget.yaml @@ -0,0 +1,16 @@ +{{- if and .Values.zoektSearcher.enabled .Values.zoektSearcher.podDisruptionBudget }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + {{- with include "sourcegraph.objectLabels" (list . .Values.zoektSearcher) }} + labels: + {{- . | nindent 4 }} + {{- end }} + name: {{ .Values.zoektSearcher.name }} +spec: + {{- toYaml .Values.zoektSearcher.podDisruptionBudget | nindent 2 }} + selector: + matchLabels: + {{- include "sourcegraph.selectorLabels" (list . .Values.zoektSearcher) | nindent 6 }} + app: zoekt-searcher +{{- end }} diff --git a/charts/sourcegraph/templates/zoekt/zoekt-searcher.Service.yaml b/charts/sourcegraph/templates/zoekt/zoekt-searcher.Service.yaml new file mode 100644 index 000000000..91832912e --- /dev/null +++ b/charts/sourcegraph/templates/zoekt/zoekt-searcher.Service.yaml @@ -0,0 +1,39 @@ +{{- if .Values.zoektSearcher.enabled -}} +apiVersion: v1 +kind: Service +metadata: + annotations: + description: Headless service that provides a stable network identity for the + zoekt-searcher stateful set. + # Zoekt searchers serve metrics on their debug port. + prometheus.io/port: "6060" + sourcegraph.prometheus/scrape: "true" + {{- if .Values.zoektSearcher.serviceAnnotations }} + {{- toYaml .Values.zoektSearcher.serviceAnnotations | nindent 4 }} + {{- end }} + labels: + {{- with include "sourcegraph.serviceLabels" (list . .Values.zoektSearcher) }} + {{- . | nindent 4 }} + {{- end }} + app: zoekt-searcher + deploy: sourcegraph + app.kubernetes.io/component: zoekt-searcher + name: zoekt-searcher +spec: + clusterIP: None + # A starting webserver reports not ready until it has loaded all its slots, + # so a rolling restart waits for it. Meanwhile the frontend already routes + # the slots it reports ready, which needs its DNS name to resolve. + publishNotReadyAddresses: true + ports: + - name: grpc + port: 6070 + targetPort: grpc + {{- with .Values.zoektSearcher.extraServicePorts }} + {{- toYaml . | nindent 2 }} + {{- end }} + selector: + {{- include "sourcegraph.selectorLabels" (list . .Values.zoektSearcher) | nindent 4 }} + app: zoekt-searcher + type: {{ .Values.zoektSearcher.serviceType | default "ClusterIP" }} +{{- end }} diff --git a/charts/sourcegraph/templates/zoekt/zoekt-searcher.ServiceAccount.yaml b/charts/sourcegraph/templates/zoekt/zoekt-searcher.ServiceAccount.yaml new file mode 100644 index 000000000..88348e779 --- /dev/null +++ b/charts/sourcegraph/templates/zoekt/zoekt-searcher.ServiceAccount.yaml @@ -0,0 +1,14 @@ +{{- if and .Values.zoektSearcher.enabled .Values.zoektSearcher.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + {{- with include "sourcegraph.objectLabels" (list . .Values.zoektSearcher) }} + {{- . | nindent 4 }} + {{- end }} + category: rbac + deploy: sourcegraph + app.kubernetes.io/component: zoekt-searcher + {{- include "sourcegraph.serviceAccountAnnotations" (list . "zoektSearcher") | trim | nindent 2 }} + name: {{ include "sourcegraph.serviceAccountName" (list . "zoektSearcher") }} +{{- end }} diff --git a/charts/sourcegraph/templates/zoekt/zoekt-searcher.StatefulSet.yaml b/charts/sourcegraph/templates/zoekt/zoekt-searcher.StatefulSet.yaml new file mode 100644 index 000000000..d29a89b35 --- /dev/null +++ b/charts/sourcegraph/templates/zoekt/zoekt-searcher.StatefulSet.yaml @@ -0,0 +1,156 @@ +{{- if .Values.zoektSearcher.enabled -}} +apiVersion: apps/v1 +kind: StatefulSet +metadata: + annotations: + description: Serves the Zoekt indexer and searchers generations that the indexers publish through object storage. + labels: + deploy: sourcegraph + app.kubernetes.io/component: zoekt-searcher + {{- include "sourcegraph.helmLabels" . | nindent 4 }} + {{- with include "sourcegraph.objectLabels" (list . .Values.zoektSearcher) }} + {{- . | nindent 4 }} + {{- end }} + name: {{ .Values.zoektSearcher.name }} +spec: + replicas: {{ .Values.zoektSearcher.replicaCount }} + revisionHistoryLimit: {{ .Values.sourcegraph.revisionHistoryLimit }} + selector: + matchLabels: + {{- include "sourcegraph.selectorLabels" (list . .Values.zoektSearcher) | nindent 6 }} + app: zoekt-searcher + serviceName: zoekt-searcher + podManagementPolicy: OrderedReady + template: + metadata: + annotations: + kubectl.kubernetes.io/default-container: zoekt-searcher + {{- if .Values.sourcegraph.podAnnotations }} + {{- toYaml .Values.sourcegraph.podAnnotations | nindent 8 }} + {{- end }} + {{- if .Values.zoektSearcher.podAnnotations }} + {{- toYaml .Values.zoektSearcher.podAnnotations | nindent 8 }} + {{- end }} + labels: + {{- include "sourcegraph.selectorLabels" (list . .Values.zoektSearcher) | nindent 8 }} + {{- with include "sourcegraph.podLabels" (list . .Values.zoektSearcher) }} + {{- . | nindent 8 }} + {{- end }} + app: zoekt-searcher + deploy: sourcegraph + spec: + {{- include "sourcegraph.terminationGracePeriodSeconds" (list . "zoektSearcher") | nindent 6 }} + {{- with .Values.zoektSearcher.extraInitContainers }} + initContainers: + {{- toYaml . | nindent 6 }} + {{- end }} + containers: + - name: zoekt-searcher + image: {{ include "sourcegraph.zoekt.image" (list . .Values.zoektSearcher.image) }} + imagePullPolicy: {{ .Values.sourcegraph.image.pullPolicy }} + {{- with .Values.zoektSearcher.command }} + command: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.zoektSearcher.args }} + args: + {{- toYaml . | nindent 8 }} + {{- end }} + terminationMessagePolicy: FallbackToLogsOnError + env: + {{- range $name, $item := .Values.zoektSearcher.env }} + - name: {{ $name }} + {{- $item | toYaml | nindent 10 }} + {{- end }} + - name: HOSTNAME + valueFrom: + fieldRef: + fieldPath: metadata.name + {{- include "sourcegraph.gracefulShutdownEnv" (list . "zoektSearcher") | nindent 8 }} + {{- if not .Values.sourcegraph.disableKubernetesSecrets }} + {{- include "sourcegraph.databaseAuth" (list . "pgsql" "PG") | nindent 8 }} + {{- end }} + {{- include "sourcegraph.redisConnection" . | nindent 8 }} + {{- include "sourcegraph.openTelemetryEnv" . | nindent 8 }} + {{- if .Values.openTelemetry.enabled }} + - name: OPENTELEMETRY_DISABLED + value: "false" + {{- end }} + ports: + - name: grpc + containerPort: 6070 + - name: http-debug + containerPort: 6060 + livenessProbe: + httpGet: + path: /healthz + port: http-debug + scheme: HTTP + initialDelaySeconds: {{ .Values.zoektSearcher.livenessProbe.initialDelaySeconds }} + timeoutSeconds: {{ .Values.zoektSearcher.livenessProbe.timeoutSeconds }} + periodSeconds: {{ .Values.zoektSearcher.livenessProbe.periodSeconds }} + failureThreshold: {{ .Values.zoektSearcher.livenessProbe.failureThreshold }} + readinessProbe: + failureThreshold: {{ .Values.zoektSearcher.readinessProbe.failureThreshold }} + httpGet: + path: /ready + port: http-debug + scheme: HTTP + periodSeconds: {{ .Values.zoektSearcher.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.zoektSearcher.readinessProbe.timeoutSeconds }} + {{- if not .Values.sourcegraph.localDevMode }} + resources: + {{- toYaml .Values.zoektSearcher.resources | nindent 10 }} + {{- end }} + securityContext: + {{- toYaml .Values.zoektSearcher.containerSecurityContext | nindent 10 }} + volumeMounts: + - mountPath: /data + name: data + {{- if .Values.zoektSearcher.storageSubPath }} + subPath: {{ .Values.zoektSearcher.storageSubPath }} + {{- end }} + {{- if .Values.zoektSearcher.extraVolumeMounts }} + {{- toYaml .Values.zoektSearcher.extraVolumeMounts | nindent 8 }} + {{- end }} + {{- if .Values.zoektSearcher.extraContainers }} + {{- toYaml .Values.zoektSearcher.extraContainers | nindent 6 }} + {{- end }} + securityContext: + {{- toYaml .Values.zoektSearcher.podSecurityContext | nindent 8 }} + {{- include "sourcegraph.nodeSelector" (list . "zoektSearcher" ) | trim | nindent 6 }} + {{- include "sourcegraph.affinity" (list . "zoektSearcher" ) | trim | nindent 6 }} + {{- with include "sourcegraph.priorityClassName" (list . "zoektSearcher" ) | trim }}{{ . | nindent 6 }}{{- end }} + {{- include "sourcegraph.tolerations" (list . "zoektSearcher" ) | trim | nindent 6 }} + {{- with .Values.sourcegraph.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- include "sourcegraph.renderServiceAccountName" (list . "zoektSearcher") | trim | nindent 6 }} + volumes: + - name: data + {{- if .Values.zoektSearcher.extraVolumes }} + {{- toYaml .Values.zoektSearcher.extraVolumes | nindent 6 }} + {{- end }} + updateStrategy: + type: RollingUpdate + volumeClaimTemplates: + - metadata: + labels: + deploy: sourcegraph + {{- with .Values.zoektSearcher.storageLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + name: data + {{- if .Values.zoektSearcher.storageAnnotations }} + annotations: + {{- toYaml .Values.zoektSearcher.storageAnnotations | nindent 8 }} + {{- end }} + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.zoektSearcher.storageSize }} + storageClassName: {{ default .Values.storageClass.name .Values.zoektSearcher.storageClassName }} +{{- end }} diff --git a/charts/sourcegraph/tests/gracefulShutdown_test.yaml b/charts/sourcegraph/tests/gracefulShutdown_test.yaml index 63691456c..68a18f859 100644 --- a/charts/sourcegraph/tests/gracefulShutdown_test.yaml +++ b/charts/sourcegraph/tests/gracefulShutdown_test.yaml @@ -123,3 +123,43 @@ tests: name: SRC_GRACEFUL_SHUTDOWN_TIMEOUT value: 15s documentIndex: 0 +- it: should render global defaults for the Zoekt searcher + template: zoekt/zoekt-searcher.StatefulSet.yaml + set: + zoektSearcher.enabled: true + asserts: + - equal: + path: spec.template.spec.terminationGracePeriodSeconds + value: 30 + - contains: + path: spec.template.spec.containers[0].env + content: + name: SRC_PRE_SHUTDOWN_PAUSE + value: 5s + - contains: + path: spec.template.spec.containers[0].env + content: + name: SRC_GRACEFUL_SHUTDOWN_TIMEOUT + value: 15s +- it: should render service overrides for the Zoekt indexer + template: zoekt/zoekt-indexer.Deployment.yaml + set: + zoektIndexer: + enabled: true + preShutdownPause: 7s + gracefulShutdownTimeout: 25s + terminationGracePeriodSeconds: 35 + asserts: + - equal: + path: spec.template.spec.terminationGracePeriodSeconds + value: 35 + - contains: + path: spec.template.spec.containers[0].env + content: + name: SRC_PRE_SHUTDOWN_PAUSE + value: 7s + - contains: + path: spec.template.spec.containers[0].env + content: + name: SRC_GRACEFUL_SHUTDOWN_TIMEOUT + value: 25s diff --git a/charts/sourcegraph/tests/labelConvention_values.yaml b/charts/sourcegraph/tests/labelConvention_values.yaml index e69388937..f09119390 100644 --- a/charts/sourcegraph/tests/labelConvention_values.yaml +++ b/charts/sourcegraph/tests/labelConvention_values.yaml @@ -84,3 +84,13 @@ pgsql: prometheus: serviceAccount: create: true +zoektIndexer: + enabled: true + podDisruptionBudget: *id001 + serviceAccount: + create: true +zoektSearcher: + enabled: true + podDisruptionBudget: *id001 + serviceAccount: + create: true diff --git a/charts/sourcegraph/tests/zoekt_test.yaml b/charts/sourcegraph/tests/zoekt_test.yaml new file mode 100644 index 000000000..1ecc221a5 --- /dev/null +++ b/charts/sourcegraph/tests/zoekt_test.yaml @@ -0,0 +1,659 @@ +suite: zoekt +release: + name: sourcegraph + namespace: sourcegraph +templates: +- indexed-search/indexed-search.StatefulSet.yaml +- indexed-search/indexed-search.IndexerService.yaml +- indexed-search/indexed-search.Service.yaml +- indexed-search/indexed-search.PodDisruptionBudget.yaml +- indexed-search/indexed-search.ServiceAccount.yaml +- zoekt/zoekt-searcher.StatefulSet.yaml +- zoekt/zoekt-searcher.Service.yaml +- zoekt/zoekt-searcher.PodDisruptionBudget.yaml +- zoekt/zoekt-searcher.ServiceAccount.yaml +- zoekt/zoekt-indexer.Deployment.yaml +- zoekt/zoekt-indexer.PodDisruptionBudget.yaml +- zoekt/zoekt-indexer.ServiceAccount.yaml +- zoekt/zoekt-indexer.Service.yaml +- zoekt/zoekt-indexer.StorageClass.yaml +- frontend/sourcegraph-frontend.Deployment.yaml +- gitserver/gitserver.StatefulSet.yaml +- worker/worker.Deployment.yaml +- searcher/searcher.StatefulSet.yaml +tests: +- it: should render no zoekt objects and the default indexed-search layout when the Zoekt services are disabled + asserts: + - hasDocuments: + count: 0 + template: zoekt/zoekt-searcher.StatefulSet.yaml + - hasDocuments: + count: 0 + template: zoekt/zoekt-searcher.Service.yaml + - hasDocuments: + count: 0 + template: zoekt/zoekt-indexer.Deployment.yaml + - hasDocuments: + count: 0 + template: zoekt/zoekt-indexer.Service.yaml + - equal: + path: metadata.name + value: indexed-search + template: indexed-search/indexed-search.StatefulSet.yaml + - lengthEqual: + path: spec.template.spec.containers + count: 2 + template: indexed-search/indexed-search.StatefulSet.yaml + - equal: + path: metadata.annotations["prometheus.io/port"] + value: "6070" + template: indexed-search/indexed-search.Service.yaml + - equal: + path: metadata.name + value: indexed-search-indexer + template: indexed-search/indexed-search.IndexerService.yaml + - notContains: + path: spec.template.spec.containers[0].env + content: + name: SRC_ZOEKT_INDEXER_ENABLED + value: "true" + template: frontend/sourcegraph-frontend.Deployment.yaml + +- it: should not render the Zoekt PodDisruptionBudgets or ServiceAccounts when the Zoekt services are disabled + set: + zoektSearcher: + podDisruptionBudget: + maxUnavailable: 1 + serviceAccount: + create: true + zoektIndexer: + podDisruptionBudget: + maxUnavailable: 1 + serviceAccount: + create: true + asserts: + - hasDocuments: + count: 0 + template: zoekt/zoekt-searcher.PodDisruptionBudget.yaml + - hasDocuments: + count: 0 + template: zoekt/zoekt-searcher.ServiceAccount.yaml + - hasDocuments: + count: 0 + template: zoekt/zoekt-indexer.PodDisruptionBudget.yaml + - hasDocuments: + count: 0 + template: zoekt/zoekt-indexer.ServiceAccount.yaml + +- it: should run both fleets with distinct names when the Zoekt services are enabled + set: + zoektSearcher: + enabled: true + zoektIndexer: + enabled: true + asserts: + - equal: + path: metadata.name + value: indexed-search + template: indexed-search/indexed-search.StatefulSet.yaml + - lengthEqual: + path: spec.template.spec.containers + count: 2 + template: indexed-search/indexed-search.StatefulSet.yaml + - equal: + path: metadata.name + value: indexed-search + template: indexed-search/indexed-search.Service.yaml + - equal: + path: metadata.annotations["prometheus.io/port"] + value: "6070" + template: indexed-search/indexed-search.Service.yaml + - equal: + path: metadata.name + value: indexed-search-indexer + template: indexed-search/indexed-search.IndexerService.yaml + - equal: + path: spec.selector.app + value: indexed-search + template: indexed-search/indexed-search.IndexerService.yaml + - equal: + path: metadata.name + value: zoekt-searcher + template: zoekt/zoekt-searcher.StatefulSet.yaml + - equal: + path: spec.serviceName + value: zoekt-searcher + template: zoekt/zoekt-searcher.StatefulSet.yaml + - equal: + path: spec.selector.matchLabels.app + value: zoekt-searcher + template: zoekt/zoekt-searcher.StatefulSet.yaml + - equal: + path: metadata.name + value: zoekt-searcher + template: zoekt/zoekt-searcher.Service.yaml + - equal: + path: spec.selector.app + value: zoekt-searcher + template: zoekt/zoekt-searcher.Service.yaml + - equal: + path: spec.publishNotReadyAddresses + value: true + template: zoekt/zoekt-searcher.Service.yaml + - equal: + path: metadata.name + value: zoekt-indexer + template: zoekt/zoekt-indexer.Deployment.yaml + - equal: + path: spec.template.metadata.labels.app + value: zoekt-indexer + template: zoekt/zoekt-indexer.Deployment.yaml + - equal: + path: metadata.name + value: zoekt-indexer + template: zoekt/zoekt-indexer.Service.yaml + - equal: + path: spec.selector.app + value: zoekt-indexer + template: zoekt/zoekt-indexer.Service.yaml + +- it: should run a single Zoekt searcher container in zoekt-searcher + set: + zoektIndexer: + enabled: true + zoektSearcher: + enabled: true + image: + repository: sg-local + tag: dev + template: zoekt/zoekt-searcher.StatefulSet.yaml + asserts: + - lengthEqual: + path: spec.template.spec.containers + count: 1 + - equal: + path: spec.template.spec.containers[0].name + value: zoekt-searcher + - equal: + path: spec.template.spec.containers[0].image + value: sg-local/zoekt-searcher:dev + - equal: + path: spec.replicas + value: 2 + - equal: + path: spec.podManagementPolicy + value: OrderedReady + - equal: + path: spec.updateStrategy.type + value: RollingUpdate + - equal: + path: spec.template.spec.terminationGracePeriodSeconds + value: 30 + - equal: + path: spec.template.spec.containers[0].readinessProbe.httpGet.path + value: /ready + - equal: + path: spec.volumeClaimTemplates[0].spec.resources.requests.storage + value: 200Gi + - notContains: + path: spec.template.spec.containers[0].env + content: + name: SRC_ZOEKT_WARM_REPLICAS + any: true + +- it: should default the webserver image tag to the chart appVersion + set: + zoektSearcher: + enabled: true + zoektIndexer: + enabled: true + chart: + appVersion: 1.2.3 + template: zoekt/zoekt-searcher.StatefulSet.yaml + asserts: + - equal: + path: spec.template.spec.containers[0].image + value: index.docker.io/sourcegraph/zoekt-searcher:1.2.3 + +- it: should apply the zoektSearcher settings to the webservers + set: + zoektIndexer: + enabled: true + zoektSearcher: + enabled: true + name: custom-searcher + replicaCount: 4 + terminationGracePeriodSeconds: 120 + storageSize: 50Gi + storageClassName: fast + storageLabels: + example.com/project: sourcegraph + podLabels: + example.com/team: search + nodeSelector: + pool: search + command: ["/bin/webserver"] + args: ["-v"] + podDisruptionBudget: + maxUnavailable: 1 + serviceAccount: + create: true + asserts: + - equal: + path: metadata.name + value: custom-searcher + template: zoekt/zoekt-searcher.StatefulSet.yaml + - equal: + path: spec.serviceName + value: zoekt-searcher + template: zoekt/zoekt-searcher.StatefulSet.yaml + - equal: + path: spec.replicas + value: 4 + template: zoekt/zoekt-searcher.StatefulSet.yaml + - equal: + path: spec.template.spec.terminationGracePeriodSeconds + value: 120 + template: zoekt/zoekt-searcher.StatefulSet.yaml + - equal: + path: spec.volumeClaimTemplates[0].spec.resources.requests.storage + value: 50Gi + template: zoekt/zoekt-searcher.StatefulSet.yaml + - equal: + path: spec.volumeClaimTemplates[0].spec.storageClassName + value: fast + template: zoekt/zoekt-searcher.StatefulSet.yaml + - equal: + path: spec.volumeClaimTemplates[0].metadata.labels["example.com/project"] + value: sourcegraph + template: zoekt/zoekt-searcher.StatefulSet.yaml + - equal: + path: spec.template.metadata.labels["example.com/team"] + value: search + template: zoekt/zoekt-searcher.StatefulSet.yaml + - equal: + path: spec.template.spec.nodeSelector.pool + value: search + template: zoekt/zoekt-searcher.StatefulSet.yaml + - equal: + path: spec.template.spec.containers[0].command + value: ["/bin/webserver"] + template: zoekt/zoekt-searcher.StatefulSet.yaml + - equal: + path: spec.template.spec.containers[0].args + value: ["-v"] + template: zoekt/zoekt-searcher.StatefulSet.yaml + - equal: + path: spec.template.spec.serviceAccountName + value: custom-searcher + template: zoekt/zoekt-searcher.StatefulSet.yaml + - notExists: + path: spec.template.spec.serviceAccountName + template: zoekt/zoekt-indexer.Deployment.yaml + - equal: + path: metadata.name + value: custom-searcher + template: zoekt/zoekt-searcher.ServiceAccount.yaml + - equal: + path: metadata.name + value: custom-searcher + template: zoekt/zoekt-searcher.PodDisruptionBudget.yaml + - equal: + path: spec.selector.matchLabels.app + value: zoekt-searcher + template: zoekt/zoekt-searcher.PodDisruptionBudget.yaml + - equal: + path: metadata.name + value: zoekt-searcher + template: zoekt/zoekt-searcher.Service.yaml + +- it: should set the indexer's own env and leave the SRC_ZOEKT settings to the operator + set: + zoektSearcher: + enabled: true + zoektIndexer: + enabled: true + asserts: + - equal: + path: spec.replicas + value: 2 + template: zoekt/zoekt-indexer.Deployment.yaml + - contains: + path: spec.template.spec.containers[0].env + content: + name: SRC_ZOEKT_INDEXER_SCRATCH_DIR + value: /data/scratch + template: zoekt/zoekt-indexer.Deployment.yaml + - notContains: + path: spec.template.spec.containers[0].env + content: + name: SRC_ZOEKT_INDEXER_ENABLED + any: true + template: zoekt/zoekt-indexer.Deployment.yaml + - notContains: + path: spec.template.spec.containers[0].env + content: + name: SRC_ZOEKT_INDEXER_ENABLED + any: true + template: zoekt/zoekt-searcher.StatefulSet.yaml + - notContains: + path: spec.template.spec.containers[0].env + content: + name: SRC_ZOEKT_INDEXER_ENABLED + any: true + template: frontend/sourcegraph-frontend.Deployment.yaml + - notContains: + path: spec.template.spec.containers[0].env + content: + name: SRC_ZOEKT_SEARCHER_ROUTING + any: true + template: frontend/sourcegraph-frontend.Deployment.yaml + - notContains: + path: spec.template.spec.containers[0].env + content: + name: SRC_ZOEKT_SEARCHER_ROUTING + any: true + template: worker/worker.Deployment.yaml + - notContains: + path: spec.template.spec.containers[0].env + content: + name: SRC_ZOEKT_SEARCHER_ROUTING + any: true + template: searcher/searcher.StatefulSet.yaml + +- it: should pass the operator's SRC_ZOEKT settings through each service's env + set: + zoektSearcher: + enabled: true + env: + SRC_ZOEKT_INDEXER_ENABLED: + value: "true" + zoektIndexer: + enabled: true + env: + SRC_ZOEKT_INDEXER_ENABLED: + value: "true" + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: SRC_ZOEKT_INDEXER_ENABLED + value: "true" + template: zoekt/zoekt-searcher.StatefulSet.yaml + - contains: + path: spec.template.spec.containers[0].env + content: + name: SRC_ZOEKT_INDEXER_ENABLED + value: "true" + template: zoekt/zoekt-indexer.Deployment.yaml + +- it: should render each Zoekt service on its own + set: + zoektIndexer: + enabled: true + zoektSearcher: + serviceAccount: + create: true + asserts: + - hasDocuments: + count: 1 + template: zoekt/zoekt-indexer.Deployment.yaml + - hasDocuments: + count: 0 + template: zoekt/zoekt-searcher.StatefulSet.yaml + - hasDocuments: + count: 0 + template: zoekt/zoekt-searcher.Service.yaml + - hasDocuments: + count: 0 + template: zoekt/zoekt-searcher.ServiceAccount.yaml + +- it: should default the indexer image tag to the chart appVersion + set: + zoektIndexer: + enabled: true + chart: + appVersion: 1.2.3 + template: zoekt/zoekt-indexer.Deployment.yaml + asserts: + - equal: + path: spec.template.spec.containers[0].image + value: index.docker.io/sourcegraph/zoekt-indexer:1.2.3 + +- it: should remove the indexed-search objects when indexedSearch.enabled is false + set: + zoektSearcher: + enabled: true + zoektIndexer: + enabled: true + indexedSearch: + enabled: false + podDisruptionBudget: + maxUnavailable: 1 + serviceAccount: + create: true + asserts: + - hasDocuments: + count: 0 + template: indexed-search/indexed-search.StatefulSet.yaml + - hasDocuments: + count: 0 + template: indexed-search/indexed-search.Service.yaml + - hasDocuments: + count: 0 + template: indexed-search/indexed-search.IndexerService.yaml + - hasDocuments: + count: 0 + template: indexed-search/indexed-search.PodDisruptionBudget.yaml + - hasDocuments: + count: 0 + template: indexed-search/indexed-search.ServiceAccount.yaml + - hasDocuments: + count: 1 + template: zoekt/zoekt-searcher.StatefulSet.yaml + - hasDocuments: + count: 1 + template: zoekt/zoekt-indexer.Deployment.yaml + +- it: should scrape zoekt metrics from the debug port + set: + zoektSearcher: + enabled: true + zoektIndexer: + enabled: true + asserts: + - equal: + path: metadata.annotations["prometheus.io/port"] + value: "6060" + template: zoekt/zoekt-searcher.Service.yaml + - equal: + path: metadata.annotations["prometheus.io/port"] + value: "6060" + template: zoekt/zoekt-indexer.Service.yaml + - equal: + path: metadata.annotations["sourcegraph.prometheus/scrape"] + value: "true" + template: zoekt/zoekt-indexer.Service.yaml + +- it: should stop the frontend from discovering indexed-search once it is removed + set: + zoektSearcher: + enabled: true + zoektIndexer: + enabled: true + indexedSearch: + enabled: false + template: frontend/sourcegraph-frontend.Deployment.yaml + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: INDEXED_SEARCH_SERVERS + value: "" + - contains: + path: spec.template.spec.containers[0].env + content: + name: INDEXED_SEARCH_INDEXER + value: "" + +- it: should keep the frontend's indexed-search discovery while indexed-search runs + set: + zoektSearcher: + enabled: true + zoektIndexer: + enabled: true + template: frontend/sourcegraph-frontend.Deployment.yaml + asserts: + - notContains: + path: spec.template.spec.containers[0].env + content: + name: INDEXED_SEARCH_SERVERS + value: "" + any: true + +- it: should let frontend.env override the indexed-search addresses once it is removed + set: + indexedSearch: + enabled: false + frontend: + env: + INDEXED_SEARCH_SERVERS: + value: "zoekt-0:6070" + template: frontend/sourcegraph-frontend.Deployment.yaml + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: INDEXED_SEARCH_SERVERS + value: "zoekt-0:6070" + - notContains: + path: spec.template.spec.containers[0].env + content: + name: INDEXED_SEARCH_SERVERS + value: "" + - contains: + path: spec.template.spec.containers[0].env + content: + name: INDEXED_SEARCH_INDEXER + value: "" + +- it: should give each indexer pod a scratch claim whose disk is deleted with it + set: + zoektSearcher: + enabled: true + zoektIndexer: + enabled: true + asserts: + - equal: + path: spec.template.spec.volumes[0].ephemeral.volumeClaimTemplate.spec + value: + accessModes: ["ReadWriteOnce"] + storageClassName: sourcegraph-scratch + resources: + requests: + storage: 100Gi + template: zoekt/zoekt-indexer.Deployment.yaml + - isNull: + path: spec.template.spec.containers[0].resources.requests.ephemeral-storage + template: zoekt/zoekt-indexer.Deployment.yaml + - equal: + path: metadata.name + value: sourcegraph-scratch + template: zoekt/zoekt-indexer.StorageClass.yaml + - equal: + path: reclaimPolicy + value: Delete + template: zoekt/zoekt-indexer.StorageClass.yaml + - equal: + path: volumeBindingMode + value: WaitForFirstConsumer + template: zoekt/zoekt-indexer.StorageClass.yaml + +- it: should use the configured scratch storage class without creating one + set: + zoektIndexer: + enabled: true + scratch: + storageClassName: fast-delete + asserts: + - equal: + path: spec.template.spec.volumes[0].ephemeral.volumeClaimTemplate.spec.storageClassName + value: fast-delete + template: zoekt/zoekt-indexer.Deployment.yaml + - hasDocuments: + count: 0 + template: zoekt/zoekt-indexer.StorageClass.yaml + +- it: should leave the scratch claim on the cluster's default storage class when the chart creates none + set: + zoektSearcher: + enabled: true + zoektIndexer: + enabled: true + storageClass: + create: false + asserts: + - notExists: + path: spec.template.spec.volumes[0].ephemeral.volumeClaimTemplate.spec.storageClassName + template: zoekt/zoekt-indexer.Deployment.yaml + - hasDocuments: + count: 0 + template: zoekt/zoekt-indexer.StorageClass.yaml + +- it: should use an emptyDir with a matching ephemeral-storage request when asked + set: + zoektIndexer: + enabled: true + scratch: + persistentVolume: false + size: 50Gi + asserts: + - equal: + path: spec.template.spec.volumes[0] + value: + name: scratch + emptyDir: + sizeLimit: 50Gi + template: zoekt/zoekt-indexer.Deployment.yaml + - equal: + path: spec.template.spec.containers[0].resources.requests + value: + cpu: "1" + memory: 1G + ephemeral-storage: 50Gi + template: zoekt/zoekt-indexer.Deployment.yaml + - hasDocuments: + count: 0 + template: zoekt/zoekt-indexer.StorageClass.yaml + +- it: should give the indexer its own ServiceAccount and PodDisruptionBudget + set: + zoektIndexer: + enabled: true + podDisruptionBudget: + maxUnavailable: 1 + serviceAccount: + create: true + annotations: + iam.gke.io/gcp-service-account: indexer@example.iam.gserviceaccount.com + asserts: + - equal: + path: spec.template.spec.serviceAccountName + value: zoekt-indexer + template: zoekt/zoekt-indexer.Deployment.yaml + - equal: + path: metadata.name + value: zoekt-indexer + template: zoekt/zoekt-indexer.ServiceAccount.yaml + - equal: + path: metadata.annotations["iam.gke.io/gcp-service-account"] + value: indexer@example.iam.gserviceaccount.com + template: zoekt/zoekt-indexer.ServiceAccount.yaml + - equal: + path: spec.maxUnavailable + value: 1 + template: zoekt/zoekt-indexer.PodDisruptionBudget.yaml + - equal: + path: spec.selector.matchLabels.app + value: zoekt-indexer + template: zoekt/zoekt-indexer.PodDisruptionBudget.yaml diff --git a/charts/sourcegraph/values.yaml b/charts/sourcegraph/values.yaml index 489e40cd8..be7ea11de 100644 --- a/charts/sourcegraph/values.yaml +++ b/charts/sourcegraph/values.yaml @@ -587,6 +587,10 @@ grafana: storageLabels: {} indexedSearch: + # -- 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). + enabled: true # -- Environment variables for the `zoekt-webserver` container # @default -- the chart will add some default environment values env: @@ -660,7 +664,6 @@ indexedSearch: # -- Labels to add to the `data` volume claim template of the `indexed-search` StatefulSet. Kubernetes does not allow # changing them on an installed StatefulSet. See [Adopting existing workloads](#adopting-existing-workloads) storageLabels: {} - indexedSearchIndexer: # -- Environment variables for the `zoekt-indexserver` container # @default -- the chart will add some default environment values @@ -692,6 +695,139 @@ indexedSearchIndexer: cpu: "4" memory: 4G +zoektIndexer: + # -- 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). + enabled: false + # -- Number of `zoekt-indexer` pods + replicaCount: 2 + # -- Name of the indexer Deployment, its metrics Service, PodDisruptionBudget, and ServiceAccount + name: "zoekt-indexer" + # -- Pod disruption budget for `zoekt-indexer`. Configure either `minAvailable` or `maxUnavailable` to enable it. + podDisruptionBudget: {} + serviceAccount: + # -- Enable creation of ServiceAccount for `zoekt-indexer` + create: false + # -- Name of the ServiceAccount to be created or an existing ServiceAccount + name: "" + # -- Environment variables for the `zoekt-indexer` container + env: + DEPLOY_TYPE: + value: helm + image: + # -- Docker image tag for the `zoekt-indexer` image + defaultTag: "{{ .Chart.AppVersion }}" + # -- Docker image name for the `zoekt-indexer` image + name: "zoekt-indexer" + # -- Override the global sourcegraph.image.repository for the `zoekt-indexer` image + repository: "" + # -- Override the tag of the `zoekt-indexer` image + tag: "" + # -- Command for the indexer container, replacing the image's entrypoint + command: [] + # -- Arguments for the indexer container + args: [] + scratch: + # -- 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 + persistentVolume: true + # -- 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 + size: 100Gi + # -- Storage class of the scratch volume's claim. Its reclaim policy should be `Delete`, so disks go away + # with their pods. Defaults to `-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 + storageClassName: "" + # -- Resource requests & limits for the `zoekt-indexer` container + resources: + limits: + cpu: "4" + memory: 4G + requests: + cpu: "1" + memory: 1G + +zoektSearcher: + # -- 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 + # security contexts and scheduling settings. See [Zoekt indexer and searchers](#zoekt-indexer-and-searchers). + enabled: false + # -- Environment variables for the `zoekt-searcher` container + env: + DEPLOY_TYPE: + value: helm + image: + # -- Docker image name for the `zoekt-searcher` image. The tag defaults to the chart's appVersion. + name: "zoekt-searcher" + # -- Override the global sourcegraph.image.repository for the `zoekt-searcher` image + repository: "" + # -- Override the tag of the `zoekt-searcher` image + tag: "" + # -- Command for the `zoekt-searcher` container, replacing the image's entrypoint + command: [] + # -- Arguments for the `zoekt-searcher` container + args: [] + # -- 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) + containerSecurityContext: + allowPrivilegeEscalation: false + runAsUser: 100 + runAsGroup: 101 + readOnlyRootFilesystem: true + # -- 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`. + name: "zoekt-searcher" + # -- Number of `zoekt-searcher` pods + replicaCount: 2 + # -- Pod disruption budget for `zoekt-searcher`. Configure either `minAvailable` or `maxUnavailable` to enable it. + podDisruptionBudget: {} + # -- Liveness probe tuning for the `zoekt-searcher` container (`/healthz` on port 6070) + livenessProbe: + failureThreshold: 10 + initialDelaySeconds: 120 + periodSeconds: 60 + timeoutSeconds: 5 + # -- Readiness probe tuning for the `zoekt-searcher` container (`/ready` on port 6070) + readinessProbe: + failureThreshold: 3 + periodSeconds: 5 + timeoutSeconds: 5 + # -- Resource requests & limits for the `zoekt-searcher` container, + # learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) + resources: + limits: + cpu: "2" + memory: 4G + requests: + cpu: 500m + memory: 2G + # -- 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) + podSecurityContext: + fsGroup: 101 + fsGroupChangePolicy: "OnRootMismatch" + serviceAccount: + # -- Enable creation of ServiceAccount for `zoekt-searcher` + create: false + # -- Name of the ServiceAccount to be created or an existing ServiceAccount + name: "" + # -- PVC Storage Request for the `zoekt-searcher` data volume, which caches the generations a webserver serves + storageSize: 200Gi + # -- Storage class of the `zoekt-searcher` data volume. Defaults to `storageClass.name`. + storageClassName: "" + # -- Optional subPath for the `zoekt-searcher` primary data volume mount + storageSubPath: "" + # -- Optional annotations to add to the `zoekt-searcher` PVC + storageAnnotations: {} + # -- Labels to add to the `data` volume claim template of the `zoekt-searcher` StatefulSet. Kubernetes does not + # allow changing them on an installed StatefulSet. + storageLabels: {} + blobstore: # -- Enable `blobstore` (S3 compatible storage) enabled: true