Enable Istio on all the microservices

Previously, you enabled Istio on a single microservice, productpage. You can proceed to enable Istio on the microservices incrementally to get the Istio functionality for more microservices. For the purpose of this tutorial, you will enable Istio on all the remaining microservices in one step.

  1. For the purpose of this tutorial, scale the deployments of the microservices down to 1:

    1. $ kubectl scale deployments --all --replicas 1
  2. Redeploy the Bookinfo application, Istio-enabled. The service productpage will not be redeployed since it already has Istio injected, and its pods will not be changed. This time you will use only a single replica of a microservice.

    1. $ curl -s https://raw.githubusercontent.com/istio/istio/release-1.9/samples/bookinfo/platform/kube/bookinfo.yaml | istioctl kube-inject -f - | kubectl apply -l app!=reviews -f -
    2. $ curl -s https://raw.githubusercontent.com/istio/istio/release-1.9/samples/bookinfo/platform/kube/bookinfo.yaml | istioctl kube-inject -f - | kubectl apply -l app=reviews,version=v2 -f -
    3. service/details unchanged
    4. serviceaccount/bookinfo-details unchanged
    5. deployment.apps/details-v1 configured
    6. service/ratings unchanged
    7. serviceaccount/bookinfo-ratings unchanged
    8. deployment.apps/ratings-v1 configured
    9. serviceaccount/bookinfo-reviews unchanged
    10. service/productpage unchanged
    11. serviceaccount/bookinfo-productpage unchanged
    12. deployment.apps/productpage-v1 configured
    13. deployment.apps/reviews-v2 configured
  3. Access the application’s webpage several times. Note that Istio was added transparently, the original application did not change. It was added on the fly, without the need to undeploy and redeploy the whole application.

  4. Check the application pods and verify that now each pod has two containers. One container is the microservice itself, the other is the sidecar proxy attached to it:

    1. $ kubectl get pods
    2. details-v1-58c68b9ff-kz9lf 2/2 Running 0 2m
    3. productpage-v1-59b4f9f8d5-d4prx 2/2 Running 0 2m
    4. ratings-v1-b7b7fbbc9-sggxf 2/2 Running 0 2m
    5. reviews-v2-dfbcf859c-27dvk 2/2 Running 0 2m
    6. sleep-88ddbcfdd-cc85s 1/1 Running 0 7h
  5. Access the Istio dashboard using the custom URL you set in your /etc/hosts file previously:

    1. http://my-istio-dashboard.io/dashboard/db/istio-mesh-dashboard
  6. In the top left drop-down menu, select Istio Mesh Dashboard. Note that now all the services from your namespace appear in the list of services.

    Istio Mesh Dashboard

    Istio Mesh Dashboard

  7. Check some other microservice in Istio Service Dashboard, e.g. ratings :

    Istio Service Dashboard

    Istio Service Dashboard

  8. Visualize your application’s topology by using the Kiali console, which is not a part of Istio, but is installed as part of the demo configuration. Access the dashboard using the custom URL you set in your /etc/hosts file previously:

    1. http://my-kiali.io/kiali/console

    If you installed Kiali as part of the getting started instructions, your Kiali console user name is admin and the password is admin.

  9. Click on the Graph tab and select your namespace in the Namespace drop-down menu in the top level corner. In the Display drop-down menu mark the Traffic Animation check box to see some cool traffic animation.

    Kiali Graph Tab, display drop-down menu

    Kiali Graph Tab, display drop-down menu

  10. Try different options in the Edge Labels drop-down menu. Hover with the mouse over the nodes and edges of the graph. Notice the traffic metrics on the right.

    Kiali Graph Tab, edge labels drop-down menu

    Kiali Graph Tab, edge labels drop-down menu

    Kiali Graph Tab

    Kiali Graph Tab

You are ready to configure the Istio Ingress Gateway.