<p>I'm new to istio, I have a simple test yaml file which is a little long. What I want to do is to write a custom ingressgateway service for my gateway. And after testing, the incorrect part is the definition of ingressgateway which is at the top. The entire yaml is below:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: batman-ingressgateway
  labels:
    app: batman-ingressgateway
spec:
  type: LoadBalancer
  selector:
    app: batman-ingressgateway
  ports:
  - port: 80
    targetPort: 80
    nodePort: 31389
    name: http
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: batman-gateway
spec:
  selector:
    app: batman-ingressgateway
      #istio: ingressgateway
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: batman
spec:
  hosts:
  - "*"
  gateways:
  - batman-gateway
  http:
    - match:
      route:
      - destination:
          host: batman
          port:
            number: 8000
          subset: v1
        weight: 80
      - destination:
          host: batman
          port:
            number: 8000
          subset: v2
        weight: 20
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: batman-destination
spec:
  host: batman
  subsets:
  - name: v1
    labels:
      version: v1
      run: batman
  - name: v2
    labels:
      version: v2
      run: batman
</code></pre>

<p>I want to access my app from browser with the address like: <a href="http://my_host_ip:31389/article" rel="nofollow noreferrer">http://my_host_ip:31389/article</a>. The problem now is the ingressgateway doesn't route traffic to my gateway. Is there any one can help me? 
Thanks.</p>

leo
<p>Documentation on istio gateway routing is here  <a href="https://istio.io/docs/tasks/traffic-management/ingress/ingress-control/" rel="nofollow noreferrer">https://istio.io/docs/tasks/traffic-management/ingress/ingress-control/</a>.</p>
<p>If you look at gateway spec they have</p>
<pre><code>selector:
    istio: ingressgateway # use Istio default gateway implementation
</code></pre>
<p>While you have</p>
<pre><code>selector:
    app: batman-ingressgateway
      #istio: ingressgateway
</code></pre>
<p>For VirtualService definition you can look here <a href="https://istio.io/docs/reference/config/networking/v1alpha3/virtual-service/" rel="nofollow noreferrer">https://istio.io/docs/reference/config/networking/v1alpha3/virtual-service/</a>
You can try with routing requests to /article to your service</p>
<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: article-route
spec:
  hosts:
  - *
  http:
  - match:
    - uri:
        prefix: &quot;/article&quot;
    route:
    - destination:
        host: &lt;name of your service&gt;
</code></pre>
