gpt4 book ai didi

kubernetes - pod 没有获得正确的 coredns ip 地址

转载 作者:行者123 更新时间:2023-12-02 11:36:21 25 4
gpt4 key购买 nike

我在我的 kuberntes 集群(v1.15.2)中部署 coredns(v1.6.7),现在是 pod 的 /etc/resolv.conf :

 nameserver 10.96.0.10
search default.svc.cluster.local svc.cluster.local cluster.local
options ndots:5

但我的 codedns 的 ip 是 10.96.0.2 ,如何使用我的集群的 coredns ip 来制作它?这是dns配置:
dnsPolicy: ClusterFirst

最佳答案

but my codedns's ip is 10.96.0.2,how to make it using my cluster's coredns ip?



您没有提到如何启动集群。但我猜你正在使用kubedns。部署 coredns 并不意味着使用它。您将需要配置默认的 kubernetes 行为。

解决方案

引用: https://github.com/coredns/deployment/tree/master/kubernetes

CoreDNS can run in place of the standard Kube-DNS in Kubernetes. Using the kubernetes plugin, CoreDNS will read zone data from a Kubernetes cluster. It implements the spec defined for Kubernetes DNS-Based service discovery:



在最好的情况下,替换 Kube-DNS 所需的只是这些命令:
$ ./deploy.sh | kubectl apply -f -
$ kubectl delete --namespace=kube-system deployment kube-dns

关于kubernetes - pod 没有获得正确的 coredns ip 地址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62125028/

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