Usage recommendations
In this article:
Usage recommendations#
This section provides recommendations on working with the GitLab development service.
Service launch options#
Single service instance running on a virtual machine instance in the selected availability zone.
Connection to the service#
After a successful launch, the addresses and ports the GitLab service listens on can be found on its page in the Information tab. By default, the GitLab service listens on the following ports:
Service |
Protocol |
Port |
Comment |
|---|---|---|---|
API |
HTTP |
80 |
If the |
API |
HTTPS |
443 |
If the |
Container Registry |
HTTP |
5050 |
If the |
Container Registry |
HTTPS |
5050 |
If the |
Access to the service from the internet#
GitLab handles sensitive data: user accounts, repositories, webhooks, CI/CD tokens, and other secrets. If the connection is not encrypted, attackers can intercept the transmitted data. In addition, most Single Sign-On (SSO) technologies require HTTPS. For example, Google OAuth does not allow authorization over HTTP, which may make integration with it impossible. Some CI/CD services and external webhooks refuse to work with insecure HTTP servers. Therefore, we recommend running the GitLab service only with HTTPS enabled, especially if the service is intended to be publicly accessible from outside.
By default, GitLab supports automatic SSL certificate issuance via the Let’s Encrypt service. This requires that:
GitLab is accessed over HTTPS;
the GitLab domain name points to the external IP address of the GitLab instance.
In K2 Cloud, public HTTPS access to the service from the internet is provided by an internet-facing load balancer created together with the service. In addition, a special DNS zone is created in the cloud, where a CNAME record is registered for the GitLab service. According to this record, traffic is directed to the DNS name of the load balancer, for which the corresponding A record is configured.
With this configuration, Let’s Encrypt can publicly access the service from the internet, verify domain ownership, and issue a certificate.
Service monitoring#
To monitor the service, we recommend enabling the Prometheus cloud monitoring service. If you want to use your own monitoring server to check the state and health of the GitLab service, you can use the exporters built into GitLab:
Exporter |
Protocol |
Port |
Endpoint |
|---|---|---|---|
gitlab_exporter |
TCP |
9168 |
http://<private_ip>:9168/metrics |
node_exporter |
TCP |
9100 |
http://<private_ip>:9100/metrics |
postgres_exporter |
TCP |
9187 |
http://<private_ip>:9187/metrics |
redis_exporter |
TCP |
9121 |
http://<private_ip>:9121/metrics |