小编Zoi*_*dik的帖子

K3S Rancher - 基于 Debian 的 docker 镜像无法正确解析 dns

我面临着奇怪的问题。

我做了什么:

我部署了Rancher K3S集群,并且使用基于 debian 的映像进行 dns 解析时出现问题。域名未正确解析 - 它使用我们的域名之一添加后缀。

我发现了什么:

基于 Debian 的镜像在末尾添加了带有域的后缀。例如,我 ping google.com 及其 ping google.com.example.com。(example.com 是我们的域名之一 - 没有指定它,因为在我看来它并不重要)

同样,curl google.com 也会向 example.com 的 IP 地址发出请求。即使尝试了纯 Debian 映像,它仍然存在同样的问题。

基于 Alpine 的图像工作正常(ping 到 google.com ping google.com,nslookup 显示正确的 IP 地址)。

安装了 k3s 的主机服务器也可以正常工作(redhat os)。Ping 至 google.com ping google.com。

一些可能对您有帮助的附加数据:

CoreDNS configmap kubectl -n kube-system 获取 configmap coredns -o go-template={{.data.Corefile}}

.:53 {
    errors
    health
    ready
    kubernetes cluster.local in-addr.arpa ip6.arpa {
      pods insecure
      upstream
      fallthrough …
Run Code Online (Sandbox Code Playgroud)

dns networking resolve kubernetes k3s

5
推荐指数
1
解决办法
2531
查看次数

标签 统计

dns ×1

k3s ×1

kubernetes ×1

networking ×1

resolve ×1