Gitlab runner registration using kubernetes clsuter dns name


I have a kubernetes cluster where in i am running gitlab as a pod and running it behind nginx. We are exposing nginx as a Load Balancer and hence have the load balancer url in order to access gitlab.

We are trying to install gitlab runner and register it to the gitlab setup done above. We are facing the bwlow issues

  1. We are unable to register the runner to the load balancer above as it has a self signed certificate and it does not allow us to register.
  2. We tried registering the runner against the cluster dns like this “http://gitlab.sample.svc.cluster.local:port/gitlab”. The runner registration is happening but when we run the jobs its cloning the code using the load balancer url configured against Gitlab.

Is there anywhere in which we can have some configs specified for gitlab to clone the repo against the cluster dns name rather than the nginx load balancer url