GitLab runner
What it is. A program that runs CI jobs. GitLab’s shared runners are limited, so slow jobs, such as the vulnerability scan that downloads a large database, run on a runner we host. It is tagged local-docker.
Two ways to run it
Section titled “Two ways to run it”| Docker Compose | Kubernetes | |
|---|---|---|
| Folder | docker/gitlab-runner |
k8s/gitlab-runner |
| Start | docker compose up -d |
kubectl apply -f manifests/ or helm install |
| Job runs in | A container | A pod |
| Cache | Named Docker volumes | Persistent volume claims |
Settings
Section titled “Settings”Both read the same values:
| Setting | Meaning |
|---|---|
| Runner token | Lets the runner register with GitLab |
| NVD API key | Speeds up the vulnerability database download |
| SMTP user and password | Used by the report e-mail |
| Report recipient | Who receives the pipeline report |
Docker reads them from .env. Kubernetes reads them from a Secret; a template with <PLACEHOLDER> values is kept in the repository and the real copy never is.
Kubernetes details
Section titled “Kubernetes details”- A dedicated namespace, and a Role that lets the runner create job pods only in that namespace.
- A start script, kept in a ConfigMap, writes the runner’s
config.tomlfrom the Secret. - Three volumes: runner config, build cache, and the vulnerability database.
- Delivered both as plain manifests and as a Helm chart with the same result.
