diff --git a/templates/gitlab-multi-runner/1/docker-compose.yml b/templates/gitlab-multi-runner/1/docker-compose.yml.tpl similarity index 89% rename from templates/gitlab-multi-runner/1/docker-compose.yml rename to templates/gitlab-multi-runner/1/docker-compose.yml.tpl index f0cabfc..a765ee8 100644 --- a/templates/gitlab-multi-runner/1/docker-compose.yml +++ b/templates/gitlab-multi-runner/1/docker-compose.yml.tpl @@ -27,7 +27,6 @@ services: - /var/run/docker.sock:/var/run/docker.sock - --docker-privileged labels: - io.rancher.container.pull_image: always io.rancher.container.start_once: 'true' gitlab-runner: @@ -42,5 +41,7 @@ services: - run labels: io.rancher.sidekicks: gitlab-runner-config - io.rancher.container.pull_image: always io.rancher.scheduler.global: 'true' + {{- if ne .Values.host_label ""}} + io.rancher.scheduler.affinity:host_label: ${host_label} + {{- end}} diff --git a/templates/gitlab-multi-runner/1/rancher-compose.yml b/templates/gitlab-multi-runner/1/rancher-compose.yml index e2c9479..4c737e4 100644 --- a/templates/gitlab-multi-runner/1/rancher-compose.yml +++ b/templates/gitlab-multi-runner/1/rancher-compose.yml @@ -29,9 +29,17 @@ catalog: default: "dev" required: false + - variable: "host_label" + label: "Host with Label to deploy gitlab-runner on" + description: | + Host label to use as gitlab-runner 'value' tag. + Example: 'gitlab-runner=true' + type: "string" + default: "" + required: false + services: gitlab-runner-config: - scale: 1 start_on_create: true gitlab-runner: start_on_create: true