GitLab Runner is an open-source application written in Golang that uses GitLab CI/CD to run jobs in a pipeline. It executes the work defined in the GitLab pipeline and it is usually installed on a different server from the GitLab server. GitLab Runner can be installed in your local machine, virtual machine, cloud servers, or docker containers.
Types of GitLab Runners:
Shared Runners: These runners are available to all projects in a GitLab instance.
Specific Runners: These runners are available for a specific project.
Steps to install GitLab Runner:
- Download the package according to your server from the following link.
https://gitlab-runner-downloads.s3.amazonaws.com/latest/index.html.
- For Debian use the following command directly to download the package.
curl -LJO https://gitlab-runner-downloads.s3.amazonaws.com/latest/deb/gitlab-runner_amd64.deb
- For Red Hat or CentOs use the following command to download the package.
curl -LJO https://gitlab-runner-downloads.s3.amazonaws.com/latest/rpm/gitlab-runner_amd64.rpm
- For installing the package in Debian use the following command.
dpkg -i gitlab-runner_amd64.deb
- Now go to the GitLab dashboard and select your project.
- Go to Settings->CI/CD.
- Scroll down and click Expand for runners.
- You will see URL and Token in specific runners. These will be required for registering runner.
- Run the following command to initiate runner registration.
sudo gitlab-runner register
- Enter the GitLab instance URL and registration token number.
- Next, enter the description and tags.
- Next, we have to select an executor. The executor determines the environment in which you want to run your job.
- Now we can see our runner is available in the GitLab dashboard.
- GitLab Runner configuration is defined in config.toml file. TO edit the file use the following command.
sudo vi /etc/gitlab-runner/config.toml
Please contact our technical consultants if you want onboard Kubernetes into your infrastructure. We can share vetted Kubernetes expert profiles for your assessment.