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 the feature flags for Zoekt:
::Feature.enable(:index_code_with_zoekt) ::Feature.enable(:search_code_with_zoekt)
-
Set up indexing:
# Select one of the Zoekt nodes node = ::Search::Zoekt::Node.last # Use the name of your top-level group namespace = Namespace.find_by_full_path('<top-level-group-to-index>') enabled_namespace = Search::Zoekt::EnabledNamespace.find_or_create_by(namespace: namespace) node.indices.create!(zoekt_enabled_namespace_id: enabled_namespace.id, namespace_id: namespace.id, state: :ready)
Zoekt can now index projects in that group after any project is updated or created.
Enable exact code search
After you install and configure Zoekt, you can enable exact code search in GitLab.