1apiVersion: networking.istio.io/v1alpha32kind: DestinationRule3metadata:4 name: productpage5spec:6 host: productpage7 subsets:8 - name: v19 labels:10 version: v111---1213apiVersion: networking.istio.io/v1alpha314kind: DestinationRule15metadata:16name: reviews17spec:18host: reviews19subsets: - name: v120labels:21version: v1 - name: v222labels:23version: v2 - name: v324labels:25version: v32627---2829apiVersion: networking.istio.io/v1alpha330kind: DestinationRule31metadata:32name: ratings33spec:34host: ratings35subsets: - name: v136labels:37version: v1 - name: v238labels:39version: v2 - name: v2-mysql40labels:41version: v2-mysql - name: v2-mysql-vm42labels:43version: v2-mysql-vm4445---4647apiVersion: networking.istio.io/v1alpha348kind: DestinationRule49metadata:50name: details51spec:52host: details53subsets: - name: v154labels:55version: v1 - name: v256labels:57version: v25859---
Some basics to get us started.
1apiVersion: networking.istio.io/v1alpha32kind: VirtualService3metadata:4 name: reviews5spec:6 hosts:7 - reviews8 http:9 - route:10 - destination:11 host: reviews12 subset: v1
Using Meshery, apply custom configuration.
Refresh BookInfo productpage
1apiVersion: networking.istio.io/v1alpha32kind: VirtualService3metadata:4 name: reviews5spec:6 hosts:7 - reviews8 http:9 - route:10 - destination:11 host: reviews12 subset: v2
Using Meshery, apply custom configuration.
Refresh BookInfo productpage.
1apiVersion: networking.istio.io/v1alpha32kind: VirtualService3metadata:4 name: bookinfo5spec:6 hosts:7 - "bookinfo.meshery.io"8 gateways:9 - sample-app-gateway10 http:11 - match:12 - headers:13 User-Agent:14 regex: ^.*Mobile.*$15 route:16 - headers:17 request:18 set:19 x-response: "Success with Mobile"20 destination:21 host: productpage22 port:23 number: 908024 - route:25 - destination:26 host: product27 subset: random
Set your browser to mimic a mobile device. Enable Developer tools, if need. Refresh BookInfo productpage.
Example of using user information from HTTP headers to redirect requests.
1apiVersion: networking.istio.io/v1alpha32kind: VirtualService3metadata:4 name: reviews5spec:6 hosts:7 - reviews8 http:9 - match:10 - headers:11 end-user:12 exact: naruto13 route:14 - destination:15 host: reviews16 subset: v217 - match:18 - headers:19 end-user:20 exact: sasuke21 route:22 - destination:23 host: reviews24 subset: v325 - route:26 - destination:27 host: reviews28 subset: v1
You will need to generate load on BookInfo's productpage service. See Lab 4 for instructions for running a performance test.
1apiVersion: networking.istio.io/v1alpha32kind: VirtualService3metadata:4 name: reviews5spec:6 hosts:7 - reviews8 http:9 - route:10 - destination:11 host: reviews12 subset: v113 weight: 10014 mirror:15 host: reviews16 subset: v217 mirror_percent: 100
Incrementally increase the traffic split percentage to the higher version service #. Start at 20% traffic split
1apiVersion: networking.istio.io/v1alpha32kind: VirtualService3metadata:4 name: reviews5spec:6 hosts:7 - reviews8 http:9 - route:10 - destination:11 host: reviews12 subset: v113 weight: 8014 - destination:15 host: reviews16 subset: v317 weight: 20
Move to 50%. Observe in Meshery.
1apiVersion: networking.istio.io/v1alpha32kind: VirtualService3metadata:4 name: reviews5spec:6 hosts:7 - reviews8 http:9 - route:10 - destination:11 host: reviews12 subset: v113 weight: 5014 - destination:15 host: reviews16 subset: v317 weight: 50
Acknowledging the fallacy that the network is always reliable, you will intentionally cause a little chaos.
Note Istio Proxy's default timeout settings.
1---2apiVersion: networking.istio.io/v1alpha33kind: VirtualService4metadata:5 name: reviews6spec:7 hosts:8 - reviews9 http:10 - match:11 - headers:12 end-user:13 exact: naruto14 fault:15 delay:16 percentage:17 value: 100.018 fixedDelay: 11s19 route:20 - destination:21 host: reviews22 subset: v123 - route:24 - destination:25 host: reviews26 subset: v2
1---2apiVersion: networking.istio.io/v1alpha33kind: VirtualService4metadata:5 name: ratings6spec:7 hosts:8 - ratings9 http:10 - match:11 - headers:12 end-user:13 exact: naruto14 fault:15 delay:16 percentage:17 value: 100.018 fixedDelay: 5s19 route:20 - destination:21 host: ratings22 subset: v123 - route:24 - destination:25 host: ratings26 subset: v1
Overcoming the latency issue.
1apiVersion: networking.istio.io/v1alpha32kind: VirtualService3metadata:4 name: reviews5spec:6 hosts:7 - reviews8 http:9 - route:10 - destination:11 host: reviews12 subset: v113 retries:14 attempts: 515 perTryTimeout: 3s
If you haven't forked or cloned this repository, please do so now:
1git clone https://github.com/layer5io/advanced-istio-service-mesh-workshop
1kubectl apply -f route-v1-v2/v1.yaml
1kubectl apply -f route-v1-v2/v2.yaml
1kubectl apply -f route-header/device.yaml
1kubectl apply -f route-header/user.yaml