<p>I am trying to switch from an <code>nginx</code> Ingress to using <code>Istio</code> to take advantage of route weights for canary deployments, and integrated monitoring, among other things.</p>

<p>My regular routing was defined as:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: solar-demo
  annotations:
    nginx.org/server-snippet: "proxy_ssl_verify off;"
spec:
  rules:
  - host: shmukler.example.com
    http:
      paths:
      - path: /city/*
        backend:
          serviceName: solar-demo
          servicePort: 3000
      - path: /solar/*
        backend:
          serviceName: solar-demo
          servicePort: 3001
--
kind: Service
apiVersion: v1
metadata:
  name: solar-demo
spec:
  ports:
  - name: city
    protocol: TCP
    port: 3000
    targetPort: 3000
  - name: solar
    protocol: TCP
    port: 3001
    targetPort: 3001
  selector:
    app: solar-demo
</code></pre>

<p>I don't even need <code>auth</code>, right now. When I started <code>install/kubernetes/istio-demo.yaml</code>, it created a bunch of pods and services in the <code>istio-system</code> namespace.</p>

<p>I figured, possibly incorrectly, that I need to have a <code>VirtualService</code> and maybe route rules defined. Wrote:</p>

<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: solar-demo
spec:
  hosts:
    - shmukler.example.com
  http:
  - route:
    - destination:
        host: shmukler.example.com
        subset: blue
      weight: 90
    - destination:
        host: shmukler.example.com
        subset: green
      weight: 10
</code></pre>

<p>Are ports defined in the regular service, while weights and paths in a <code>VirtualService</code>? Do I need to stick anything into the <code>istio-system</code> namespace? Is it possible, and what would I need to extend <code>istio-demo.yaml</code> to do the routing, I need, just to get the things rolling?</p>

<p>Any pointers are appreciated.</p>

Moshe Shmukler
<p>You need a Gateway and a VirtualService.</p>

<p>Check out <a href="https://istio.io/docs/tasks/traffic-management/ingress/" rel="nofollow noreferrer">this task</a> for an example.</p>
