Skip to content

WIP: executors/kubernetes: service resolution via pod host aliases

What does this MR do?

This MR adds support to Kubernetes Pod HostAliases for job services. This has been discussed at #2742 (closed) and #2229 (closed), and initially implemented at !936 (closed), which got stuck. This MR uses a similar approach to !936 (closed) however when writing the tests for it I've identified the need for the executors/docker/splitServiceAndVersion method and moved it into the common package to be used by both executors. This method is needed to properly map the service name according to the Docker image name.

I've been running this patch with a custom image in my cluster without any problems, image can be found at: rochacon/gitlab-runner:v201809131552. To build this image I've built a static linked version of gitlab-runner and used the following Dockerfile:

FROM gitlab/gitlab-runner:alpine-v11.3.0-rc1
COPY gitlab-runner /usr/bin/gitlab-runner

Why was this MR needed?

Feature parity and interoperability of pipelines between Docker and Kubernetes executors.

Are there points in the code the reviewer needs to double check?

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Added tests for this feature/bug
  • In case of conflicts with master - branch was rebased

What are the relevant issue numbers?

Related to #2229 (closed) Fixes #2742 (closed) Superseed !936 (closed)

Edited by Rodrigo Chacon

Merge request reports