mirror of https://github.com/istio/istio.io.git
bookinfo/Bookinfo -> BookInfo everywhere
This commit is contained in:
parent
ab01ebc976
commit
679beb4a8b
|
|
@ -24,7 +24,7 @@ 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:
|
||||
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.
|
||||
|
|
@ -39,13 +39,13 @@ There are 3 versions of the reviews microservice:
|
|||
|
||||
The end-to-end architecture of the application is shown below.
|
||||
|
||||

|
||||

|
||||
|
||||
This application is polyglot, i.e., the microservices are written in different languages.
|
||||
|
||||
## Start the application
|
||||
|
||||
1. Change your current working directory to the bookinfo application directory:
|
||||
1. Change your current working directory to the `bookinfo` application directory:
|
||||
|
||||
```bash
|
||||
cd demos/apps/bookinfo
|
||||
|
|
@ -71,12 +71,17 @@ This application is polyglot, i.e., the microservices are written in different l
|
|||
that manages incoming and outgoing calls for the service. The updated diagram looks
|
||||
like this:
|
||||
|
||||

|
||||

|
||||
|
||||
1. Confirm all services and pods are correctly defined and running:
|
||||
|
||||
```bash
|
||||
kubectl get services
|
||||
```
|
||||
|
||||
which produces the following output:
|
||||
|
||||
```bash
|
||||
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
details 10.0.0.31 <none> 9080/TCP 6m
|
||||
istio-ingress 10.0.0.122 <pending> 80:31565/TCP 8m
|
||||
|
|
@ -92,6 +97,11 @@ This application is polyglot, i.e., the microservices are written in different l
|
|||
|
||||
```bash
|
||||
kubectl get pods
|
||||
```
|
||||
|
||||
which produces
|
||||
|
||||
```bash
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
details-v1-1520924117-48z17 2/2 Running 0 6m
|
||||
istio-ingress-3181829929-xrrk5 1/1 Running 0 8m
|
||||
|
|
@ -121,7 +131,7 @@ This application is polyglot, i.e., the microservices are written in different l
|
|||
export GATEWAY_URL=$(kubectl get po -l istio=ingress -o jsonpath={.items[0].status.hostIP}):$(kubectl get svc istio-ingress -o jsonpath={.spec.ports[0].nodePort})
|
||||
```
|
||||
|
||||
1. Confirm that the bookinfo application is running with the following `curl` command:
|
||||
1. Confirm that the BookInfo application is running with the following `curl` command:
|
||||
|
||||
```bash
|
||||
curl -o /dev/null -s -w "%{http_code}\n" http://$GATEWAY_URL/productpage
|
||||
|
|
@ -134,7 +144,7 @@ This application is polyglot, i.e., the microservices are written in different l
|
|||
|
||||
Get the external IP Address (and port) of the servicegraph service:
|
||||
```bash
|
||||
$ kubectl get svc servicegraph
|
||||
kubectl get svc servicegraph
|
||||
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
servicegraph 10.75.240.195 104.196.248.114 8088:32556/TCP 23m
|
||||
```
|
||||
|
|
@ -146,7 +156,7 @@ This application is polyglot, i.e., the microservices are written in different l
|
|||
http://104.196.248.114:8088/dotviz). After the single `curl` request from an earlier step,
|
||||
the resulting image will look something like:
|
||||
|
||||

|
||||

|
||||
|
||||
The servicegraph should show very low (or zero) QPS values, as only a single request has been sent. The
|
||||
service uses a default time window of 5 minutes for calculating moving QPS averages. Send a consistent
|
||||
|
|
@ -156,12 +166,12 @@ This application is polyglot, i.e., the microservices are written in different l
|
|||
|
||||
## What's next
|
||||
|
||||
Now that you have the bookinfo sample up and running, you can use Istio to control traffic routing,
|
||||
Now that you have the BookInfo sample up and running, you can use Istio to control traffic routing,
|
||||
inject faults, rate limit services, etc..
|
||||
|
||||
* To get started, check out the [request routing task]({{home}}/docs/tasks/request-routing.html)
|
||||
|
||||
* When you're finished experimenting with the bookinfo sample, you can uninstall it as follows:
|
||||
* When you're finished experimenting with the BookInfo sample, you can uninstall it as follows:
|
||||
|
||||
1. Delete the routing rules and terminate the application pods
|
||||
|
||||
|
|
@ -173,5 +183,5 @@ inject faults, rate limit services, etc..
|
|||
|
||||
```bash
|
||||
istioctl get route-rules #-- there should be no more routing rules
|
||||
kubectl get pods #-- the bookinfo pods should be deleted
|
||||
kubectl get pods #-- the BookInfo pods should be deleted
|
||||
```
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ This task shows how to inject delays and test the resiliency of your application
|
|||
* Setup Istio by following the instructions in the
|
||||
[Installation guide](./installing-istio.html).
|
||||
|
||||
* Deploy the [bookinfo]({{home}}/docs/samples/bookinfo.html) sample application.
|
||||
* Deploy the [BookInfo]({{home}}/docs/samples/bookinfo.html) sample application.
|
||||
|
||||
* Initialize the application version routing by either first doing the
|
||||
[request routing](./request-routing.html) task or by running following
|
||||
|
|
@ -29,7 +29,7 @@ This task shows how to inject delays and test the resiliency of your application
|
|||
|
||||
## Fault injection
|
||||
|
||||
To test our bookinfo application microservices for resiliency, we will _inject a 7s delay_
|
||||
To test our BookInfo application microservices for resiliency, we will _inject a 7s delay_
|
||||
between the reviews:v2 and ratings microservices. Since the _reviews:v2_ service has a
|
||||
10s timeout for its calls to the ratings service, we expect the end-to-end flow to
|
||||
continue without any errors.
|
||||
|
|
@ -73,7 +73,7 @@ continue without any errors.
|
|||
|
||||
## Understanding what happened
|
||||
|
||||
The reason that the entire reviews service has failed is because our bookinfo application
|
||||
The reason that the entire reviews service has failed is because our BookInfo application
|
||||
has a bug. The timeout between the productpage and reviews service is less (3s + 1 retry = 6s total)
|
||||
than the timeout between the reviews and ratings service (10s). These kinds of bugs can occur in
|
||||
typical enterprise applications where different teams develop different microservices
|
||||
|
|
@ -99,4 +99,4 @@ continue without any errors.
|
|||
|
||||
* Learn more about [fault injection]({{home}}/docs/concepts/traffic-management/fault-injection.html).
|
||||
|
||||
* Limit requests to the bookinfo `ratings` service with Istio [rate limiting](./rate-limiting.html).
|
||||
* Limit requests to the BookInfo `ratings` service with Istio [rate limiting](./rate-limiting.html).
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ ServiceGraph addons:
|
|||
## Deploy your application
|
||||
|
||||
You can now deploy your own application or one of the Istio sample applications,
|
||||
for example [bookinfo]({{home}}/docs/samples/bookinfo.html). Note that the application should use HTTP/1.1
|
||||
for example [BookInfo]({{home}}/docs/samples/bookinfo.html). Note that the application should use HTTP/1.1
|
||||
or HTTP/2.0 protocol for all its HTTP traffic.
|
||||
|
||||
When deploying the application,
|
||||
|
|
@ -190,4 +190,4 @@ kubectl create -f <(istioctl kube-inject -f <your-app-spec>.yaml)
|
|||
|
||||
* Learn more about how to enable [authentication](./istio-auth.html).
|
||||
|
||||
* See the sample [bookinfo]({{home}}/docs/samples/bookinfo.html) application.
|
||||
* See the sample [BookInfo]({{home}}/docs/samples/bookinfo.html) application.
|
||||
|
|
|
|||
|
|
@ -205,4 +205,4 @@ routing traffic.
|
|||
|
||||
* Review full documentation for [istioctl kube-inject]({{home}}/docs/reference/commands/istioctl.html#istioctl-kube-inject.html)
|
||||
|
||||
* See the [bookinfo sample]({{home}}/docs/samples/bookinfo.html) for a more complete example of applications integrated on Kubernetes with Istio.
|
||||
* See the [BookInfo]({{home}}/docs/samples/bookinfo.html) sample for a more complete example of applications integrated on Kubernetes with Istio.
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ for a service within a cluster. At the end of this task, a new metric and
|
|||
a new log stream will be enabled for calls to a specific service within your
|
||||
cluster.
|
||||
|
||||
The [BookInfo sample application]({{home}}/docs/samples/bookinfo.html) is used
|
||||
The [BookInfo]({{home}}/docs/samples/bookinfo.html) sample application is used
|
||||
as the example application throughout this task.
|
||||
|
||||
## Before you begin
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ This task shows you how to use Istio to dynamically limit the traffic to a servi
|
|||
* Setup Istio by following the instructions in the
|
||||
[Installation guide](./installing-istio.html).
|
||||
|
||||
* Deploy the [bookinfo]({{home}}/docs/samples/bookinfo.html) sample application.
|
||||
* Deploy the [BookInfo]({{home}}/docs/samples/bookinfo.html) sample application.
|
||||
|
||||
* Initialize the application version routing by either first doing the
|
||||
[request routing](./request-routing.html) task or by running following
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ This task shows you how to configure dynamic request routing based on weights an
|
|||
* Setup Istio by following the instructions in the
|
||||
[Installation guide](./installing-istio.html).
|
||||
|
||||
* Deploy the [bookinfo]({{home}}/docs/samples/bookinfo.html) sample application.
|
||||
* Deploy the [BookInfo]({{home}}/docs/samples/bookinfo.html) sample application.
|
||||
|
||||
## Content-based routing
|
||||
|
||||
Because the bookinfo sample deploys 3 versions of the reviews microservice,
|
||||
Because the BookInfo sample deploys 3 versions of the reviews microservice,
|
||||
we need to set a default route.
|
||||
Otherwise if you access the application several times, you would notice that sometimes the output contains
|
||||
star ratings.
|
||||
|
|
@ -86,9 +86,9 @@ route requests to all available versions of a service in a random fashion.
|
|||
Since rule propagation to the proxies is asynchronous, you should wait a few seconds for the rules
|
||||
to propagate to all pods before attempting to access the application.
|
||||
|
||||
1. Open the Bookinfo URL (http://$GATEWAY_URL/productpage) in your browser
|
||||
1. Open the BookInfo URL (http://$GATEWAY_URL/productpage) in your browser
|
||||
|
||||
You should see the bookinfo application productpage displayed.
|
||||
You should see the BookInfo application productpage displayed.
|
||||
Notice that the `productpage` is displayed with no rating stars since `reviews:v1` does not access the ratings service.
|
||||
|
||||
1. Route a specific user to `reviews:v2`
|
||||
|
|
@ -122,7 +122,7 @@ route requests to all available versions of a service in a random fashion.
|
|||
|
||||
## Understanding what happened
|
||||
|
||||
In this task, you used Istio to send 100% of the traffic to the v1 version of each of the bookinfo
|
||||
In this task, you used Istio to send 100% of the traffic to the v1 version of each of the BookInfo
|
||||
services. You then set a rule to selectively send traffic to version v2 of the reviews service based
|
||||
a header (i.e., a user cookie) in a request.
|
||||
|
||||
|
|
@ -170,4 +170,4 @@ that we created exclusively for him:
|
|||
|
||||
* Learn more about [request routing]({{home}}/docs/concepts/traffic-management/rules-configuration.html).
|
||||
|
||||
* Test the bookinfo application resiliency by [injecting faults](./fault-injection.html).
|
||||
* Test the BookInfo application resiliency by [injecting faults](./fault-injection.html).
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ This task shows you how to setup request timeouts in Envoy using Istio.
|
|||
* Setup Istio by following the instructions in the
|
||||
[Installation guide](./installing-istio.html).
|
||||
|
||||
* Deploy the [bookinfo]({{home}}/docs/samples/bookinfo.html) sample application.
|
||||
* Deploy the [BookInfo]({{home}}/docs/samples/bookinfo.html) sample application.
|
||||
|
||||
* Initialize the application version routing by running the following command:
|
||||
|
||||
|
|
@ -65,9 +65,9 @@ to the `ratings` service.
|
|||
EOF
|
||||
```
|
||||
|
||||
1. Open the Bookinfo URL (http://$GATEWAY_URL/productpage) in your browser
|
||||
1. Open the BookInfo URL (http://$GATEWAY_URL/productpage) in your browser
|
||||
|
||||
You should see the bookinfo application working normally (with ratings stars displayed),
|
||||
You should see the BookInfo application working normally (with ratings stars displayed),
|
||||
but there is a 2 second delay whenever you refresh the page.
|
||||
|
||||
1. Now add a 1 second request timeout for calls to the `reviews` service
|
||||
|
|
@ -87,7 +87,7 @@ to the `ratings` service.
|
|||
EOF
|
||||
```
|
||||
|
||||
1. Refresh the Bookinfo web page
|
||||
1. Refresh the BookInfo web page
|
||||
|
||||
You should now see that it returns in 1 second (instead of 2), but the reviews are unavailable.
|
||||
|
||||
|
|
@ -101,7 +101,7 @@ we used Istio to inject a 2 second delay in call to `ratings`, so that we would
|
|||
`reviews` service to take longer than 1 second to complete and consequently we coud see the
|
||||
timeout in action.
|
||||
|
||||
We observed that the Bookinfo productpage (which calls the `reviews` service to populate the page),
|
||||
We observed that the BookInfo productpage (which calls the `reviews` service to populate the page),
|
||||
instead of displaying reviews, displayed
|
||||
the message: Sorry, product reviews are currently unavailable for this book.
|
||||
This was the result of it recieving the timeout error from the `reviews` service.
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ Traditionally, much of the logic handled by Istio has been built directly into a
|
|||
|
||||
#### How do I get started using Istio?
|
||||
|
||||
We recommend starting with the [BookInfo sample]({{home}}/docs/samples/bookinfo.html). The BookInfo example walks through setting up a cluster with four
|
||||
distinct
|
||||
We recommend starting with the [BookInfo]({{home}}/docs/samples/bookinfo.html) sample, which walks through setting up a cluster with
|
||||
four distinct
|
||||
microservices managed by Istio. It exercises some basic features, including content-based routing, fault injection, and rate-limiting.
|
||||
|
||||
After you have mastered the BookInfo sample, you are ready to begin using Istio for your own services. To start using Istio on your existing Kubernetes
|
||||
|
|
|
|||
Loading…
Reference in New Issue