The bookinfo application has three different versions of the reviews microservice, and all three are up and running. Earlier, we learned that traffic is sent to all three microservices in a round-robin fashion. This scenario may not be ideal in a real-world environment.
Microservices running under Kubernetes provide us with the ability to run multiple versions of the same microservice by manipulating traffic. We will show you how this is done through the use of a VirtualService using a subset. This way, we can pinpoint traffic to a particular version. Let's get started:
- Look at the following virtual service for pinpointing all of the traffic of the reviews service only to v1 of the reviews microservice:
# Script : 03-create-virtual-service-for-v1.yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: reviews
spec:
hosts:
- reviews...