Zoekt chart
-
Introduced as a beta in GitLab 15.9 with flags named
index_code_with_zoekt
andsearch_code_with_zoekt
. Disabled by default. - Enabled on GitLab.com in GitLab 16.6.
- Feature flags
index_code_with_zoekt
andsearch_code_with_zoekt
removed in GitLab 17.1.
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 # Zoekt node disk size. Zoekt uses about three times the repository storage.
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
- Shards renamed to nodes in GitLab 16.6.
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:
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)
Zoekt can now index projects in that group after any project is updated or created.