Cross-namespace services. I was trying to have a pod in namespace nsA calling a pod in namespace nsB. But I wanted to avoid any concern to the developer about the location of the final service, so just use a hostname in the invocation and I will redirect it using Istio. My assumption was that in the code I would just call to a hostname, something like http://podB:9080 and now I would create a Virtual service like this to redirect it to the right namespace
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: podB
spec:
hosts:
- podB
http:
- route:
- destination:
host: podB.nsB.svc.cluster.local
subset: v1
But this does not work, for this to work I have to create a service called podB in namespace nsA. It can be an "empty" service without any Endpoint but the service has to exist for Istio Proxy to handle the request, if it does not exist the virtualService does not operate.
Any recommendation for this scenario?