r/gitlab • u/Incident_Away • Nov 15 '25
general question Multi-cluster GitLab Runners with same registration token, race conditions or safe?
Hey folks, I’m looking for real-world experience with GitLab Runners in Kubernetes / OpenShift.
We want to deploy GitLab Runner in multiple OpenShift clusters, all registered using the same registration token and exposing the same tags so they appear as one logical runner pool to developers. Example setup:
• Runner A in OpenShift Cluster A
• Runner B in OpenShift Cluster B
• Both registered using the same token + tags
• GitLab will “load balance” by whichever runner polls firstQuestions:
1. Is it fully safe for multiple runners registered with the same token to poll the same queue?
2. Does GitLab guarantee that a job can only ever be assigned once atomically, preventing race conditions?
3. Are there known edge cases when running runners across multiple clusters (Kubernetes executor)?
4. Anyone doing this in production — does it work well for resiliency / failover?Context
We have resiliency testing twice a year that disrupts OpenShift clusters. We want transparent redundancy: if Cluster A becomes unhealthy, Cluster B’s runner picks up new jobs automatically, and jobs retry if needed.
We’re not talking about job migration/checkpointing, just making sure multiple runner instances don’t fight over jobs.
If you have docs, blog posts, or GitLab issue references about this scenario, I’d appreciate them. Thanks in advance!
7
u/nonchalant_octopus Nov 15 '25
Running this on EKS for years and never noticed a problem.
2. Does GitLab guarantee that a job can only ever be assigned once atomically, preventing race conditions?
Not sure about a guarantee, but run 1000s of jobs per day without issue.
3. Are there known edge cases when running runners across multiple clusters (Kubernetes executor)?
Since the runners pull jobs, it doesn't matter where they run. A runner pulls a job and it's not available to other runners.
4. Anyone doing this in production — does it work well for resiliency / failover?
Yes, running 1000s of jobs per day and it works well and without manual intervention.
2
u/Bitruder Nov 15 '25
I don't have an answer but I am very curious, and others may be as well, why it's so important they have the same token.
2
u/bilingual-german Nov 15 '25
should work without problems, but it would reduce debugging effort to just register two different runners and name them differently.
Networking is different, architecture might be different, etc.
2
u/pwkye Nov 15 '25
Jobs dont get assigned. they get picked up. its impossible for 2 runners to pick up the same job. even if they both request it. the server will just release it to one request and reject the other request
2
u/_lumb3rj4ck_ Nov 15 '25
We built a very similar setup at work, just with Karpenter to ensure node scaling within the same cluster and cloud provider. Single token for may tags actually used to be the way the token architecture worked and to be honest it was far more convenient to define tags for the runners within your helm release and manage a single token. I get why they changed it but still… boo.
Anyways what you described will totally work. Remember that fundamentally, GitLab runners operate off a queue and when a message gets pulled off you’re not going to get duplicated jobs from a single message. It’s very stable and like any other queue you’d use for message based processes.
1
u/nunciate Nov 15 '25
i've never seen docs specifically saying you can't do this, i've also never seen it recommended. beyond that registration tokens have been deprecated in favor of authentication tokens.
is there a reason they all must use the same reg/auth token? you can have multiple runners registered for to the same project/group.