Log on to the Container Service console.
Click Applications in the left navigation pane and click Create Application in the upper-right corner.
Set the basic application information.
- Name: The name of the application to be created. It must contain 1~64 characters, and can be composed of numbers, Chinese characters, English letters, and hyphen (-).
- Version: The version of the application to be created. By default, the version is 1.0.
Cluster: The cluster which the application will be deployed to.
Update Method: The release method pf the application. You can select Standard Release or Blue-Green Release. Refer to Instructions on Release Strategies.
- Description: Information of the application. It can be left blank and, if entered, cannot exceed 1,024 characters. This information will be displayed in the Application List page.
- Pull Docker Image: When selected, Container Service pulls the latest Docker image in the registry to create the application, even when the tag of the image does not change.
In order to improve efficiency, Container Service caches the image; and at deployment, if the tag of the image is consistent with that of the local cache, Container Service uses the cached image instead of pulling the image from the registry. Therefore, if you modify your code and image but do not modify the image tag, Container Service will use the old image cached locally to deploy the application. When this option is selected, Container Service ignores the cached image and re-pulls the image from the registry no matter whether the tage of the image is consistent with that of the cached image, ensuring that the latest image and code are always used.
Click Create with Image or Create with Orchestration Template.
Click Create with Image.
- Set the Image Name and Image Version.
You can select a recommended image from the Container Service (click Select image. Click the desired image and click OK) or enter the information of your own image. By default, the Container Service uses the latest version of the image. If you want to use another version of the image, click Select image version, click the desired version and click OK.
Set the number of containers (Scale).
Set the Network Mode.
Currently, the Container Service supports two network modes: Default and host. If you do not set this parameter, the Default mode is used by default.
Set the Restart parameter, namely whether to restart the container automatically in case of exception.
Set the launch command (Command and Entrypoint) of the container.
If specified, this will overwrite the image configuration.
Set the resource limits (CPU Limit and Memory Limit) of the container.
For more details of container resource limits, refer to Limit container resources.
Set the Port Mapping, Web Routing and Load Balancer parameters.
Set the container Data Volume.
Set the Environment variables.
Set the container Labels.
For more information on container labels, refer to Label description.
Set whether to enable container Smooth Upgrade.
For more details, refer to the description of rolling_updates in Label description.
Set the container Across Multiple zones settings.
You can select Ensure to distribute the containers in two different zones; if you select this option, the container creation fails if there are less than two zones in the current cluster or if the containers cannot be distributed in two different zones due to limited machine resources. If you select Try best, the Container Service will distribute the containers in two different zones as long as possible and the containers will still be created successfully even if they cannot be deployed in two different zones.
If you do not set this setting, the Container Service will distribute the containers in a single zone by default.
For more information, refer to High-availability scheduling.
Set the container Auto Scaling rules.
For more details on how to set container auto scaling, refer to Container auto scaling.
Click Create and the Container Service creates the application according to the preceding settings.
- Set the Image Name and Image Version.
Click Create with Orchestration Template.
Click Use Existing Orchestration Template.
Select a template and click Select.
The content of the orchestration template must comply with the Docker Compose format.
Edit the template.
You can edit the orchestration template according to your needs. You can directly make modification in the template, or you can select a service at the right side and click Edit to make modifications or click Delete to delete the service.
In addition, you can click Add Service, select the desired image in the pop-up dialog box, and set desired configurations to add services to the template.
Click Create and Deploy.