zhikaichen123 commented on issue #4874:
URL: https://github.com/apache/apisix/issues/4874#issuecomment-906019336
谢谢spacewander的帮忙,解决方案我已经找到了,如下:
#### 集群dnsPolicy配置和场景说明
```html
ACK支持通过 dnsPolicy字段为每个Pod配置不同的DNS策略。目前ACK集群支持四种策略:
1.
ClusterFirst:通过CoreDNS来做域名解析,Pod内/etc/resolv.conf配置的DNS服务地址是集群DNS服务的kube-dns地址。该策略是集群工作负载的默认策略。
2. None:忽略集群DNS策略,需要您提供dnsConfig字段来指定DNS配置信息。
3.
Default:Pod直接继承集群节点的域名解析配置。即在ACK集群直接使用ECS的/etc/resolv.conf文件(文件内配置的是阿里云DNS服务)。
4.
ClusterFirstWithHostNetwork:强制在hostNetWork网络模式下使用ClusterFirst策略(默认使用Default策略)。
```
```html
apiVersion: v1
kind: Pod
metadata:
name: alpine
namespace: default
spec:
containers:
- image: alpine
command:
- sleep
- "10000"
imagePullPolicy: Always
name: alpine
dnsPolicy: Default
```
关键:dnsPolicy: Default
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]