You can use triggers provided by Application Center to remotely deploy or redeploy
applications. This topic describes how to use a trigger to enable automatic application
update.
Background information
In this topic, the image version used by the application specifies that the red color
appears on the application page. You can change the image version to one that specifies
the blue color. Then, use a trigger to update the application. After the application
is updated, you can access the application by using your browser to check whether
the color is changed. The result indicates whether the application is successfully
updated by the trigger. If the color that appears on the application page is changed
to blue, it indicates that the image version of the application is changed. This also
indicates that the automatic application update is successfully performed by the trigger.
Update the orchestration template
- Log on to the ACK console.
- In the left-side navigation pane of the ACK console, choose .
- On the Templates page, find the orchestration template that is used to deploy the application and
click Details below the template name.
- Change the image registry to
registry.cn-hangzhou.aliyuncs.com/acs/rollouts-demo:blue
in the template. Click Save.
Update the application
- Log on to the ACK console.
- In the left-side navigation pane of the ACK console, choose .
- On the Application Center page, find the application and click Details in the Actions column.
- On the application details page, click Trigger in the upper-right corner.
- In the Trigger panel, click Create. After the webhook URL of the trigger appears, click Copy.
- Run the following command to use the trigger to redeploy the application:
curl <URL of the trigger>
Expected output:
null
Verify the result
- Gets the endpoint of the application.
- Log on to the ACK console.
- In the left-side navigation pane of the ACK console, click Clusters.
- On the Clusters page, find the cluster that you want to manage and click the name of the cluster
or click Details in the Actions column. The details page of the cluster appears.
- In the left-side navigation pane of the details page, choose .
- View the endpoint of the demo on the routing page.
- Enter the following in the hosts file.
<endpoint> app.demo.example.com
- Enter app.demo.example.com in the address bar of your browser and press Enter to access the application.
If the page appears as shown in the following figure, it indicates that the application
is updated.