2

I’ve got an AWS gitlab instance successfully doing CI with gitlab-runners running under vagrant on my local dev machine. I’d like to move the runners off my machine and onto a standalone server...

I’ve put Rancher on a box and can get the gitlab runner installed, but I can’t get my head around how to not do docker-in-docker, or whether this actually matters.

My understanding is that unless I do _some_configuration_I_don’t_know_ that Rancher runs the gitlab-runner as a Docker container, and the gitlab runner will in turn start a docker container inside itself to run my CI test environment as specified in the .gitlab-ci.yml

Is there a way to get the gitlab-runner to tell Rancher to start the CI test environment instead?

1

The short answer is "it depends". Rancher itself runs using system-docker and the docker instances it starts for you, such as gitlab-runner are run separately in regular docker. Gitlab-runner then will start runners depending on its configuration:

There are three methods to enable the use of... docker run during jobs; each with their own tradeoffs.

https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#runner-configuration

My eventual solution

I'd initially installed Rancher 1.6 and just couldn't get the dependencies working (Rancher OS running Rancher 1.6 and Rancher agent running on a couple of Alpine nodes).

The upgrade to Rancher v2 was a steep learning curve as you need to learn the Kubernetes ecosystem tooling (helm, kubectl, etc). I still couldn't get a gitlab-runner working under Rancher v2, but upgrading to v2.0.8 fixed it. I could add the custom helm chart for gitlab-runner and after cribbing the settings from https://gitlab.com/charts/gitlab-runner/blob/master/values.yaml I could get gitlab-runner working under Rancher v2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.