Skip to content

Allow to set extra hosts on kubernetes executor

What does this MR do?

It adds the possibility to define additional hosts in containers of the Kubernetes executor, similar to the extra_hosts setting in the docker executor.

Why was this MR needed?

Sometimes projects make use of hostnames to differentiate between different configurations, such as a webserver serving different content for different domains. As of right now, it is not possible to have additional host entries in /etc/hosts, as that file is managed/mounted by Kubernetes and not possible to edit during runtime.

This change will make it easier to migrate workloads currently using the docker executor to the kubernetes executor.

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

  • Should this be called extra_hosts to keep it the same as in docker?
  • Is it preferable to keep the same syntax as in docker?

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
Edited by Ray Paik

Merge request reports