Zoekt chart
{{< details >}}
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed
- Status: Beta
{{< /details >}}
{{< history >}}
-
Introduced as a beta in GitLab 15.9 with flags named
index_code_with_zoektandsearch_code_with_zoekt. Disabled by default. - Enabled on GitLab.com in GitLab 16.6.
- Feature flags
index_code_with_zoektandsearch_code_with_zoektremoved in GitLab 17.1.
{{< /history >}}
{{< alert type=”warning” >}}
This feature is in beta and subject to change without notice. For more information, see epic 9404.
{{< /alert >}}
The Zoekt chart provides support for
exact code search.
You can install the chart by setting gitlab-zoekt.install to true.
For more information, see gitlab-zoekt.
Enable the Zoekt chart
To enable the Zoekt chart, set the following values:
--set gitlab-zoekt.install=true \
--set gitlab-zoekt.replicas=2 \ # Number of Zoekt pods. If you want to use only one pod, you can skip this setting.
--set gitlab-zoekt.indexStorage=128Gi # Disk size for the Zoekt node. Zoekt requires up to three times the repository's default branch's storage size, depending on the number of large and binary files.
Set CPU and memory usage
You can define requests and limits for the Zoekt chart by modifying the following GitLab.com default settings:
webserver:
resources:
requests:
cpu: 4
memory: 32Gi
limits:
cpu: 16
memory: 128Gi
indexer:
resources:
requests:
cpu: 4
memory: 6Gi
limits:
cpu: 16
memory: 12Gi
gateway:
resources:
requests:
cpu: 2
memory: 512Mi
limits:
cpu: 4
memory: 1Gi
Configure Zoekt in GitLab
{{< history >}}
- Shards renamed to nodes in GitLab 16.6.
{{< /history >}}
To configure Zoekt for a top-level group in GitLab:
-
Connect to the Rails console of the toolbox pod:
kubectl exec <toolbox pod name> -it -c toolbox -- gitlab-rails console -e production - Enable exact code search.
-
Set up indexing:
{{< tabs >}}
{{< tab title=”GitLab 17.7 and later” >}}
node = ::Search::Zoekt::Node.online.last namespace = Namespace.find_by_full_path('<top-level-group-to-index>') enabled_namespace = Search::Zoekt::EnabledNamespace.find_or_create_by(namespace: namespace) replica = enabled_namespace.replicas.find_or_create_by(namespace_id: enabled_namespace.root_namespace_id) node.indices.create!(zoekt_enabled_namespace_id: enabled_namespace.id, namespace_id: namespace.id, zoekt_replica_id: replica.id){{< /tab >}}
{{< tab title=”GitLab 17.6 and earlier” >}}
node = ::Search::Zoekt::Node.online.last namespace = Namespace.find_by_full_path('<top-level-group-to-index>') enabled_namespace = Search::Zoekt::EnabledNamespace.find_or_create_by(namespace: namespace) replica = enabled_namespace.replicas.find_or_create_by(namespace_id: enabled_namespace.root_namespace_id) replica.ready! node.indices.create!(zoekt_enabled_namespace_id: enabled_namespace.id, namespace_id: namespace.id, zoekt_replica_id: replica.id, state: :ready){{< /tab >}}
{{< /tabs >}}
Zoekt can now index projects in that group after any project is updated or created. For the initial indexing, wait at least a few minutes for Zoekt to start indexing the namespace.