gpt4 book ai didi

dns - Kubernetes:Kube-DNS 与 CoreDNS

转载 作者:行者123 更新时间:2023-12-02 01:21:13 24 4
gpt4 key购买 nike

我是 Kubernetes 新手,希望更好地了解 Kube-DNS 和 CoreDNS 之间的区别。

据我了解,建议使用较新的 CoreDNS,而不是较旧的 Kube-DNS。

我已经使用 kubeadm 设置了一个小型集群,现在我对 CoreDNS 和 Kube-DNS 之间的区别有点困惑。

使用kubectl get pods --all-namespaces我可以看到我有两个正在运行的CoreDNS pod。

但是使用 kubectl get svc --all-namespaces 我还看到我有一个名为 kube-dns 的服务在 kube-system 中运行代码 > 命名空间。当我使用 kubectl describe svc/kube-dns -n kube-system 检查时,我可以看到 kube-dns 服务链接到 coredns。

我现在想知道我是否实际上同时运行 kube-dns 和 coredns。或者,为什么该服务名为 kube-dns 而不是 core-dns

最佳答案

我有 K8S 1.12。对 dns pod 进行描述。

kubectl describe pod coredns-576cbf47c7-hhjrs --namespace=kube-system | grep -i "image:"

Image: k8s.gcr.io/coredns:1.2.2

看起来 coredns 正在运行。根据文档,CoreDNS 是 K8S 1.11 中默认的。对于以前的安装,它是 kube-dns。

图像很重要,其余的是元数据(名称、标签等)。

据K8S博客here .

In Kubernetes 1.11, CoreDNS has reached General Availability (GA) for DNS-based service discovery, as an alternative to the kube-dns addon. This means that CoreDNS will be offered as an option in upcoming versions of the various installation tools. In fact, the kubeadm team chose to make it the default option starting with Kubernetes 1.11.

此外,请参阅此链接 more信息。

关于dns - Kubernetes:Kube-DNS 与 CoreDNS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52761135/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com