Created
May 9, 2020 04:01
-
-
Save nashmaniac/4c8a26cc33445332d1b117e7a6a1cc97 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: networking.istio.io/v1alpha3 | |
kind: VirtualService | |
metadata: | |
name: microservice-virtual-service | |
namespace: traffic-management | |
spec: | |
hosts: | |
- traffic-management.retailvoice.xyz #allowed host | |
gateways: | |
- traffic-management/ingressgateway # list of gateway from which we will be getting request forwarded | |
http: | |
- name: user-http-route | |
match: | |
- headers: # added header condition along with uri matching | |
mode: | |
exact: dev | |
uri: | |
prefix: "/user" # if url starts with /user like http://microservice.retailvoice.xyz/user will be directed here | |
rewrite: | |
uri: "/" | |
route: | |
- destination: | |
host: user-service.traffic-management.svc.cluster.local | |
subset: version2 # subset version | |
- match: | |
- uri: | |
prefix: "/user" | |
rewrite: | |
uri: "/" | |
route: | |
- destination: | |
host: user-service.traffic-management.svc.cluster.local | |
subset: version1 #subset version | |
- name: product-http-route | |
route: | |
- destination: | |
host: product-service.traffic-management.svc.cluster.local | |
port: | |
number: 8000 | |
match: | |
- uri: | |
prefix: "/product" # if url starts with /user like http://microservice.retailvoice.xyz/user will be directed here | |
rewrite: | |
uri: "/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment