問題: 在pod內無法解析域名
解決:
busybox的鏡像有bug,導致ping可以解析,但是nslookup無法解析
kubectl run -it --rm --image=infoblox/dnstools dns-client
換成上面的就可以,實在解決不了再看下面的
dnstools# nslookup kubernetes
或者busybox:1.28.3版本
但是我通過helm部署得prometheus容器內部還是無法解析
1、試着升級一下coredns得版本,發現問題解決
coredns官方部署github地址: https://github.com/coredns/deployment/tree/master/kubernetes
k8s版本:1.13.7
coredns當前版本:1.2.6
升級后版本: 1.5.0
刪除之前得coredns
kubectl delete -f coredns.yaml
wget https://raw.githubusercontent.com/coredns/deployment/master/kubernetes/coredns.yaml.sed
wget https://raw.githubusercontent.com/coredns/deployment/master/kubernetes/deploy.sh
chmod +x deploy.sh
./deploy.sh -i 10.254.0.2 -d cluster.local. > dns.yaml
kubectl apply -f dns.yaml;
k8s版本:1.13.7
coredns當前版本:1.5.0
今天3master 組成得k8s集群,pod在node1上就能解析出ip,在其他得兩個node就不行,重啟后就好了,奇怪