Adding a Trigger
Cloud Container Engine (CCE) creates containerized applications from the images in SWR. When an image is updated, the new image will be automatically deployed to update the application that uses the image.
This could be realized by adding a trigger to the desired images.
A containerized application has been created on CCE from an image in SWR.
- Log in to the SWR console.
- In the navigation pane on the left, choose My Images, and click the desired image to enter its details page.
- Click the Triggers tab and then click . On the page displayed, configure the following parameters according to Table 1 and click OK.
Figure 1 Adding a trigger
Table 1 Trigger
A trigger name must be 1 to 64 characters starting with a letter. It cannot end with an underscore (_) or a hyphen (-). Only letters, digits, underscores, and hyphens are allowed. Consecutive underscores or hyphens are prohibited.
The following trigger conditions are supported:
- All trigger: Trigger image deployment when any image tags are generated or updated.
- Specific tag trigger: Trigger image deployment when a specified image tag is generated or updated.
- Regular trigger: Trigger image deployment when an image tag that meets the regular expression is generated or updated.
In this section, All trigger is selected as an example. Therefore, image deployment is triggered when any image tags are generated or updated.
Operation that will be triggered when the preset conditions are met. Currently, only container image update is supported. You need to specify the application to be updated and its container image.
Select the container whose image is to be updated.
Verifying the Trigger
In this example, All trigger is selected. Therefore, application deployment will be triggered when any image tags are generated or updated.
- Push an image with a new tag to the SWR repository. You can view the new image tag on the image details page.
Figure 2 Viewing the new image tag
- Log in to the CCE console. In the navigation pane on the left, choose Workloads. Click the name of the workload that is created from the image with an earlier tag.
- On the Instances tab page, you can see that an application instance is being created from the image with the new tag. When the creation is complete, the application has been updated.
Figure 3 Application updated
Access the workload using the access address displayed on the Access Mode page of the CCE console. Then you can view the updated workloadapplication information.