服务器可以找到eureka-0.eureka.dabai-uat.svc.cluster.local.local:nxdomain
今天,我发现Kubernetes DNS服务有问题。当我使用此命令检查kubernetes 1.15 DNS时:
nslookup eureka-0.eureka.dabai-uat.svc.cluster.local
显示错误:
Server: 10.254.0.2
Address: 10.254.0.2#53
** server can't find eureka-0.eureka.dabai-uat.svc.cluster.local: NXDOMAIN
我确定eureka-0
statefulsets已经启动。 COREDNS POD已升起:
[root@ops001 ~]# kubectl get deployment -n kube-system|grep coredns
coredns 1/1 1 1 2y245d
域kubernetes.default
和kubernetes.default.svc.cluster.local.local
正常工作:
root@dnsutils:/# nslookup kubernetes.default
Server: 10.254.0.2
Address: 10.254.0.2#53
Name: kubernetes.default.svc.cluster.local
Address: 10.254.0.1
问题在哪里,我应该做什么来修复它。 ?这是DNS信息:
[root@ops001 ~]# kubectl get pods --namespace=kube-system -l k8s-app=kube-dns
NAME READY STATUS RESTARTS AGE
coredns-77b786f58-s5bzw 1/1 Running 0 21h
[root@ops001 ~]# kubectl get svc --namespace=kube-system
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
alertmanager ClusterIP 10.254.193.27 <none> 80/TCP 2y74d
grafana NodePort 10.254.46.9 <none> 80:30000/TCP 2y75d
kube-dns ClusterIP 10.254.0.2 <none> 53/UDP,53/TCP,9153/TCP 2y245d
kubelet ClusterIP None <none> 10250/TCP,10255/TCP,4194/TCP 2y80d
kubernetes-dashboard NodePort 10.254.75.193 <none> 9443:31085/TCP 2y245d
metrics-server ClusterIP 10.254.3.178 <none> 443/TCP 618d
mysql-report-exporter-prometheus-mysql-exporter ClusterIP 10.254.208.9 <none> 9104/TCP 575d
prometheus ClusterIP 10.254.200.46 <none> 9090/TCP 2y75d
traefik ClusterIP 10.254.169.66 <none> 80/TCP,443/TCP,8080/TCP 2y116d
traefik-2 LoadBalancer 10.254.143.242 <pending> 80:31211/TCP,443:30221/TCP 635d
[root@ops001 ~]# kubectl get ep kube-dns --namespace=kube-system
NAME ENDPOINTS AGE
kube-dns 172.30.248.7:53,172.30.248.7:53,172.30.248.7:9153 2y245d
Today I found the kubernetes dns service have a issue. When I am using this command to check the kubernetes 1.15 dns:
nslookup eureka-0.eureka.dabai-uat.svc.cluster.local
shows error:
Server: 10.254.0.2
Address: 10.254.0.2#53
** server can't find eureka-0.eureka.dabai-uat.svc.cluster.local: NXDOMAIN
I am sure the eureka-0
statefulsets is up. the coredns pod was up:
[root@ops001 ~]# kubectl get deployment -n kube-system|grep coredns
coredns 1/1 1 1 2y245d
the domain kubernetes.default
and kubernetes.default.svc.cluster.local
works fine:
root@dnsutils:/# nslookup kubernetes.default
Server: 10.254.0.2
Address: 10.254.0.2#53
Name: kubernetes.default.svc.cluster.local
Address: 10.254.0.1
where is the problem and what should I do to fix it? This is the dns info:
[root@ops001 ~]# kubectl get pods --namespace=kube-system -l k8s-app=kube-dns
NAME READY STATUS RESTARTS AGE
coredns-77b786f58-s5bzw 1/1 Running 0 21h
[root@ops001 ~]# kubectl get svc --namespace=kube-system
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
alertmanager ClusterIP 10.254.193.27 <none> 80/TCP 2y74d
grafana NodePort 10.254.46.9 <none> 80:30000/TCP 2y75d
kube-dns ClusterIP 10.254.0.2 <none> 53/UDP,53/TCP,9153/TCP 2y245d
kubelet ClusterIP None <none> 10250/TCP,10255/TCP,4194/TCP 2y80d
kubernetes-dashboard NodePort 10.254.75.193 <none> 9443:31085/TCP 2y245d
metrics-server ClusterIP 10.254.3.178 <none> 443/TCP 618d
mysql-report-exporter-prometheus-mysql-exporter ClusterIP 10.254.208.9 <none> 9104/TCP 575d
prometheus ClusterIP 10.254.200.46 <none> 9090/TCP 2y75d
traefik ClusterIP 10.254.169.66 <none> 80/TCP,443/TCP,8080/TCP 2y116d
traefik-2 LoadBalancer 10.254.143.242 <pending> 80:31211/TCP,443:30221/TCP 635d
[root@ops001 ~]# kubectl get ep kube-dns --namespace=kube-system
NAME ENDPOINTS AGE
kube-dns 172.30.248.7:53,172.30.248.7:53,172.30.248.7:9153 2y245d
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论