Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coredns的hosts解析无法生效 #1432

Open
905839698 opened this issue Dec 13, 2024 · 2 comments
Open

coredns的hosts解析无法生效 #1432

905839698 opened this issue Dec 13, 2024 · 2 comments

Comments

@905839698
Copy link

What happened? 发生了什么问题?

用nodelocaldns的时候,pod无法解析写在coredns的hosts内容

What did you expect to happen? 期望的结果是什么?

pod正常解析自定义解析

How can we reproduce it (as minimally and precisely as possible)? 尽可能最小化、精确地描述如何复现问题

本地resolv.conf内容为127.0.0.1 本地没有监听端口

Anything else we need to know? 其他需要说明的情况

No response

Kubernetes version k8s 版本

1.31.2

Kubeasz version

3.6.5

OS version 操作系统版本

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

NAME="openEuler"
VERSION="22.03 (LTS-SP4)"
ID="openEuler"
VERSION_ID="22.03"
PRETTY_NAME="openEuler 22.03 (LTS-SP4)"
ANSI_COLOR="0;31"

Related plugins (CNI, CSI, ...) and versions (if applicable) 其他网络插件等需要说明的情况

calico
@905839698
Copy link
Author

通过修改主机resolv.conf 指向cordns地址解决

@905839698
Copy link
Author

nodelocaldns的dnsPolicy修改为ClusterFirstWithHostNet应该也可以 , 对于以 hostNetwork 方式运行的 Pod,应将其 DNS 策略显式设置为 "ClusterFirstWithHostNet"。否则,以 hostNetwork 方式和 "ClusterFirst" 策略运行的 Pod 将会做出回退至 "Default" 策略的行为。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant