Kubernetes 中的 Gitlab Runner 无法解析主机

Gitlab Runner in Kubernetes Could not resolve host

我已经在我们的 Kubernetes 集群中部署了一个 Gitlab Runner Helm Chart

现在我尝试用 kaniko 构建图像。但是跑步者无法解析我的gitlab服务器的url:

Running with gitlab-runner 12.3.0 (a8a019e0)
on gitlab-runner-gitlab-runner-d7996895b-7lpnh nY2nib3b
Using Kubernetes namespace: gitlab
Using Kubernetes executor with image gcr.io/kaniko-project/executor:debug ...
Waiting for pod gitlab/runner-ny2nib3b-project-2-concurrent-0w2ffw to be running, status is Pending
Running on runner-ny2nib3b-project-2-concurrent-0w2ffw via gitlab-runner-gitlab-runner-d7996895b-7lpnh...
Fetching changes...
Initialized empty Git repository in /builds/my-repo/.git/
Created fresh repository.
fatal: unable to access 'https://gitlab-ci-token:[MASKED]@XXX.XY:8443/my-repo.git/': Could not resolve host: XXX.XY
ERROR: Job failed: command terminated with exit code 1

当我连接到 pod 并尝试 nslookup XXX.XY:

nslookup: can't resolve 'XXX.XY': Name does not resolve

我已经解决了一些问题,但在这里我不知道。 DNS 在其他 PODs.

中有效

编辑:

在工作的 busybox pod 上,nslooup 的输出是

nslookup google.de
Server:    10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local

Name:      google.de
Address 1: 2a00:1450:4001:816::2003 fra16s07-in-x03.1e100.net
Address 2: 172.217.18.3 fra15s28-in-f3.1e100.net

如果您使用的是 v12.3.0,那么您 运行 遇到了一个错误:https://gitlab.com/gitlab-org/charts/gitlab-runner/issues/96

我们是 DNS 配置问题。节点配置不正确,Alpine 似乎比其他节点更严格地遵循标准。

我查看了无法正常工作的 /etc/resolve.conf 文件 PODs。问题是 "search" 下的最后一个(错误的)域。