Unable start gitlabrunner with localserver

Hi everyone,

I’m currently facing an issue while trying to register my GitLab Runner. I recently migrated my system to a new server. Now I need to configure the GitLab Runner to operate with internal IP addresses (specifically, IPs in the range 192.168…).

Previously, the GitLab Runner was able to send requests to a public site successfully. However, with the new setup, GitLab Runner should send requests inside local ips.

I tried adding an IP mapping using extra_hosts = [""] in the GitLab Runner configuration. However, when I start the GitLab Runner from docker inside k8s, I encounter the following error message: status=couldn't execute POST against Post dial tcp connect: connection refused.

I have already checked the configuration file for the GitLab Runner and ensured that the URL is set to, as my GitLab instance is running on the same server. Additionally, I have verified that the GitLab instance is up and running.

Runner config:

concurrent = 1
check_interval = 0

  session_timeout = 1800

  name = "docker-gr"
  url = ""
  token = "TOKEN"
  executor = "docker"
    tls_verify = false
    image = "docker:stable"
    privileged = false
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0
    extra_hosts = [""]

Gitlab version 15.2.0 and located on 30080 port.
Also I tried to use instead values from /etc/hosts and network_mode = "host" with localhost.

Hi @samoed

if I get it right, you have a GitLab running on a server listening on port 30080. And you are trying to register a GitLab Runner with it which is running on the same server?

Just use the IP of the server’s main interface: url = "http://192.168.x.y:30080"