Gitlab runner on kubernetes, how to add tags

Hello,

We have gitlab runner setup using helm chart to run on top of kubernetes (AWS EKS).
I’m trying to figure out how to automatically add certain tags to runners. When I’m looking examples from https://gitlab.com/gitlab-org/charts/gitlab-runner/blob/main/values.yaml
It says that tags: is deprecated.

How I can then set tags so that when runner pod is recreated it will automatically get certain tags?

Going thru gitlab UI and set them manually there is not very convinient because time to time gitlab-runners is re-created in k8s.
We have GitOps approach so everything is deployed to our k8s cluster with FluxCD automatically.

We use Gitlab.com Cloud.

Thanks!

1 Like

Hey kertzi, I’m facing the same issue. Have you found out how to have the tags persist?

Hi, just found this issue: Helm chart does not consider tags value (#434) · Issues · GitLab.org / charts / GitLab Runner · GitLab

Tags are now set via runners.tags: instead of tags:

1 Like

Thanks that works! Gitlab documentation needs amending.

The tags can be declared in the helm runner chart with:

runners:
    tags: "tag1, tag2"

This is also deprecated when using the runner-token. I tested it when leaving runners.tags defined, but got the error that it cannot be used. With a reference to this page:

## All these fields are DEPRECATED and the runner WILL FAIL TO START with GitLab Runner 18.0 and later if you specify them.
## If a runner authentication token is specified in runnerRegistrationToken, the registration will succeed, however the
## other values will be ignored.
runnerRegistrationToken: ""
locked: true
tags: ""
maximumTimeout: ""
runUntagged: true
protected: true

I had to readd a runner, then something fell in place. You have to obtain a runner-token by registering the instance, just like you had to obtain a runner-registration-token. When you add the runner, you have the option to add tags. By continuing you obtain the runner-token, and you have set the tag. My guess is that this will be the new way of working.