Skip to content

Praefect with External Gitaly is not supported

Summary

With our current logic: if Praefect is enabled, and replaceInternalGitaly=false, then we will include the gitlab.gitaly.storages template. The problem is that when replaceInternalGitaly=true (by default), that block will never be executed, and that gitlab.gitaly.storages template in the block actually includes logic for both internal and external Gitaly. This means that if replaceInternalGitaly=true, external storages can never be configured alongside Praefect.

Steps to reproduce

# test.values.yaml
global:
  gitaly:
    enabled: false
    external:
      - name: external1
        hostname: gitaly-default.infra.external
        port: 8075
    authToken:
      secret: external-gitaly-token
  praefect:
    enabled: true
    virtualStorages:
      - name: default

In this configuration, we disable Gitaly but specify an external Gitaly server along with enabling Praefect. In the storages: map, we'd expect to see both Praefect and external Gitaly storages. However, we only see Praefect:

        storages: # You must have at least a `default` storage path.

          default:
            path: /var/opt/gitlab/repo
            gitaly_address: tcp://test-praefect.default.svc:8075
            gitaly_token: "<%= File.read('/etc/gitlab/gitaly/gitaly_token_praefect').strip.dump[1..-2] %>"

Current behavior

Praefect and external Gitaly cannot be configured together.

Expected behavior

Praefect and external Gitaly should be configurable together.