anchor.diff:      kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=servicegraph -o jsonpath='{.items[0].metadata.name}') 8088:8088 &
       open http://localhost:8088/dotviz
   
  -You should see a distributed trace that looks something like this. It may take a few seconds for Servicegraph to become
  -available, so refresh the browser if you do not receive a response.
  +You should see a distributed trace that looks something like this. It may take a few seconds for Servicegraph to become available, so refresh the browser if you do not receive a response.
   
   image::istio-trace.png[]
   
  
positive.code: 
  Remove the installed components
  
  ```
  kubectl delete -f install/kubernetes/addons/servicegraph.yaml
  kubectl delete -f install/kubernetes/addons/prometheus.yaml
  kubectl delete -f install/kubernetes/istio-auth.yaml
  kubectl delete -f install/kubernetes/istio.yaml
  ./samples/bookinfo/kube/cleanup.sh
  ```
  
  Accept the `default` namespace in the cleanup script above.
  Some errors may appear in the output when deleting Istio. These are related to Istio components you have not installed,
  so no need to worry about these. You can confirm that everything has been uninstalled as follows. No Istio or Bookinfo
  components should remain:
  
      kubectl get all
      kubectl get all --namespace istio-system
  
negative.code: ```
  $ kubectl get all
  NAME                    DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
  deploy/details-v1       1         1         1            1           3h
  deploy/productpage-v1   1         1         1            1           3h
  deploy/ratings-v1       1         1         1            1           3h
  deploy/reviews-v1       1         1         1            1           3h
  deploy/reviews-v2       1         1         1            1           3h
  deploy/reviews-v3       1         1         1            1           3h
  
  NAME                           DESIRED   CURRENT   READY     AGE
  rs/details-v1-39705650         1         1         1         3h
  rs/productpage-v1-1382449686   1         1         1         3h
  rs/ratings-v1-3906799406       1         1         1         3h
  rs/reviews-v1-2953083044       1         1         1         3h
  rs/reviews-v2-348355652        1         1         1         3h
  rs/reviews-v3-4088116596       1         1         1         3h
  
  NAME                    DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
  deploy/details-v1       1         1         1            1           3h
  deploy/productpage-v1   1         1         1            1           3h
  deploy/ratings-v1       1         1         1            1           3h
  deploy/reviews-v1       1         1         1            1           3h
  deploy/reviews-v2       1         1         1            1           3h
  deploy/reviews-v3       1         1         1            1           3h
  
  NAME                                 READY     STATUS    RESTARTS   AGE
  po/details-v1-39705650-vc2x0         2/2       Running   0          3h
  po/productpage-v1-1382449686-b7frw   2/2       Running   0          3h
  po/ratings-v1-3906799406-11pcn       2/2       Running   0          3h
  po/reviews-v1-2953083044-sktvt       2/2       Running   0          3h
  po/reviews-v2-348355652-xbbbv        2/2       Running   0          3h
  po/reviews-v3-4088116596-pkkjk       2/2       Running   0          3h
  ```
  
  If all components were installed successfully, you should be able to see the product page. This may take a minute or two, first for the Ingress to be created, and secondly for the Ingress to hook up with the services it exposes. Just keep refreshing the browser until the booking product page appears.
  
    ISTIO_INGRESS=$(kubectl get ingress gateway -o jsonpath="{.status.loadBalancer.ingress[0].*}")
    open http://$ISTIO_INGRESS/productpage
  
  It looks like as shown:
  
  image::istio-sample-app-product-page.png[]
  
  === Weighted routing
  
  The sample application is pretty useful. You can see in the `kubectl get all` command above that its deployed
  more than one version of the 'reviews' microservice. We're going to use weighted routing to route
  50% of the traffic to v3 of the reviews microservice. v3 shows stars for each review, whereas v1 does not.
  We'll then query the bookinfo product page a few times and count the number of times a review page appears
  containing stars for a review; this will indicate we are being routed to v3 of the reviews page.
  
      $ kubectl create -f samples/bookinfo/kube/route-rule-all-v1.yaml
      routerule "productpage-default" created
      routerule "reviews-default" created
      routerule "ratings-default" created
      routerule "details-default" created
      $ kubectl replace -f samples/bookinfo/kube/route-rule-reviews-50-v3.yaml
      routerule "reviews-default" replaced
  
  The Envoy proxy does not round robin the routing to different versions of the microservice, so if you access
  the product page twice you are unlikely to see one request use v1 of reviews, and a second request use v3. However, over a hundred requests 50% of them should be routed to v3 of the reviews page. We can test this using
  the script below. Make sure you don't have a file called `mfile` in your current folder before running this.
  The script sends 100 `curl` requests to the bookinfo product page, which may take around 30s, and then counts
  those which have stars in the response. For the eagle eyed amongst you, the divde by 2 is because the
  productpage html contains two reviewers, and we simply want to count the number of `curls` that returned
  "`full stars`" in the review page. Out of 100 curls we expect 50 of them to contain "`full stars`".
  
      ISTIO_INGRESS=$(kubectl get ingress gateway -o jsonpath="{.status.loadBalancer.ingress[0].*}")
      for((i=1;i<=100;i+=1));do curl  -s http://$ISTIO_INGRESS/productpage >> mfile; done;
      a=$(grep 'full stars' mfile | wc -l) && echo Number of calls to v3 of reviews service "$(($a / 2))"
  
  It shows the output as:
  
      Number of calls to v3 of reviews service 50
  
  Finally, remove the temporary file:
  
      rm mfile
  
  This weighted routing was handled by Istio routing the traffic between the versions and scaling the reviews
  