AKS,Windows节点,DNS在使用完全限定名称之前不会解析服务 [英] AKS, WIndows Node, dns does not resolve service until fully qualified name is used
问题描述
具有Linux和Windows的多个节点池的AKS群集. Kafka客户:Confluent.Kafka 1.4.4
AKS Cluster with multiple node pools of linux and windows. Kafka Client: Confluent.Kafka 1.4.4
尝试解析名为"tt-kafka-kafka-bootstrap.shared"的kafka服务.
Trying to resolve a kafka service named "tt-kafka-kafka-bootstrap.shared".
在Windows pod中来自with-无法解决:
From with in windows pod - FAILS TO RESOLVE:
kubectl exec -it test-print-7f6b64dc4f-4z7lt --namespace test -- nslookup tt-kafka-kafka-bootstrap.shared
Server: kube-dns.kube-system.svc.cluster.local
Address: 10.0.0.10
*** kube-dns.kube-system.svc.cluster.local can't find tt-kafka-kafka-bootstrap.shared: Non-existent domain
但是如果我可以使用svc.cluster.local来确认服务地址,则可以解决此问题:
BUT IF I QUALIFY THE SERVICE ADDRESS WITH svc.cluster.local, IT RESOLVES:
kubectl exec -it test-print-7f6b64dc4f-4z7lt --namespace test -- nslookup tt-kafka-kafka-bootstrap.shared.svc.cluster.local
Server: kube-dns.kube-system.svc.cluster.local
Address: 10.0.0.10
Name: tt-kafka-kafka-bootstrap.shared.svc.cluster.local
Address: 10.0.192.149
在LINUX POD中使用FROM-解决精细问题:
FROM With in LINUX POD - RESOLVES FINE:
root@test-worker-t1-0:/app# nslookup tt-kafka-kafka-bootstrap.shared
Server: 10.0.0.10
Address: 10.0.0.10#53
Name: tt-kafka-kafka-bootstrap.shared.svc.cluster.local
Address: 10.0.192.149
推荐答案
事实证明Windows无法解析kubernetes中的名称空间.
It turns out windows can not resolve name spaces with in the kubernetes.
有关更多信息,请参阅以下K8文档 Kubernetes中的Windows容器: https://kubernetes.io /docs/setup/production-environment/windows/intro-windows-in-kubernetes/#dns-limitations
Please refer to following K8 documentation for more information on Windows containers in Kubernetes: https://kubernetes.io/docs/setup/production-environment/windows/intro-windows-in-kubernetes/#dns-limitations
这篇关于AKS,Windows节点,DNS在使用完全限定名称之前不会解析服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!