<p>I’ve the following application which Im able to run in K8S successfully which using service with type load balancer, very simple app with two routes</p>

<ol>
<li><code>/</code> - you should see 'hello application`</li>
<li><code>/api/books</code> should provide list of book in json format</li>
</ol>

<p>This is the <code>service</code></p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: go-ms
  labels:
    app: go-ms
    tier: service
spec:
  type: LoadBalancer
  ports:
    - port: 8080
  selector:
    app: go-ms
</code></pre>

<p>This is the <strong>deployment</strong></p>

<pre><code>
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: go-ms
  labels:
    app: go-ms

spec:
  replicas: 2
  template:
    metadata:
      labels:
        app: go-ms
        tier: service

    spec:
      containers:
        - name: go-ms
          image: rayndockder/http:0.0.2
          ports:
            - containerPort: 8080
          env:
            - name: PORT
              value: "8080"
          resources:
            requests:
              memory: "64Mi"
              cpu: "125m"
            limits:
              memory: "128Mi"
              cpu: "250m"

</code></pre>

<p>after applied the both yamls and when calling the URL:</p>

<p><code>http://b0751-1302075110.eu-central-1.elb.amazonaws.com/api/books</code></p>

<p><strong>I was able to see the data in the browser as expected and also for the root app using just the external ip</strong></p>

<p>Now I want to use <code>istio</code>, so I follow the guide and install it successfully via <code>helm</code>
using <a href="https://istio.io/docs/setup/kubernetes/install/helm/" rel="nofollow noreferrer">https://istio.io/docs/setup/kubernetes/install/helm/</a> and verify that all the 53 crd are there and also <code>istio-system</code> 
 components (such as <code>istio-ingressgateway</code> 
<code>istio-pilot</code> etc all 8 deployments are in up and running)</p>

<p>I’ve change the service above from <code>LoadBalancer</code> to <code>NodePort</code> </p>

<p>and create the following <code>istio</code> config according to the istio docs</p>

<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: http-gateway
spec:
  selector:
    istio: ingressgateway
  servers:
    - port:
        number: 8080
        name: http
        protocol: HTTP
      hosts:
        - "*"
---

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: virtualservice
spec:
  hosts:
    - "*"
  gateways:
    - http-gateway
  http:
  - match:
      - uri:
          prefix: "/"
      - uri:
          exact: "/api/books"
    route:
      - destination:
          port:
            number: 8080
          host: go-ms
</code></pre>

<p>in addition I’ve added the following</p>

<p><code>kubectl label namespace books istio-injection=enabled</code> where the application is deployed,</p>

<p>Now to get the external Ip i've used command</p>

<p><code>kubectl get svc -n istio-system -l istio=ingressgateway</code></p>

<p>and get this in the <code>external-ip</code></p>

<p><code>b0751-1302075110.eu-central-1.elb.amazonaws.com</code>
when trying to access to the URL </p>

<p><code>http://b0751-1302075110.eu-central-1.elb.amazonaws.com/api/books</code></p>

<p>I got error: </p>

<p>This site can’t be reached</p>

<p><code>ERR_CONNECTION_TIMED_OUT</code> </p>

<p>if I run the docker <code>rayndockder/http:0.0.2</code> via
<code>docker run -it -p 8080:8080 httpv2</code></p>

<p>I path's works correctly!    </p>

<p>Any idea/hint What could be the issue ?</p>

<p>Is there a way to <strong>trace</strong> the <code>istio</code> configs to see whether if something is missing or we have some collusion with port or network policy maybe ? </p>

<p>btw, the deployment and service can run on each cluster for testing of someone could help...</p>

<p>if I <strong>change</strong> all to port to <code>80</code> (in all yaml files and the application and the docker ) I was able to get the data for the root path, but not for "api/books" </p>

<p>I tired your config with the modification of gateway port to 80 from 8080 in my local minikube setup of kubernetes and istio. This is the command I used: </p>

<pre><code>kubectl apply -f - &lt;&lt;EOF
apiVersion: v1
kind: Service
metadata:
  name: go-ms
  labels:
    app: go-ms
    tier: service
spec:
  ports:
    - port: 8080
  selector:
    app: go-ms
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: go-ms
  labels:
    app: go-ms

spec:
  replicas: 2
  template:
    metadata:
      labels:
        app: go-ms
        tier: service

    spec:
      containers:
        - name: go-ms
          image: rayndockder/http:0.0.2
          ports:
            - containerPort: 8080
          env:
            - name: PORT
              value: "8080"
          resources:
            requests:
              memory: "64Mi"
              cpu: "125m"
            limits:
              memory: "128Mi"
              cpu: "250m"
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: http-gateway
spec:
  selector:
    istio: ingressgateway
  servers:
    - port:
        number: 80
        name: http
        protocol: HTTP
      hosts:
        - "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: go-ms-virtualservice
spec:
  hosts:
     - "*"
  gateways:
    - http-gateway
  http:
  - match:
      - uri:
          prefix: /
      - uri:
          exact: /api/books
    route:
      - destination:
          port:
            number: 8080
          host: go-ms
EOF
</code></pre>

<p>The reason that I changed the gateway port to 80 is that, the istio ingress gateway by default opens up a few ports such as 80, 443 and few others. In my case, as minikube doesn't have an external load balancer, I used node ports which is 31380 in my case.</p>

<p>I was able to access the app with url of http://$(minikube ip):31380.</p>

<p>There is no point in changing the port of services, deployments since these are application specific.</p>

<p>May be <a href="https://stackoverflow.com/questions/53994034/istio-what-for-all-these-ports-are-opened-on-loadbalancer">this</a> question specifies the ports opened by istio ingress gateway.</p>
