VirtualService - HttpMatch - sourceLabels - mesh gateway

Hi,

I am trying to use sourceLabels with mesh reserved gateway in virtualservice to route to destination host within mesh. but its not working. can anyone share working samples of deployment,service which uses virtualservice with mesh reserved gateway and sourceLabels.

http:

  • name: fsbhandler-v1
    match:

    • uri:
      prefix: /fsbhttphandler/
    • sourceLabels:
      version: v1
      app: ui
    • gateways:
      • mesh
        route:
    • destination:
      host: fip-svc
      port:
      number: 9080
      subset: v1
  • name: fbmlstrf-v1
    match:

    • uri:
      prefix: /rof-svc/
    • sourceLabels:
      version: v1
      app: fip
    • gateways:
      • mesh
        route:
    • destination:
      host: rof-svc
      port:
      number: 8080
      subset: v1
  • name: fiui
    match:

    • uri:
      prefix: /fiuicore/
    • gateways:
      • mesh
        route:
    • destination:
      host: ui-svc..svc.cluster.local
      port:
      number: 9080
      subset: v1

Problem:
when i submit api request from browser url
(https://host:port/uicore/) in virtualservice it matches third match via ingressgateway>gateway>virtualservice
and then internally from ui-svc(app ui) it executes one more servlet request with path http://host:port/fsbhttphandler/fihttp and then execute one more servlet request http://rof-svc:port/rof-svc/.

in this flow, routing is working till second layer from ui-svc to fip-svc, but from fip-svc it was not able to route to rof-svc.

this looks very similar to the bookinfo demo istio uses. maybe deploy it and compare with your applications? https://istio.io/latest/docs/examples/bookinfo/

sourceLabels are working fine with below without - at sourcelabels to treat the match with AND condition, if we put - , it match was treated as OR condition between uri and sourcelabes.

http:

  • name: fsbhandler-v1
    match:
    • uri:
      prefix: /fsbhttphandler/
      sourceLabels:
      version: v1