This guide will help you deploy the Bookinfo application in your environment and verify the success of the deployment.
Before you begin, ensure that:
Create a project and namespace
In Project Management, click Create Project, name it demo
, and select the cluster where you plan to deploy the Bookinfo application.
After the project is created, go to the project details page. In the left navigation panel, click Namespaces, and then Create Namespace, naming it demo-dev
.
If you already have a project and namespace suitable for the Bookinfo deployment, you can skip this step and replace the namespace in the following commands with your own namespace.
Note: Creating a project requires platform administrator permissions. If you don't have the necessary access, please contact the administrator for assistance.
Upload and extract the package
Upload the downloaded package to a server or PC that can connect to your image registry. Extract the package to obtain the following files:
bookinfo-images-arm64.tar
: ARM architecture Bookinfo images.bookinfo-images-amd64.tar
: x86 architecture Bookinfo images.push-images.sh
: Image push script that automatically updates image references in bookinfo.yaml
.bookinfo.yaml
: YAML file for Bookinfo deployment, including Service and Deployment configurations.Set script permissions
Assign execution permission to the script:
Run the script to push images
Execute the following command to push the images to your target registry:
Parameter Explanation:
source-image
: The path to the image file.target-registry
: The address and port of the image registry. Note: The prefix should not include https://
or http://
.requires-auth
: Whether authentication is required. If not required, enter false
; if required, enter true
and provide the username
and password
.username
: The username for the image registry.password
: The password for the image registry. Recommendation: Enclose it in single quotes to avoid command line parsing errors caused by special characters in the password.harbor-project
: If using a Harbor image registry, enter the project name in Harbor; if using Docker Registry, this parameter can be left empty.Deploy using kubectl
Open the container platform or platform management page, then click the kubectl
tool at the bottom-right corner.
Apply the YAML file
Use vi
or another terminal editor to paste the contents of bookinfo.yaml
and run the following command:
Verify successful deployment
Check that all Pods are in the Running
state:
Verify the application is accessible:
Expected output: