GitLab Runner image replacement

Hi GitLab family,

We are running GitLab Runner in the Kubernetes Cluster, and our Kubernetes Cluster is deployed on the VMware Tanzu-Kubernetes infrastructure.
We have just created our gitlab runners with an official way. Deploying a GitLab Runner instance into the Kubernetes cluster is by using the gitlab-runner Helm chart. It was successful.

helm install --namespace <NAMESPACE> gitlab-runner -f <CONFIG_VALUES_FILE> **gitlab/gitlab-runner**

The gitlab runner image is mapped by helm chart correctly.

helm search repo -l gitlab/gitlab-runner

NAME                  CHART VERSION APP VERSION DESCRIPTION
gitlab/gitlab-runner  0.64.0        16.11.0     GitLab Runner

After creation we have recognized the default OS image of deploying GitLab-runner is operating whtin alphine Linux
We would like to replace the runner OS image with ubuntu as a default.

What is the correct procedure to replace the runner image? I cannot find any config.toml in our instance becasue that file is associated with internally connected kubernetes connection within GitLab instance. Our Kubernetes is loacted on vmware and I am enabled to connect Kubernetes with API and required configuraiotn including runner Token, rbac and URL. All connections are established, and working properly.

I think that I have to use a configuration template file and introduce new image in values.yaml

runners:
  config: |
    [[runners]]
      [runners.kubernetes]
        image = "ubuntu:22.04"

Where do I have to create this values.yaml file and how should I active this?
From the installaion command by helm chart should I have new image directly?

helm install --namespace <NAMESPACE> gitlab-runner -f <CONFIG_VALUES_FILE_UBUNTU> **gitlab/gitlab-runner**

Are there some reference to replace runner image in values.yaml?

Best regards,
Donghee

Hi Donghee,

To replace the default OS image of GitLab Runner with Ubuntu using the Helm chart, you’re on the right track with using a values.yaml file. Here’s how you can proceed:

  1. Create a values.yaml File: You can create a values.yaml file where you define your configuration overrides. This file should be structured like this to specify the Ubuntu image:

yaml

Copy code

runners:
  config: |
    [[runners]]
      [runners.kubernetes]
        image = "ubuntu:22.04"

Make sure to replace <NAMESPACE> and <CONFIG_VALUES_FILE_UBUNTU> with the actual values relevant to your Kubernetes namespace and configuration file for Ubuntu.
2. Specify the Configuration File: After creating values.yaml with the above content, you can use it during the Helm installation command to apply these configurations:

bash

Copy code

helm install --namespace <NAMESPACE> gitlab-runner -f values.yaml gitlab/gitlab-runner

This command will install GitLab Runner into your Kubernetes cluster using the configurations specified in values.yaml, including the Ubuntu image for the runners.
3. Verification and Deployment: Once Helm completes the deployment, verify that the GitLab Runner pods are using the Ubuntu image by checking the pod specifications or using kubectl.
4. Additional Considerations:

  • Ensure that the gitlab/gitlab-runner Helm chart version (0.64.0 in your case) supports overriding the runner image in this manner.
  • If you encounter any issues, refer to the Helm chart documentation or GitLab Runner documentation for further troubleshooting steps.

By following these steps, you should be able to successfully replace the GitLab Runner OS image with Ubuntu as the default.

1 Like