Configuring a Custom Port for GitLab Container Registry in Helm Deployments
Description
When deploying GitLab with Helm, you may need to run the container registry on a custom port due to infrastructure constraints or port conflicts. By default, the registry uses port 5000. This guide shows how to configure a custom registry port via Helm values to align with your environment.
Impacted offerings:
- GitLab Self-Managed
Prerequisites
A terminal with helm
and kubectl
installed and configured to access your Kubernetes cluster.
Solution
In our example, we are going to configure the GitLab Registry to listen on port 5011. This change involves a two step process.
-
Configuring the GitLab Registry Service to expose port 5011
We achieve this by setting the
registry.service.externalPort
key to the desired value -
Configure other GitLab components to connect to port 5011
We achieve this by setting the
global.registry.api.port
key to the desired value
The full configuration will look like this:
global: registry: api: port: 5011 registry: service: externalPort: 5011
To adapt this to your use case, patch your values.yml
file to include these keys and then run the helm upgrade
command, targeting the current chart version:
helm upgrade --install <release-name> gitlab/gitlab -f <values.yaml> -n <namespace> --version <chart-version>