Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kubeadm部署的CoreDNS和Ubuntu 18.04群集的Kubernetes DNS解析问题_Kubernetes_Dns_Ubuntu 18.04_Kubeadm_Coredns - Fatal编程技术网

Kubeadm部署的CoreDNS和Ubuntu 18.04群集的Kubernetes DNS解析问题

Kubeadm部署的CoreDNS和Ubuntu 18.04群集的Kubernetes DNS解析问题,kubernetes,dns,ubuntu-18.04,kubeadm,coredns,Kubernetes,Dns,Ubuntu 18.04,Kubeadm,Coredns,我在OVH裸机服务器上部署了Kubernetes群集。集群是使用Kubeadm部署的,操作系统是Ubuntu18.04.5LTS。Calico被用作CNI,我的POD有间歇性DNS解析问题 这是pod中DNS解析的输出 bash-5.0# nslookup s3.amazonaws.com Server: 10.96.0.10 Address: 10.96.0.10:53 Non-authoritative answer: Name: s3.amazonaws.com Add

我在OVH裸机服务器上部署了Kubernetes群集。集群是使用Kubeadm部署的,操作系统是Ubuntu18.04.5LTS。Calico被用作CNI,我的POD有间歇性DNS解析问题

这是pod中DNS解析的输出

bash-5.0# nslookup s3.amazonaws.com
Server:     10.96.0.10
Address:    10.96.0.10:53

Non-authoritative answer:
Name:   s3.amazonaws.com
Address: 52.217.88.54

Non-authoritative answer:

bash-5.0# nslookup s3.amazonaws.com
Server:     10.96.0.10
Address:    10.96.0.10:53


Name:   s3.amazonaws.com
Address: 52.217.88.54

bash-5.0# nslookup s3.amazonaws.com
;; connection timed out; no servers could be reached

bash-5.0# nslookup s3.amazonaws.com
;; connection timed out; no servers could be reached

bash-5.0# nslookup s3.amazonaws.com
;; connection timed out; no servers could be reached

bash-5.0# nslookup s3.amazonaws.com
Server:     10.96.0.10
Address:    10.96.0.10:53

Non-authoritative answer:

Non-authoritative answer:
Name:   s3.amazonaws.com
Address: 52.217.102.142
我知道Ubuntu和kubeadm集群存在一些问题,但任何评论或回答都无法解决我的问题。起初,我觉得这是因为我的
/etc/resolv.conf
文件中有127.0.0.1 nameserver条目。如果我更新该文件,它将由
/run/systemd/resolv/resolv.conf
文件更新,并且我已停止
systemd resolved.service
并将DNS服务器更改为google DNS。即使在那之后,我也没有看到任何改善。如果我更改了pod内的
/etc/resolv.conf
文件,则会按预期工作

我还删除了
nsswitch.conf
文件中的
文件
条目,以直接检查DNS服务器,作为一个故障排除步骤,它在更改后很快工作,新pod再次出现问题

这是主机条目

cat /etc/nsswitch.conf | grep hosts
hosts:          dns

由于间歇性连接,我可以确认没有防火墙端口问题,我对此问题一无所知。有人能帮我解决这个问题吗。

你的coredns吊舱运行正常吗?你能列出豆荚吗?您还可以放置
kubectl get svc-n kube系统kube dns的输出吗?
?您好,thomas是的,看起来不错。这是服务输出<代码>名称类型CLUSTER-IP EXTERNAL-IP端口使用年限kube dns ClusterIP 10.96.0.10 53/UDP、53/TCP、9153/TCP 20dBTW,POD中没有日志,这很混乱..```kubectl记录coredns-689857ddd7-d7f8p-n kube系统:53 coredns-1.6.7 linux/amd64,go1.13.6,da7f65b``您能将此更新为问题吗?