This topic describes how to deploy an image-based component instance and view its deployment records and logs.
Prerequisites
You have created an environment in your project. For more information, see Create and manage project environments.
You have added an image-based component. For more information, see Add and manage image-based components.
Deploy an image-based component instance
Log in to BizWorks, in the select Platform drop-down list selected microservice Development Platform.
Click the
icon or the text box in the upper-right corner of the page. From the drop-down list, click the name of the project that you want to view and click the Applications tab. On the Applications page, click the name of the target managed application. 
In the navigation pane, choose .
On the Application Deployment page, select the target environment and click the
icon in the upper-right corner of the environment card.NoteThe Application Deployment page displays multiple instances of different components within an environment, along with the workload and its type for each instance.
Users with enterprise, project owner, or application owner roles can view and manage deployments in the development environment, testing environment, staging environment, and production environment. Other roles are restricted to viewing and managing deployments in the development environment and testing environment only.
For more information about the BizWorks account and permission system, see Platform accounts and permissions.
On the Create Deployment Instance - Select Deployment Component pane, select the target image-based component and click Next.
NoteYou cannot create a duplicate deployment for a component that is already deployed in the current environment.
If the source of the image-based component is Alibaba Cloud Container Registry (ACR)
, and if you did not configure an image repository for the component when creating the project, the page displays an Image Repository Not Configured message. You must configure an image repository first.For more information, see Configure an image repository.
On the Create Instance Deployment - Deployment Configuration pane, configure the parameters and click Next.
If the image repository source is Manual Input, you need to configure the following parameters: Component source (image repository address and image tag), Pipeline (select from a drop-down list), Deployment configuration (the deployment policy supports Default policy and Custom policy; the default policy performs a rolling update to replace replicas), Network access, and Resource configuration (total number of Pods, CPU reservation, memory reservation, CPU limit, and memory limit).
If the source of the image repository is Alibaba Cloud Container Registry (Public Cloud) in your account, you can select an Image Tag. The configuration panel contains the Image Repository Address and Image Tag fields. In the Image Tag field, you can manually enter a tag or click Select Existing Image Tag to select one from a list of existing images.
Parameter
Description
Component source
If the image repository source is Manual Input, you must enter an image tag (image version).
If the image repository source is Alibaba Cloud Container Registry (public cloud) under this account, you can select an image tag.
For more information about image components, see Add and manage image-based components.
Pipeline
In the Select Pipeline drop-down list, select the target pipeline.
Default pipeline: A built-in BizWorks pipeline that provides basic features such as pulling code, compiling code, building images, and deploying applications.
Third-party pipeline:
You can integrate third-party pipeline products to access more DevOps capabilities. If you have already added a third-party pipeline to your application, you can select it to deploy the application instance. For more information, see Overview of third-party pipeline integration.
If you have enabled the Project pipeline configuration switch, the Default pipeline option does not appear in the Deployment Pipeline drop-down list. For information about how to enable the Project pipeline configuration switch, see Create and manage third-party pipeline connection configurations.
Deployment configuration
Deployment policy:
Default policy: Performs a rolling update. A new replica is started, and an old one is stopped after the new one is ready. This process continues until all replicas are updated.
Custom policy: You can choose to update By number of Pods or By percentage.
Advanced options: Click Add and complete the configuration.
Toleration: Allows Pods to be scheduled on nodes with matching taints.
The toleration settings also include Operator, Effect, and Time (seconds) fields. You can click Delete to remove a configuration row.
The rules for configuring Key and Value are as follows:
Key:
Cannot exceed 253 characters.
Can contain letters, digits, hyphens (-), and periods (.).
Must begin and end with an alphanumeric character (a-z, 0-9, A-Z).
Value:
Cannot exceed 63 characters.
Can contain letters, digits, hyphens (-), and periods (.).
If the value is not empty, it must begin and end with an alphanumeric character (a-z, 0-9, A-Z).
Network access
Configure rules for accessing the deployment instance.
To simplify deployment and debugging, BizWorks provides a network model based on Kubernetes Ingress and Service objects. If you have advanced networking requirements, you can configure them directly on the registered cluster after deployment. The Network access configuration supports two simplified scenarios:
Can be called only within the cluster: The instance can be called from within the cluster by using its Service name.
Can be called from within and outside the cluster: The instance can be called from outside the cluster by using the HTTP protocol or another TCP/UDP protocol. Within the cluster, it is still called by its Service name.
Resource configuration
Configure the Total Number of Instances and Resource Quotas per Instance. CPU resource requests and limits are measured in CPU units, where 0.1 CPU is equivalent to 100 mCPU. Memory requests and limits are measured in bytes, where 1024 MiB is equivalent to 1024 MB. The resource limit must be greater than the resource request.
Configure network access
In the Network access section of the Create instance deployment - Deployment configurations panel, click + Add network access configuration.
Specify the protocol (TCP or UDP) and port to expose on the container.
Select the Allowed Calling Scope.
If you select Can be called only within the cluster, use the automatically generated Service name and port to call the instance.
If you select Accessible from inside and outside the cluster and set External Invocation Method to HTTP (to use the HTTP method for cluster invocation), the Domain + Path routing method is supported. The platform provides two quick configuration options: Quick Configuration (Independent Domain) and Quick Configuration (Path Matching). You can click the Invocation Domain text box and select the target invocation domain from the drop-down list.
The configuration rules for Path are as follows:
Can contain uppercase and lowercase letters, digits, and the following special characters:
_@#%*./-.The Path must start with a forward slash (/), not end with a forward slash (/), and not contain consecutive forward slashes (//).
The maximum length is 50 characters.
NoteIf you use a path other than a single forward slash (/), the platform enables the Ingress rewrite rule by default, setting the Enable Rewrite parameter to Yes.
If you do not need to use the Path for routing (that is, when the Path is a forward slash (/)), the platform defaults to not adding a Rewrite rule to the Ingress by setting the Enable Rewrite parameter to No and hiding the Enable Rewrite parameter.
Rewrite support: The platform currently supports only the rewrite rules of the NGINX Ingress Controller provided by Kubernetes and does not support App Root. For more information, see Rewrite - NGINX Ingress Controller.
You cannot set the Invocation Domain to the environment domain while also setting the Path to a single forward slash (/).
If you select Can be called from within and outside the cluster and set the External Invocation Method to TCP/UDP (for non-HTTP access), the platform uses a Kubernetes NodePort to expose your instance outside the cluster.
On the Create Instance Deployment - Environment Configuration pane, complete the environment configuration and click Start Deployment. This pane includes several sections that can be enabled or disabled with a toggle switch: Lifecycle management (command, args, PostStart, and PreStop), Environment variables (key-value pairs, with support for batch configuration), Storage (mapping mount sources to container paths), Health check (with Liveness and Readiness tabs, defaulting to an httpGet check with Path:
/actuator/health/liveness, Port:8080, Scheme: HTTP,initialDelaySeconds=60,periodSeconds=10,successThreshold=1,timeoutSeconds=1, andfailureThreshold=3), and Labels (to add Kubernetes labels to the Deployment and Pod).Optional: Configure Lifecycle management.
Optional: Configure Environment variables.
Optional: Configure Storage.
Optional: Configure a health check.
Optional: Configure Labels.
Parameter
Description
Lifecycle management
ImportantIf you are not familiar with the
CMDorENTRYPOINTof the original Docker image, we recommend that you do not customize the command or args. Incorrect custom settings can cause the deployment to fail.Because the Docker runtime supports only one ENTRYPOINT command, the Command set on the Create Instance Deployment - Environment Configuration and Update Instance Deployment - Environment Configuration pages overrides the ENTRYPOINT and CMD commands set in the Docker image.
Start command: In the Start Command text box, enter the command, such as
nginx.Start parameter: Enter each argument in a separate text box. For example, enter
-gin one text box, click Add below the Start Parameter text box, and then enterdaemon offin the new text box.
Environment variables
You can configure environment variables in batches.
You can add custom configurations. For example, set the
TZenvironment variable toAsia/Shanghaito specify the time zone.Storage
Configure external storage for the container runtime environment.
Storage type: Only the PVC type is supported. When you use a PersistentVolumeClaim (PVC), ensure that it is not in exclusive use by another workload.
Mount source: The platform does not manage PVC resources. If no PVCs are available in the application deployment cluster, create a PVC in the corresponding cluster. For more information, see Create a PersistentVolumeClaim.
Path in container: A custom file path inside the container.
NoteThe system does not support configuring the external storage required by the container runtime environment for EDAS-type container clusters. EDAS-type container clusters include: Alibaba Cloud Enterprise Distributed Application Service (EDAS)
and Alibaba Cloud Enterprise Distributed Application Service (EDAS)
. For more information about clusters, see Connect to a cluster.If an application requires a PVC, you must first create it in the correct Kubernetes
namespacefor that environment. If the PVC'saccessModesis set to a specific mode, the system enforces Kubernetes standard restrictions. For more information, see Persistent Volumes.
Health check
On the Liveness Probe and Readiness Probe tabs, configure the following parameters:
initialDelaySeconds: The number of seconds to wait after the container has started before the probe starts. If set to 0, the probe starts immediately.
The default value is 60 for the Liveness Probe tab and 10 for the Readiness Probe tab. The unit is seconds (s).
PeriodSeconds: How often (in seconds) to perform the probe. The default value is 10. The unit is seconds (s).
SuccessThreshold: After a probe fails, this is the minimum number of consecutive successes required for it to be considered successful. The default is 1.
TimeoutSeconds: The number of seconds after which the probe times out. The default is 1. The unit is seconds (s).
FailureThreshold: When a probe fails, Kubernetes tries
failureThresholdtimes before giving up. The default is 3. For a liveness probe, giving up means restarting the container.
Probe configuration settings:
Path: The path of the endpoint for the health check probe. Example:
/actuator/health/liveness.Port: The port number for the application. For example, if you select the Central Middle Platform Application instance type, you can set the port number to 8080. If you select the hosted application instance type, you can set the port number to 8083.
Scheme: The HTTP protocol is supported.
HTTPHeaders: The HTTP request headers, including a name and a value.
Labels
Add Kubernetes labels to the Deployment and Pods. The platform can manage only the labels added through BizWorks.
A Created successfully message appears and a new instance component card is added to the environment. For example, on the Development Environment page for the wee1 group, an instance named imagetest2 will appear with an Executing... status, indicating the deployment is in progress.
View deployment records and logs
On the Application Deployment page, click the target instance component card. In the Deployment Records section of the instance component pane, view the deployment history. The records are displayed in a table with columns such as ID, Type (update, rollback, scale-in, scale-out, restart), Status, Operator, Completion Time, and Image Information. Each record provides links for Details and Logs.
Click Logs next to a deployment record ID to view the detailed pipeline logs for that deployment.
The results are as follows:
If the Deployment Pipeline is the default pipeline, the log in the Instance Change Record pop-up window shows the pipeline name as Default Pipeline default-common-image. The Deploy step is successful, and the log sequentially shows Prepare Application Deployment [Success], Trigger Application Deployment [Success], and Check Deployment Status [Success].
If the Deployment Pipeline is a third-party pipeline, the log pop-up window displays the pipeline type (e.g., image pipeline), pipeline instance ID, and run status (e.g., SUCCEEDED). The main area shows a scrolling log output with timestamps, including details of the build process such as environment variable configuration, cache directory preparation, and uploads.
You can click View More Run Records to see more records on the pipeline instance page.
Optional: View the detailed deployment configuration for a specific record.
Click Details next to the target deployment record ID.
On the Deployment Record Details pane, you can view information such as Deployment content, Resource specification, and Deployment policy. In this example, the deployment content type is Image, the resource specification is Resource per Instance, and the deployment policy is Default policy.
To roll back to this version, click Roll Back to This Version. In the Roll back application deployment dialog box, set the rollback policy and Release volume, and then click Roll Back. The deployment details page shows information including Operation type, Status, Deployer, Completion time, Deployment environment, Deployment content, Deployment pipeline, and Deployment policy. A View deployment logs button is also available in the upper-right corner.
. For more information about clusters, see