GitLab Runner
GitLab Runner is an application that works with GitLab CI/CD to run jobs in a pipeline.
Runners can be used to
- Automate running of linting and tests
- Build new Docker images
- Publish static HTML pages
- Compile and tag code releases
ICE Connect GitLab provides a public runner for all projects. The official GitLab.com also provides public runners but with a limited number of minutes each month. You may want to install a private runner if
- Using secret caches or passwords
- Performing jobs requiring extra resources
- Using official GitLab and you need more minutes than you get for free
Installation
Install the app through Rancher.
Your namespace should have a Container Default Resource Limit set. CPU Reservation 100m
and Memory Limit/Reservation 128Mi
should suffice. Do not set a CPU Limit.
Configure
GitLab Server
Point this to a running GitLab deployment, e.g.
https://gitlab.ice.ri.se/
https://gitlab.com/
Registration Token
Used by GitLab server to identify new runners.
For public runners: Admin Area -> CI/CD -> Runners -> Register an instance runner
For project scoped runner: Project -> Settings -> CI/CD -> Runners -> Specific runners
Similarly for group-scoped runners.
Runner Configuration
This TOML file describes what resources each spawned runner will use.
[[runners]]
[runners.kubernetes]
namespace = "{{.Release.Namespace}}"
image = "ubuntu:16.04"
cpu_request = "500m"
memory_limit = "8Gi"
memory_request = "8Gi"
[runners.cache]
Type = "s3"
Path = "runner"
Shared = true
[runners.cache.s3]
ServerAddress = "s3.ice.ri.se"
AccessKey = "YOUR_ACCESS_KEY"
SecretKey = "YOUR_SECRET_KEY"
BucketName = "YOUR_BUCKET_NAME"
BucketLocation = "none"
Insecure = false
AuthenticationType = "access-key"
The [runners.cache]
section can be deleted if no caching is needed.
Official documentation about Runner Configuration:
Read official documentation about Configuring GitLab Runner using the Helm Chart.
Then read about Using cache with configuration template to use S3 storage.
If you want to use tags for job control, read this.
Using the GitLab Runner chart lists the settings you can use in the values.yaml
file in the Helm Chart:
Official repositories
GitLab Runner Helm Chart repository
GitLab Runner Service repository
Updating the chart
Find the latest official release tag at
https://gitlab.com/gitlab-org/charts/gitlab-runner/-/tags
Clone the Helm chart repo
Default override values are defined values.yaml
Edit Chart.yaml
to use the latest tag.
Run helm dependency update
to download new charts/gitlab-runner-0.XX.0.tgz
Commit and push.
Created: 2022-12-27