Using a Gitlab Dedicated Runner
Gitlab Runner
GitLab Runner is an application that works with GitLab CI/CD to run jobs in a pipeline.
You can choose to install the GitLab Runner application on infrastructure that you own or manage (Azure Hardened Subscription for example). If you do, you should install GitLab Runner on a machine that’s separate from the one that hosts the GitLab instance for security and performance reasons. When you use separate machines, you can have different operating systems and tools, like Kubernetes or Docker, on each.
Types
There are three types of runners, based on who you want to have access:
- Shared runners are for use by all projects
- Group runners are for all projects and subgroups in a group
- Specific runners are for individual projects
Registration
After installing the GitLab Runner application, you must register it to set up communication between your GitLab instance and the machine where GitLab Runner is installed.
When you register a runner, you must specify a token for the GitLab instance, group, or project. This is how the runner knows which projects it’s available for.
Tags
When you register a runner, you can add tags to it. When a CI/CD job runs, it knows which runner to use by looking at the assigned tags.
Process jobs
Runners usually process jobs on the same machine where you installed GitLab Runner. However, you can also have a runner process jobs in a container, in a Kubernetes cluster, or in auto-scaled instances in the cloud.
How to register a runner
To register a runner in your subscription we need:
- The subscription id
- the gitlab token
- the name of the runner
- the runner tag(s) (tag1,tag2)
- the size of the runner disk in Gb
- a public ssh key to connect to the runner (the runner account will be 'runneruser')
- the size of the VM (az vm list-sizes --location westeurope for the vm size list)
- For C2 only: the subnet Id
The created runner will have a docker executor. The Iaas Team must have contributor access to the subscription to create the runner.
Repository
Dedicated Gitlab runner is available in this repository