Gitlab-runner with kubernetes executor behind proxy

Dear all,

please I would like to ask how to configure gitlab-runner with kubernetes executor (in openshift) behind proxy

I prepared images for runner, runner-helper and image (KUBERNETES_IMAGE)
Registering runner is successful - with environment variables http and https proxy in container runner
when I start my first gitlab-ci using this runner it always fails on step cloning the current git project
fatal: Failed to connect to git.atosone.com port 443: Connection timed out

I already provided the http and https_proxy as environment variables for helper and also for KUBERNETES_IMAGE (in the moment they are part of each image - I accept that this is for troubleshooting mainly) and when I connected to command line of the running container
runner-qsa5nkep-project-8691-concurrent-0jhmxf
I was able to see created environment variables http https_proxy
and I was also successful with curl access to the git.atosone.com

I expected successful download the repository for current project.

  • *GitLab GitLab Enterprise Edition [13.9.4-ee] selfmanaged
  • *Runner version 13.9.0

Thank you for your help

And I also found second right place to provide the http https proxy variables and this is in .gitlab-ci.yaml file:

deploy:
variables:
HTTP_PROXY: http://server:port/
HTTPS_PROXY: http://server:port/
NO_PROXY: localhost,127.0.0.1

and now finally also repository is successfully cloned to actual container. First place for proxy variables is - deployment of gitlab-runner container.
and no need to put variables for proxy anywhere else.

1 Like