I am trying to route the tcp traffic based on hosts , Below are the procedure i followed
I have created a TCP entry on gateway I have the 2 tcp services running in bakend , I created the 2 virtualservices based on hosts field route the traffic.
hosts:
- echotest.xxxxx.xxxxxxx.com
tcp:
- match:
- port: 31400
route:
- destination:
host: tcp-echo
port:
number: 9000
hosts:
- isolated-xspp.xxxxx.xxxxxxx.com
tcp:
- match:
- port: 31400
route:
- destination:
host: isolated-xspp-1-0-1
port:
number: 8082
RESULTS: Query is always routed to 1st service which is created, hosts section is not processed. But when i query from inside the pod using the k8s service names both the services are responding properly. But Via virtualservice it is not routing properly.