Run Bookinfo with Kubernetes
This module shows you an application composed of four microservices written in different programming languages: productpage
, details
, ratings
and reviews
. We call the composed application Bookinfo
, and you can learn more about it on the
Bookinfo example6 page.
The Bookinfo example6 shows the final state of the application, in which the reviews
microservice has three versions: v1
, v2
, v3
. In this module, the application only uses the v1
version of the
reviews
microservice. The next modules enhance the application by deploying newer versions of the reviews
microservice.
Deploy the application and a testing pod
Set the
MYHOST
environment variable to hold the URL of the application:Skim
bookinfo.yaml
7. This is the Kubernetes deployment spec of the app. Notice the services and the deployments.Deploy the application to your Kubernetes cluster:
Check the status of the pods:
After the four pods achieve the
Running
status, you can scale the deployment. To let each version of each microservice run in three pods, execute the following command:Check the pods status. Notice that each microservice has three pods:
After the services achieve the
Running
status, deploy a testing pod, sleep8, to use for sending requests to your microservices:To confirm that the Bookinfo application is running, send a request to it with a curl command from your testing pod:
Enable external access to the application
Once your application is running, enable clients from outside the cluster to access it. Once you configure the steps below successfully, you can access the application from your laptop’s browser.
Configure the Kubernetes Ingress resource and access your application’s webpage
Create a Kubernetes Ingress resource:
Update your /etc/hosts
configuration file
Get the IP address for the Kubernetes ingress named
bookinfo
:In your
/etc/hosts
file, add the previous IP address to the host entries provided by the following command. You should have a Superuser9 privilege and probably usesudo
10 to edit/etc/hosts
.
Access your application
Access the application’s home page from the command line:
Paste the output of the following command in your browser address bar:
You should see the following webpage:
Bookinfo Web Application Observe how microservices call each other. For example,
reviews
calls theratings
microservice using thehttp://ratings:9080/ratings
URL. See the code ofreviews
11:Set an infinite loop in a separate terminal window to send traffic to your application to simulate the constant user traffic in the real world:
You are ready to test the application12.