Skip to main content
General product information Cloud Server with GitLab
Last update:

General product information Cloud Server with GitLab

GitLab is an open source platform for storing project repositories and automating CI/CD with built-in pipelines and bug tracking. GitLab supports the full CI/CD cycle — continuous integration, build, testing, and deployment of code.

To work with GitLab CI/CD, you can create a cloud server with GitLab with a ready-made operating system image.

Optionally, you can create a cloud server with GitLab Runner. GitLab Runner is open source software, used to automate and execute tasks (pipelines) in GitLab CI/CD. Works as an agent that sequentially executes the steps defined in the pipelines tasks. Allows you to run build, test and deploy applications automatically, managing the entire process of CI/CD tasks in GitLab.

When you create a cloud server with GitLab, a free TLS certificate from Let's Encrypt® will be automatically issued for the domain you specify. For cloud servers with GitLab and GitLab Runner, you can configure automatic scheduled backups. From the backup, you can restore server disk.

Cost

When using a cloud server with GitLab and GitLab Runner, only computing resources of the cloud server are paid for using cloud-platform-payment-model.

Before creating a server, top-up balance.

Prices for computing resources can be viewed at selectel.ru.

Create and configure a cloud server with GitLab

To create and configure a cloud server with GitLab, you need a domain and a public IP address so that the cloud server can be accessed from the internet. The domain can be added to DNS-hosted Selectel.

You can create a standard configuration cloud server with automatic PostgreSQL database creation on the server or connect cloud PostgreSQL database.

  1. Create a public IP address for the cloud server.

2. In control panel, add the domain to DNS hosting (legacy). 3. Delegate the domain. To do this, specify Selectel NS-servers in your domain registrar's domain NS-records: ns1.selectel.ru, ns2.selectel.ru, ns3.selectel.ru, ns4.selectel.ru. 4. Add an A-record for the domain using the Add Resource Record instructions (DNS hosting (legacy) tab). In the entry value, specify the public IP address that you created in step 1.

5. In Control Panel, go to Cloud PlatformServers. 6. Click Create Server. 7. Select a pre-built Cloud GitLab image <version>. 8. If the number of GitLab users is less than 500, select cloud server configuration with a vCPU of 4 cores or more, RAM of 8 GB or more, and a boot disk size (local or network) of 20 GB or more.

If the number of users is greater than 500, see [system requirements](https://docs.gitlab.com/ee/install/requirements.html) in the official GitLab documentation.
  1. Add an additional disk of 30 GB or more to the server. The additional disk is required to run GitLab and is used to store basic data such as database, repositories.

  2. Select private subnet that is connected to the cloud router with access to the external network, and connect the public IP address you created in step 1.

  3. Place the SSH key on the server — password access to the server is disabled in the image. Multiple keys can be added. Key types supported are ed25519, rsa, ecdsa and dsa. Select an existing key or click Add SSH Key. Enter a key name and insert a public SSH key in OpenSSH format. Press Add.

    In the image, the SSH port has been changed to 22022.

  4. In the User data field, insert the script that will be executed when the system boots:

    #cloud-config

    write_files:
    - path: "/opt/gomplate/values/user-values.yaml"
    permissions: "0644"
    content: |
    gitlabDomain: "<example.com>"
    gitlabRootEmail: "<root@example.com>"
    gitlabRootPassword: "<administrator_password>"
    gitlabPostgresDB: "<database_name>"
    gitlabPostgresUser: "<database_user_name>"
    gitlabPostgresPassword: "<database_user_password>"
    useExternalDB: false

    Specify:

    • <example.com> is the domain for which a TLS certificate from Let's Encrypt® will be automatically issued;
    • <root@example.com> is the email address of the GitLab administrator;
    • <administrator_password> is the password for the GitLab administrator. Must be more than eight characters;
    • <database_name> is the name of the PostgreSQL database;
    • <database_user_name> is the user name of the PostgreSQL database;
    • <database_user_password> — PostgreSQL database user password.
  5. Press Create. Setting up the image will take a few minutes.

Create a cloud server with GitLab Runner

  1. Create a registration token for GitLab Runner following the Create a project runner with a runner authentication token instructions in the official GitLab documentation.

  2. In Control Panel, go to Cloud PlatformServers.

  3. Click Create Server.

  4. Select the pre-built image Cloud GitLab Runner <version>.

  5. Select cloud server configuration with vCPU of 2 cores or more, RAM of 2GB.

  6. Place the SSH key on the server — password access to the server is disabled in the image. Multiple keys can be added. Key types supported are ed25519, rsa, ecdsa and dsa. Select an existing key or click Add SSH Key. Enter a key name and insert a public SSH key in OpenSSH format. Press Add.

  7. In the User data field, insert the script that will be executed when the system boots:

    #cloud-config

    write_files:
    - path: "/opt/gomplate/values/user-values.yaml"
    permissions: "0644"
    content: |
    gitlabURL: "<gitlab_server_url>"
    token: "<runner_token>"

    Specify:

    • <gitlab_server_url> — URL of the server with GitLab to which GitLab Runner connects;
    • <runner_token> is the GitLab Runner registration token that you created in step 1.
  8. Press Create.