k8s的pod域名解析服务dns有问题排查

参考链接

https://www.cnblogs.com/testzcy/p/14414493.html
此链接没有解决我的问题,但是思路很清晰,确定了是coredns服务的问题,又看到了这个博客
https://blog.csdn.net/qq_29274865/article/details/110435397
文章没有说明具体怎么重建coredns,只有命令参考下
后面又找到了重建的命令
https://sre.ink/reinstall-coredns-on-kubernetes/
https://blog.51cto.com/u_14540692/10382272 这个也可以参考下,没有登录不能复制粘贴
但是默认只装了1个coredns,需要自行更改数量 replicas

删除已有pod

kubectl delete --namespace=kube-system deployment coredns

重新安装

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 | kubectl apply -f -
posted @ 2024-05-09 15:22  jasmine456  阅读(69)  评论(0)    收藏  举报