According to Istio documentation I should be able to use an arbitrary name in
Virtual service hosts don’t actually have to be part of the Istio service registry, they are simply virtual destinations.
Unfortunately, I don’t seem to be able to get this working. Here my example:
- I have two services called
webapp2. Both in namespace
- I would like to be able to send a request to
http://foo.mynamespace/that will get routed to
webapp1. Note that there is no service called
... spec: hosts: - webapp1.mynamespace.svc.cluster.local - webapp2.mynamespace.svc.cluster.local - foo.mynamespace.svc.cluster.local http: - route: - destination: host: webapp1.mynamespace.svc.cluster.local port: number: 80
My understanding is that the above should route all of the following requests to
What I see is that both requests to
http://webapp2.mynamespace/ get routed to
However, requests to
http://foo.mynamespace/ result in name resolution error (executed from a container in the Istio mesh):
curl http://foo.mynamespace/ curl: (6) Could not resolve host: foo.mynamespace
Any thoughts on what I’m missing?