unable to access the service via virtual service in Istio

12/21/2018

I'm new to istio and I have my the entire code in http://github.com/VenkateshSrini/IstioTest. I have created the service needed for hosting the Kubernetes service (istio-test-deployment.yaml in the repo). I tested it on docker desktop for windows (Kubernetes enabled) and I got the same working correctly. I had exposed my service via port 5000. In docker for windows the external Ip is always localhost.

Now using istoctl I created a created a side car deployment. That can be seen from istio-test-dep-injected.yaml. I executed this and service was created with Sidecar. Now the same service is not accessible via http://localHost:5000, which I think is correct

Then I went ahead and created the Virtual Gateway. The definition of the same can be seen at virtual-gateway.yaml. Then I created a virtual service as per virtualservice.yaml. In that I have provided the host and the name of Kubernetes service name and the port as 5000.

Even after all this I'm unable to access the Service using the url http://localHost/api/version

Can someone help me, because I do not find much help working with Istio with Docker for Windows

-- Venkatesh
docker-desktop
docker-for-windows
istio
kubernetes

1 Answer

12/21/2018

It seems that you forgot adding match rule. Try following add match field

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: istio-test-virtualservice
spec:
  gateways:
  - istio-test-gateway
  hosts:
  - '*'
  http:
  - match:
    - uri:
        prefix: /
    route:
    - destination:
        host: istio-test
        port:
          number: 5000
-- nurgasemetey
Source: StackOverflow