Alibaba Cloud Container Service Kubernetes supports the application trigger function. You can use an application trigger in many ways.

Prerequisites

  • You have created a Kubernetes cluster. For more information, see Create a Kubernetes cluster.
  • You have created an application that is used to create an application trigger and test the trigger. In this example, create an nginx application.

Procedure

  1. Log on to the Container Service console.
  2. Click Application > Deployment and select a cluster and namespace. Click Details at the right of the target nginx application.


  3. On the nginx application details page, click Create Trigger on the right side of the trigger bar.


  4. In the pop-up dialog box, click Redeploy and click Confirm.
    Note Currently, only the redeploy action is supported.


    After the trigger is created, a trigger link is displayed in the trigger bar on the nginx application detail page.



  5. Copy the trigger link and visit it in the browser. A message is returned on the web page, containing information such as the request ID.


  6. Back to the nginx application detail page, you can see that a new pod appears.


    After a period of time, the nginx application removes the old pod and keeps only the new pod.

What to do next

You can call a trigger by using GET or POST in a third-party system. For example, you can run the curl command to call a trigger.

Call the redeploy trigger as follows:

curl https://cs.console.aliyun.com/hook/trigger?token=xxxxxxx