< img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=3131724&fmt=gif" />

Deploy and Access Bookinfo

As an open-source service mesh solution, Istio provides powerful traffic management capabilities for microservices. The KubeSphere Service Mesh extension integrates Istio, providing users with a consistent microservice management experience.

This section demonstrates how to deploy the sample application Bookinfo, which consists of four independent microservices, and how to access the application via NodePort.

Bookinfo Introduction

The application displays information about a book, similar to a single catalog entry of an online book store. Displayed on the page is a description of the book, book details (ISBN, number of pages, and so on), and a few book reviews.

The Bookinfo application is broken into four separate microservices:

  • productpage. The productpage microservice calls the details and reviews microservices to populate the page.

  • details. The details microservice contains book information.

  • reviews. The reviews microservice contains book reviews. It also calls the ratings microservice.

  • ratings. The ratings microservice contains book ranking information that accompanies a book review.

There are 3 versions of the reviews microservice:

  • Version v1 doesn’t call the ratings service.

  • Version v2 calls the ratings service, and displays each rating as 1 to 5 black stars.

  • Version v3 calls the ratings service, and displays each rating as 1 to 5 red stars.

The end-to-end architecture of the application is shown below. For more details, please refer to Bookinfo Application.

bookinfo

Prerequisites

  • Prepare a project (e.g., demo-project) and a user (e.g., project-regular). The user should have been invited to the project and has the operator role in it. For more information, please refer to Control User Permissions.

  • KubeSphere Service Mesh and KubeSphere Gateway should have been installed and enabled.

  • Enable the project gateway and enable the Tracing function for the project gateway. For more information, please refer to Enable Project Gateway.

    Note

    If you cannot access the Ingress after enabling tracing, please add the annotation nginx.ingress.kubernetes.io/service-upstream: true to the Ingress.

Steps

1. Deploy Bookinfo

  1. Log in to the KubeSphere web console as the project-regular user, click Workspace Management, enter the workspace where the project is located, and click demo-project in the project list.

  2. In the left navigation pane, select Service Mesh > Composed AppS, and click Deploy Sample App on the right side.

  3. Click Next in the dialog box that appears. The Service Settings tab is pre-filled with the required fields for the four deployments (productpage, reviews, details, ratings), and you do not need to modify the settings. Just click Create on the Ingress Settings tab.

2. Verify if Bookinfo is Deployed Successfully

In the left navigation pane, select Application Workloads > Workloads, and check the running status of these four deployments on the Deployments tab. If the status is Running, it indicates that the Bookinfo application has been deployed successfully.

3. Access Bookinfo via NodePort

  1. In the left navigation pane, select Application Workloads > Services.

  2. Click more on the right side of productpage, and select Edit External Access.

  3. Select NodePort in Access Mode, and click OK.

  4. Click productpage to enter the details page, and you can view the exposed node port in the Ports area under the Resource Status tab.

  5. Enter <Node IP>:<Node Port> in the browser to access Bookinfo from outside the cluster, as shown below.

    bookinfo display

    Note

    Depending on the deployment environment of your Kubernetes cluster, you may need to open the port in the security group and configure port forwarding rules.

  6. Click Normal user at the bottom left of the page to view the complete Bookinfo page.

    The left Book Details is provided by the details microservice, and the right Book Reviews is provided by the reviews microservice. Only Reviewer1 and Reviewer2 appear, and there is no rating (ratings) because the v1 version of the reviews microservice does not call the ratings service.

    If you want to call the ratings service and explore more traffic management functions, you can perform a Canary Release for this application.

    ratings page

    Note

    KubeSphere provides three grayscale strategies based on Istio, including blue-green deployment, canary release, and traffic mirroring. For more information, please refer to Grayscale Release.

Receive the latest news, articles and updates from KubeSphere


Thanks for the feedback. If you have a specific question about how to use KubeSphere, ask it on Slack. Open an issue in the GitHub repo if you want to report a problem or suggest an improvement.