DNS and ServiceEntry

I need to redirect all the traffic meant for a specific URL, to a specific ServiceEntry. In order to do it, I thought of using:

originating pod trying to reach for a fake pod URL (pod-1.domain) -> ServiceEntry matching the fake URL (pod-1.domain) -> VirtualService matching the fake URL rewriting the destination with .global (pod-1.domain rewritten to pod-1.domain.global) -> ServiceEntry for the .global URL senging it to another k8s cluster.

My initial ServiceEntry is not working as I expected it will work, as the originating pod returns a “host not found”. I now understand that a ServiceEntry won’t create a DNS entry “just like that”, but now I wonder…how could this be accomplished?

Thank you!

Istio has support for DNS in 1.8 (coming soon) that might help your use-case https://preliminary.istio.io/latest/blog/2020/dns-proxy/

1 Like

I thought that this was only to replace the “global” zone in the kube-dns forwarding it to the istiocoredns service. For what I read in the link you shared, it looks like it will be also capable of resolving mesh services without the need for them to be present in the local kuber-dns.
" If the query is for a service within the mesh, irrespective of the cluster that the service is in , the agent responds directly to the application."

" Your applications can resolve Kubernetes services on any cluster in any namespace , without the need to create stub Kubernetes services in every cluster."

This sounds amazing! :slight_smile:

Before 1.8, just create a k8s service (needn’t match a pod via selector).