nslookup:无法解析kubernetes.default [英] nslookup: can't resolve kubernetes.default
问题描述
我正在尝试使用 https:/在kubernetes中学习DNS. /kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/
-
我部署了busybox
I deployed the busybox
kubectl get pods busybox -o wide
NAME READY STATUS RESTARTS AGE IP NODE
busybox 1/1 Running 0 16m 10.200.1.5 worker-1
kubectl exec -ti busybox -- nslookup kubernetes.default
Server: 10.32.0.10
Address 1: 10.32.0.10 kube-dns.kube-system.svc.cluster.local
nslookup: can't resolve 'kubernetes.default'
command terminated with exit code 1
是否需要修改worker-1节点的/etc/resolv.conf文件.当前/etc/resolv.conf内容在下面
Do I need to modify the /etc/resolv.conf file of the worker-1 node. currently the /etc/resolv.conf content is below
nameserver 169.254.169.254
search c.k8s-project-193906.internal google.internal**
也是worker-1的版本 lsb_release -a 没有可用的LSB模块. 发行人ID:Ubuntu 说明:Ubuntu 18.04.1 LTS 发行:18.04 代号:bionic
Also the version of the worker-1 lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.1 LTS Release: 18.04 Codename: bionic
请帮助我找出导致配置错误的配置.我需要根据什么来更改resolve.conf文件吗?
Please help me figure out which configuration causes the resolve error. Do I need to change resolve.conf file and based on what?
推荐答案
您在最新版本的busybox docker映像中遇到了一个错误.使用标签busybox:1.28
代替latest
.此错误链接位于此处:
You have encountered a bug in the latest versions of the busybox docker image. Use the tag busybox:1.28
instead of latest
. This bug link is here:
"Nslookup does not work in latest busybox image"
"1.27/1.28 are working , 1.29/1.29.1 are not"
在这里失败并带有busybox:latest
标记.
$ kubectl run busybox --image busybox:latest --restart=Never --rm -it busybox -- sh
If you don't see a command prompt, try pressing enter.
/ # nslookup kubernetes.default
Server: 10.96.0.10
Address: 10.96.0.10:53
** server can't find kubernetes.default: NXDOMAIN
*** Can't find kubernetes.default: No answer
/ # exit
pod "busybox" deleted
与busybox:1.28
标记相同的命令成功.
$ kubectl run busybox --image busybox:1.28 --restart=Never --rm -it busybox -- sh
If you don't see a command prompt, try pressing enter.
/ # nslookup kubernetes.default
Server: 10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local
Name: kubernetes.default
Address 1: 10.96.0.1 kubernetes.default.svc.cluster.local
/ # exit
pod "busybox" deleted
这篇关于nslookup:无法解析kubernetes.default的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!