All Products
Search
Document Center

Container Service for Kubernetes:Enable eventing to automatically trigger workflows

Last Updated:Sep 20, 2024

Workflow clusters support eventing. This allows you to build an automated system that automatically triggers workflows based on events. Eventing supports a variety of event sources, including Object Storage Service (OSS), Simple Message Queue (formerly MNS) (SMQ), Git repositories, and EventBridge.

Background information

Eventing is developed based on open source Argo Events. It completely complies with the open source eventing standards. It helps you trigger workflows in workflow clusters from external event sources.

image

Key modules:

  • Event Source

    Event sources are Argo Events custom resources. After you create an event source, an event source pod is created to collect events.

    Workflow clusters support the following event sources: Git repositories, OSS, and Simple Message Queue (formerly MNS). If you want to use other event sources, submit a ticket.

  • Event Bus

    Events collected by an event source are cached in an event bus. Event buses are classified into the following types:

    • NATS: A NATS event bus is a local message system that is created based on open source NATS and runs on an elastic container instance.

    • Simple Message Queue (formerly MNS): A Simple Message Queue (formerly MNS) event bus is a Simple Message Queue (formerly MNS) that caches events.

  • Event Sensor

    An event sensor reads events from an even bus, filters the events based on the predefined rules, and triggers a workflow. You can refer to Open source Argo events to configure trigger conditions, event transformation, and filters for event sensors.

    Event sensors can trigger only Argo workflows. To trigger other workflows, submit a ticket.

Billing

Elastic container instance fees are charged when the following resources are created. For more information, see Billing overview.

  • After an event source is created, an event source pod is automatically created. The event source pod runs on an elastic container instance.

  • After you use NATS to create an event bus, an event bus pod is created. The event bus pod runs on an elastic container instance.

  • After an event sensor is created, an event sensor pod is created. The event sensor pod runs on an elastic container instance.

Prerequisites

Procedure

  1. Obtain the ID of the workflow cluster.

    • Use the CLI

    aliyun adcp DescribeHubClusters --Profile=XFlow
    • Use the console

      Log on to the ACK One console. On the Basic Information tab of the Workflow Cluster page, obtain the ID of the workflow cluster.

  2. Run the following command to enable eventing:

    aliyun adcp UpdateHubClusterFeature --ArgoEventsEnabled true --ClusterId ***
    Important

    Replace *** that follows ClusterId with the ID of the workflow cluster you obtained in Step 1.

  3. Wait a period of time and run the following command to query the detailed information about the cluster:

    aliyun adcp DescribeHubClusterDetails --ClusterId ***
  4. If the Status field displays True for EnabledArgoEvents, eventing is enabled.

    Expected output:

     {
                                    "Message": "",
                                    "Reason": "",
                                    "Status": "True",
                                    "Type": "EnabledArgoEvents"
                            }

What to do next

After you enable eventing, workflows can be triggered by OSS events or messages from Simple Message Queue (formerly MNS). To use OSS or Simple Message Queue (formerly MNS) to trigger workflows, see the following topics: