Setup gitlab runner clusters on OVH Managed Kubernetes

· 20 minutes

hero-banner

After wrestling with the Gitlab runner documentation for a week while deploying our new runners cluster on a dedicated Kubernetes cluster at Packitoo, I want to share my experience, approach, and insights that will save you significant time.

One year ago, I published a blog post about deploying a gitlab bastion with docker-machine on OVH Public Cloud. As explained in that post, we had to plan for changes this year due to the permanent deprecation of docker-machine support.

We chose to continue with OVH as our cloud provider and leveraged their managed Kubernetes service to simplify our infrastructure management.

Our cluster consists of two node pools:

Requirements

Implementation

TL;DR

For quick implementation use the provided configuration, download the values.yaml from GitHub, insert your runner token, and execute the Helm installation.

Requirements for the TL;DR approach: Use gitlab.com as instance Two node pools with minimum specifications:

Otherwise, please review the detailed implementation flow

Commands to execute:

curl https://raw.githubusercontent.com/martient/gitlab-runners-kubernetes-ovh/refs/heads/main/values.yaml > template.values.yaml
sed "s/<gitlab-runner-token>/YOUR_TOKEN/g" template.values.yaml > values.yaml
kubectl create namespace gitlab-runner
helm install --namespace gitlab-runner gitlab-runner -f values.yaml gitlab/gitlab-runner

The installation should end with a success message and display your runner’s status.

Detailed Implementation

  1. First, download our template configuration file:
curl https://raw.githubusercontent.com/martient/gitlab-runners-kubernetes-ovh/refs/heads/main/values.yaml > template.values.yaml
  1. Obtain your Gitlab runner token:
    • Ensure you have Owner access to the Gitlab group or project
    • Navigate to your group/project settings
    • Select “CI/CD” from the left sidebar
    • Click “Runners”
    • Click “New project runner”

Gitlab group left bar

Gitlab runners creation button

Complete the required runner configuration:

Gitlab runner creation menu

After creation, you’ll receive a token. This is the key piece we need for our configuration.

  1. Update the configuration file using one of these methods:

Option 1: Using sed

sed "s/<gitlab-runner-token>/YOUR_TOKEN/g" template.values.yaml > values.yaml

Option 2: Manual editing Open values.yaml in your preferred editor and replace <gitlab-runner-token> with your actual token.

If you’re not using gitlab.com, update the gitlabUrl parameter located just above runnerToken.

don’t forget to rename template.value.yaml to value.yaml

  1. Customizing Node Pools:

For gitlab-manager nodes (if using a different pool name):

nodeSelector:
  nodepool: your-manager-pool-name

For runner nodes:

[runners.kubernetes.node_selector]
    nodepool = "your-runner-pool-name"
  1. Deploy
kubectl create namespace gitlab-runner
helm install --namespace gitlab-runner gitlab-runner -f values.yaml gitlab/gitlab-runner

The installation should end with a success message and display your runner’s status.

Recommendations

Docker Build Optimization

Replace standard Docker builds with Kaniko as recommended by Gitlab. Benefits include:

Resource Management