Gitlab Runner Setup

guides/runner/runner.png

Config

Runner Token

Get the runner registration token from your group CICD settings in Gitlab

CHANGE TO YOUR RUNNER TOKEN IN values.yaml

1runnerRegistrationToken: "token"

Tags

Set the tags

1tags: "tag1,tag2"

Config

Default Images and executor optional add s3 cache

 1runners:
 2  # runner configuration, where the multi line strings is evaluated as
 3  # template so you can specify helm values inside of it.
 4  #
 5  # tpl: https://helm.sh/docs/howto/charts_tips_and_tricks/#using-the-tpl-function
 6  # runner configuration: https://docs.gitlab.com/runner/configuration/advanced-configuration.html
 7  config: |
 8    [[runners]]
 9      url = "https://gitlab.com"
10      executor = "kubernetes"
11      [runners.kubernetes]
12        request_concurrency = 5
13        image = "alpine:latest"
14    #   [runners.cache]
15    #     Type = "s3"
16    #     Shared = true
17    #     [runners.cache.s3]
18    #       ServerAddress = "s3.url"
19    #       BucketName = "runner"
20    #       BucketLocation = "us-west-1"
21    #       Insecure = true
22    #       AuthenticationType = "access-key"    

Helm

Add the Repo

1helm repo add gitlab https://charts.gitlab.io

Get the Default values.yml here!

Deploy

Install

1helm install --namespace default gitlab-runner -f values.yaml gitlab/gitlab-runner

If you need to Update the runner

Upgrade

1helm upgrade --namespace default gitlab-runner -f values.yaml gitlab/gitlab-runner 

set tags

  • viewscape
  • k8s