Bookinfo testing and validation procedures¶
The Bookinfo application serves as a canonical sample application for demonstrating and validating Istio functionality. Testing and validating Bookinfo involves a specific workflow that includes building custom container images, pushing them to a registry, deploying the application to a cluster, and verifying end-to-end connectivity^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__bookinfo__README.md].
This document outlines the procedures contributors should follow to ensure changes function correctly before requesting official image builds^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__bookinfo__README.md].
Prerequisites for Validation¶
Before official images are built and pushed to the Istio repository, the owner of a Pull Request (PR) is responsible for performing appropriate testing^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__bookinfo__README.md]. This requires building and pushing images to a personal or private Docker Registry to verify the changes independently^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__bookinfo__README.md].
Image Build and Deployment¶
Building Images¶
The build process requires a version tag and a registry prefix^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__bookinfo__README.md].
cd samples/bookinfo
src/build-services.sh <version> <prefix>
<version>: The tag for the image (e.g.,1.16.3). Note that Bookinfo versions are independent of Istio versions^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__bookinfo__README.md].<prefix>: The target Docker registry^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__bookinfo__README.md].
Pushing Images and Updating Manifests¶
To streamline the workflow, a helper script is provided to build images, push them to the Docker Registry, and update the local YAML manifests with the new tags in a single step^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__bookinfo__README.md].
./build_push_update_images.sh <version> --prefix=<prefix>
After running this script, users should verify that the platform/kube/bookinfo*.yaml files reflect the expected tag updates^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__bookinfo__README.md].
Validation Procedures¶
Once images are pushed and manifests are updated, the application should be deployed to a Kubernetes cluster to validate functionality^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__bookinfo__README.md].
1. Deployment¶
Apply the updated Bookinfo configuration:
[kubectl](<./kubectl.md>) apply -f samples/bookinfo/platform/kube/bookinfo.yaml
Wait for all pods to reach the Running state^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__bookinfo__README.md]. You can check the status using kubectl get pods.
2. Connectivity Verification¶
Validation ensures that the productpage service can successfully communicate with the ratings service^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__bookinfo__README.md].
- CLI Test: Execute a command from within the
ratingspod to curl theproductpageservice. A successful response will include the HTML title.Expected Output:[kubectl](<./kubectl.md>) exec -it "$([kubectl](<./kubectl.md>) get pod -l app=ratings -o jsonpath='{.items[0].metadata.name}')" -c ratings -- curl productpage:9080/productpage | grep -o "<title>.*</title>"<title>Simple Bookstore App</title> - Browser Test: Access the application via the external URL (e.g.,
http://<IP>:<PORT>/productpage) to visually confirm the "Simple Bookstore App" is loading correctly^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__bookinfo__README.md].
Integration and Final Review¶
If the local validation passes, the contributor should request that a reviewer build and push a new official set of images^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__bookinfo__README.md]. A final commit containing version changes should be added to the original PR^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__bookinfo__README.md].
Additionally, Bookinfo undergoes automated testing via Istio.io integration tests, which are located in the tests directory of the istio/[Istio](<./istio.md>).io repository^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__bookinfo__README.md].
Related Concepts¶
- Istio
- [[流程化筆記]]: For documenting these testing procedures.
- 20/80 Learning Principle: Useful for learning the subset of Bookinfo/Istio commands needed for quick validation.
Sources¶
400-devops__07-Monitoring-and-Observability__k8s-istio__samples__bookinfo__README.md