<p>I'm new in the k8s world. </p>

<p>Im my dev enviroment, I use ngnix as proxy(with CORS configs and with headers forwarding like ) for the different microservices (all made with spring boot) I have. In a k8s cluster, I had to replace it with Istio?</p>

<p>I'm trying to run a simple microservice(for now) and use Istio for routing to it. I've installed istio with google cloud.</p>

<p>If I navigate to IstioIP/auth/api/v1 it returns 404</p>

<p>This is my yaml file</p>

<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: gateway
spec:
  selector:
    istio: ingressgateway # use Istio default gateway implementation
  servers:
    - port:
        name: http
        number: 80
        protocol: HTTP
      hosts:
        - '*'
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: virtual-service
spec:
  hosts:
  - "*"
  gateways:
  - gateway
  http:
  - match:
    - uri:
        prefix: /auth
    route:
    - destination:
        host: auth-srv
        port:
          number: 8082
---
apiVersion: v1
kind: Service
metadata:
  name: auth-srv
  labels:
    app: auth-srv
spec:
  ports:
    - name: http
      port: 8082
  selector:
    app: auth-srv
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: auth-srv
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: auth-srv
        version: v1
    spec:
      containers:
        - name: auth-srv
          image: gcr.io/{{MY_PROJECT_ID}}/auth-srv:1.5
          imagePullPolicy: IfNotPresent
          env:
            - name: JAVA_OPTS
              value: '-DZIPKIN_SERVER=http://zipkin:9411'
          ports:
            - containerPort: 8082
          livenessProbe:
            httpGet:
              path: /api/v1
              port: 8082
            initialDelaySeconds: 60
            periodSeconds: 5
</code></pre>

Fidelis
<p>Looks like istio doesn't know anything about the url. Therefore you are getting a 404 error response.
If you look  closer at the configuration in the virtual server you have configured istio to match on path <code>/auth</code>.</p>
<p>So if you try to request <code>ISTIOIP/auth</code> you will reach your microservice application. Here is image to describe the traffic flow and why you are getting a 404 response.</p>
<p><img src="https://i.stack.imgur.com/K5gdv.png" alt="Logic of the routing" /></p>
