<p>I'm facing a pretty strange Problem.</p>
<p>First of all my setup:<br />
I got a private Gitlab server which uses Gitlab CI Runners on Kubernetes to build Docker Images. For that purpose I use the Kaniko Image.
The Runners are provisioned by Gitlab itself with the built-in Kubernetes management. All that is running behind a PFSense server.</p>
<p>Now to my problem:<br />
Sometimes the Kaniko Pods can't resolve the Hostname of the GitLab server.
This leads to failed git pull and so to a failed build.
I would rate the chance to fail by 60%, which is way too high for us.
After retrying the build a few times, it will run without any problem.</p>
<p>The Kubernetes Cluster running the Gitlab CI is setup on CentOS 7.
SELinux and FirewallD are disabled. All of the Hosts can resolve the GitLab Server. It is also not related to a specific Host Server, which is causing the problem. I have seen it fail on all of the 5 Servers including the Manager Server. Also I haven't seen this problem appear in other Pods. But the other Deployments in the cluster dont really do connections via DNS. I am sure that the Runner is able to access DNS at all, because it is pulling the Kaniko Image from gcr.io.</p>
<p>Has anyone ever seen this problem or knows a workaround?</p>
<ul>
<li>I have already tried spawning Pods that only do DNS requests to the Domain. I didn't see a single fail.</li>
<li>Also I tried to Reboot the whole Cluster and Gitlab instance.</li>
<li>I tried to do a static overwrite of the DNS route in PFSense. Still same problem.</li>
</ul>
<p>Here is my CI config:</p>
<pre class="lang-yaml prettyprint-override"><code>build:
  stage: build
  image:
    name: gcr.io/kaniko-project/executor:debug
    entrypoint: [&quot;&quot;]
  script:
    - echo $REGISTRY_AUTH &gt; /kaniko/.docker/config.json
    - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $REGISTRY_URL/$REGISTRY_IMAGE:$CI_JOB_ID
  only:
    - master
</code></pre>
<p>The following error happens:</p>
<pre><code>Initialized empty Git repository in /builds/MYPROJECT/.git/
Fetching changes...
Created fresh repository.
fatal: unable to access 'https://gitlab-ci-token:[MASKED]@git.mydomain.com/MYPROJECT.git/': Could not resolve host: git.mydomain.com
</code></pre>

xj32
<p>We had same issue for couple of days. We tried change CoreDNS config, move runners to different k8s cluster and so on. Finally today i checked my personal runner and found that i'm using different version. Runners in cluster had <code>gitlab/gitlab-runner:alpine-v12.3.0</code>, when mine had <code>gitlab/gitlab-runner:alpine-v12.0.1</code>. We added line </p>

<pre><code>image: gitlab/gitlab-runner:alpine-v12.1.0
</code></pre>

<p>in <code>values.yaml</code> and this solved problem for us</p>
