Istio Version Based Routing Causing 404

4/10/2019

I'm trying to use istio for routing between microservices in my k8s cluster.

In this example, I have the following applications

frontend:v1 which needs to contact backend:v1 frontend:v2 which needs to contact backend:v2

I have created the required istio configs and have got a response with no routing options but when I attempt to setup routing rules so that traffic with labels app=frontend and version=v1 are routed to the backend v1 subset, I get an error 404.

Here is an example of my current VirtualService:

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: backend-vs
spec:
  hosts:
   - "backend.backend.svc.cluster.local"
  http:
  - match:
    - sourceLabels:
        app: frontend
        version: v1
    route:
    - destination:
      host: backend.backend.svc.cluster.local
      subset: v1
      port:
        number: 5000

Eventually I want to be able to control which versions from the frontend go to the versioned subset on the backend and iterate these microservices independently.

At present istio returns a 404 error.

If i remove the sourceLabels match I can access the backend service from the frontend pods.

TIA

-- DanTheDJ1
istio
kubernetes
microservices
routing

1 Answer

4/11/2019

I was able only to get this route works with sourceLabels: matching criteria by adapting the service to the frontend Pod and adding the related label within my test environment in the similar scenario; so far known issue #7787.

-- mk_sta
Source: StackOverflow