Installing GitLab Runner on a Yandex Compute Cloud VM
Written by
Updated at November 6, 2024
You can install GitLab Runner on a Compute Cloud VM. As a result, you will not need a more expensive and hard to configure Yandex Managed Service for Kubernetes cluster to install GitLab Runner.
To install GitLab Runner on a Compute Cloud VM:
If you no longer need the resources you created, delete them.
Prepare the infrastructure
- Create and activate a Managed Service for GitLab instance.
- Create a GitLab project
. - Create a VM from a public Ubuntu 22.04 LTS image.
Get a GitLab Runner token
- Open the GitLab project in your browser.
- In the left-hand menu, go Settings → CI/CD.
- Under Runners, click Expand.
- Next to New Project Runner, click
and copy the contents of the Registration token field.
Install GitLab Runner
-
Connect to the VM over SSH:
ssh <login>@<VM_public_IP_address>
-
Install the git and jq utilities:
sudo apt-get --yes install git jq
-
Add a repository with GitLab Runner to the package manager:
curl --location https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash
-
Install GitLab Runner:
sudo apt-get -y install gitlab-runner
-
Register GitLab Runner:
sudo gitlab-runner register
The command will prompt you for additional data:
- URL of the GitLab instance in
https://<domain>/
format. - Previously obtained GitLab Runner token.
- GitLab Runner description.
- Do not specify GitLab Runner tags and the update settings (
maintenance note
). executor
:shell
.
Result:
Runner registered successfully. Feel free to start it, but if it is running already the config should be automatically reloaded! Configuration (with the authentication token) was saved in "/etc/gitlab-runner/config.toml"
- URL of the GitLab instance in
Delete the resources you created
Some resources are not free of charge. Delete the resources you no longer need to avoid paying for them: