Zoekt chart

Tier: Premium, Ultimate Offering: GitLab.com, Self-managed Status: Beta
History
caution
This feature is in beta and subject to change without notice. For more information, see epic 9404.

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

History
  • Shards renamed to nodes in GitLab 16.6.

To configure Zoekt for a top-level group in GitLab:

  1. Connect to the Rails console of the toolbox pod:

    kubectl exec <toolbox pod name> -it -c toolbox -- gitlab-rails console -e production
    
  2. Enable the feature flags for Zoekt:

    ::Feature.enable(:index_code_with_zoekt)
    ::Feature.enable(:search_code_with_zoekt)
    
  3. 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.

After you install and configure Zoekt, you can enable exact code search in GitLab.