0

I have two projects in gitlab using the same gitlab-runner that I control. The first project is using kubernetes executor when running CI but the second gets "docker+machine". The .gitlab-ci.yml is nearly identical for both. Is there a way to force only the kubernetes executor?

katomaso
  • 400
  • 3
  • 10
  • 1
    compare `tags` in `.gitlab-ci.yml`, that's used to [control runner allocation](https://docs.gitlab.com/ee/ci/runners/configure_runners.html#use-tags-to-control-which-jobs-a-runner-can-run) – rkosegi Jun 21 '22 at 10:59
  • If I understood correctly, this only allows you to select a runner. But I have only one runner. The problem is, that the runner switches executors freely. I need to force it to stick with kubernetes executor. – katomaso Jun 22 '22 at 18:27

1 Answers1

0

As suggested by @rkosegi, compare tags in .gitlab-ci.yml, that's used to control runner allocation.

To set runner to run untagged jobs follow the following steps:

When you register a runner, its default behavior is to only pick tagged jobs.

To change this, you must have the Owner role for the project.

To make a runner pick untagged jobs:

  1. Go to the project’s Settings > CI/CD and expand the Runners section.

  2. Find the runner you want to pick untagged jobs and make sure it is enabled.

  3. Select the pencil button.

  4. Check the Run untagged jobs option.

  5. Select Save changes for the changes to take effect.

The runner tags list can not be empty when it’s not allowed to pick untagged jobs.

Fariya Rahmat
  • 2,123
  • 3
  • 11