Skip to content

Gitaly Chart when using praefct: Listen for prometheus connections on all IPs instead of localhost

Summary

When deploying gitlay and praefect using the gitlab helm charts the prometheus metrics endpoint of gitaly cannot be used, as it is only bound to localhost instead of 0.0.0.0. As a result, prometheus reports that the respective target(s) is/are down.

This bug was introduced somewhere between versions 4.12 and 5.1.

Pretty much same issue as #2675 (closed), but now for the gitaly pods instead of the praefect pods.

Relevant source code line: https://gitlab.com/gitlab-org/charts/gitlab/-/blob/1b2dbdb902035acda513ae4ca10a4efd1e912f7e/charts/gitlab/charts/gitaly/templates/_configmap_spec.yaml#L27

Steps to reproduce

Deploy a gitlab instance using the helm charts with preafect enabled and metrics not disabled.

Configuration used

(only the part with praefect)

  praefect:
    enabled: true
    virtualStorages:
      - name: default
        gitalyReplicas: 3
        maxUnavailable: 1
    dbSecret:
      secret: praefect.gitlab-praefect-db.credentials
      key: password
    psql:
      host: gitlab-praefect-db
      sslMode: require

Current behavior

When trying to curl port <ip of gitaly-default pod>:9236 from within the cluster I get curl: (7) Failed to connect to <ip> port 9236: Connection refused. Prometheus reports that the target is down.

Expected behavior

The endpoint should return valid metrics data. Prometheus should be able to collect metrics from the target.

Versions

  • Chart: 5.1.0
  • Platform:
    • Self-hosted: kubeadm, baremetal
  • Kubernetes: (kubectl version)
    • Client: Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.1", GitCommit:"5e58841cce77d4bc13713ad2b91fa0d961e69192", GitTreeState:"archive", BuildDate:"1980-01-01T00:00:00Z", GoVersion:"go1.16.4", Compiler:"gc", Platform:"linux/amd64"}
    • Server: Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.2", GitCommit:"f5743093fd1c663cb0cbc89748f730662345d44d", GitTreeState:"clean", BuildDate:"2020-09-16T13:32:58Z", GoVersion:"go1.15", Compiler:"gc", Platform:"linux/amd64"}
  • Helm: (helm version)
    • Client: version.BuildInfo{Version:"v3.5.4", GitCommit:"", GitTreeState:"", GoVersion:"go1.16.4"}
    • Server: None
Edited by Tim Neumann