nslookup不能解析Kubernetes.default [英] nslookup does not resolve Kubernetes.default

查看:1053
本文介绍了nslookup不能解析Kubernetes.default的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在minikube设置上尝试了以下命令,以验证dns是否工作正常.

I tried the following command on my minikube setup to verify if dns is working fine or not.

kubectl exec -ti busybox -- nslookup kubernetes.default

但这是我得到的输出 ' 服务器:10.96.0.10 地址1:10.96.0.10

but this is the output I am getting ' Server: 10.96.0.10 Address 1: 10.96.0.10

nslookup: can't resolve 'kubernetes.default'
command terminated with exit code 1'

除此之外,我检查了coredns pod日志,它显示如下内容: ` 2019-11-07T12:25:23.694Z [ERROR]插件/错误:0 5606995447546819070.2414697521008405831. HINFO:阅读udp 172.17.0.5:60961-

Apart from that, I checked the coredns pod logs it shows something like below: ` 2019-11-07T12:25:23.694Z [ERROR] plugin/errors: 0 5606995447546819070.2414697521008405831. HINFO: read udp 172.17.0.5:60961-

10.15.102.11:53:I/O超时 `

10.15.102.11:53: i/o timeout `

能不能给我解释一下出了什么问题? busybox图片标签为 image: busybox:1.28

Can some explain me what is going wrong? busybox image tag is image: busybox:1.28

推荐答案

那是因为您的busybox广告连播对kubernetes.default一无所知 修复您的/etc/resolv.conf

Thats because your busybox pod know nothing about kubernetes.default Fix your /etc/resolv.conf

应该像

search default.svc.cluster.local svc.cluster.local
nameserver 10.96.0.10
options ndots:5

此外,您还可以打开调试DNS解析文档并检查提供的示例是否相同.

Additionally you cat open Debugging DNS Resolution documentation and check provided examle for the same.

看一下resolv.conf文件. (请参阅从 节点和下面的已知问题以获取更多信息)

Take a look inside the resolv.conf file. (See Inheriting DNS from the node and Known issues below for more information)

kubectl exec busybox cat /etc/resolv.conf

验证是否按照以下步骤设置了搜索路径和名称服务器: 以下(请注意,搜索路径可能因不同的云而异 提供者):

Verify that the search path and name server are set up like the following (note that search path may vary for different cloud providers):

search default.svc.cluster.local svc.cluster.local cluster.local google.internal c.gce_project_id.internal
nameserver 10.0.0.10
options ndots:5

以下错误表明 coredns/kube-dns附加组件或相关服务:

Errors such as the following indicate a problem with the coredns/kube-dns add-on or associated Services:

kubectl exec -ti busybox -- nslookup kubernetes.default
Server:    10.0.0.10
Address 1: 10.0.0.10

nslookup: can't resolve 'kubernetes.default'
or

kubectl exec -ti busybox -- nslookup kubernetes.default
Server:    10.0.0.10
Address 1: 10.0.0.10 kube-dns.kube-system.svc.cluster.local

nslookup: can't resolve 'kubernetes.default'

这篇关于nslookup不能解析Kubernetes.default的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆