Deploy and Access Bookinfo

    Istio’s traffic routing rules let you easily control the flow of traffic and API calls between services. Istio simplifies configuration of service-level properties like circuit breakers, timeouts, and retries, and makes it easy to set up important tasks like A/B testing, canary rollouts, and staged rollouts with percentage-based traffic splits. It also provides out-of-box failure recovery features that help make your application more robust against failures of dependent services or the network.

    To provide consistent user experiences of managing microservices, KubeSphere integrates Istio on the container platform. This tutorial demonstrates how to deploy a sample application Bookinfo composed of four separate microservices and access it through a NodePort.

    • You need to enable KubeSphere Service Mesh.

    • You need to enable Application Governance. For more information, see .

      Note

      You need to enable Application Governance so that you can use the Tracing feature. Once it is enabled, check whether an annotation (for example, ) is added for your Route (Ingress) if the Route is inaccessible.

    Bookinfo is composed of the following four separate microservices. There are three versions of the reviews microservice.

    • The productpage microservice calls the details and reviews microservices to populate the page.
    • The details microservice contains book information.
    • The reviews microservice contains book reviews. It also calls the ratings microservice.
    • The ratings microservice contains book ranking information that accompanies a book review.

    The following figure shows the end-to-end architecture of the application. For more information, see Bookinfo Application.

    1. Log in to the console as project-regular and go to your project (). Go to Apps under Application Workloads, and then click Deploy Sample App on the right of the page.

    2. In Workloads, verify that the statuses of all four Deployments reach Running, which means the app has been created successfully.

      Note

      It may take a few minutes before the Deployments are up and running.

    Step 2: Access Bookinfo

    1. In Apps, go to Composed Apps and click the app to see its details page.

      Note

    2. On the details page, record the hostname and port number of the app which will be used to access Bookinfo.

    3. As the app will be accessed outside the cluster through a NodePort, you need to open the port in your security group for outbound traffic and set port forwarding rules if necessary.

    4. Edit your local host file (/etc/hosts) by adding an entry in it to map the hostname to the IP address. For example:

      Note

      Do not copy the preceding content to your local host file. Replace it with your own IP address and hostname.

    5. When you finish, click Access Service to access the app.

    6. In the following figure, you can notice that only Reviewer1 and Reviewer2 are displayed without any stars in the Book Reviews section. This is the status of this app version. To explore more features of traffic management, you can implement a canary release for this app.

      KubeSphere provides three kinds of grayscale strategies based on Istio, including , canary release and .