All Products
Search
Document Center

Container Service for Kubernetes:Event-driven CI pipeline based on EventBridge

Last Updated:Apr 03, 2026

This topic describes how to use EventBridge and the distributed workflow engine Argo Workflows to build an efficient, fast, and cost-effective event-driven CI pipeline. This solution simplifies and accelerates application delivery.

Prerequisites

Overview

An event-driven automated CI pipeline consists of two parts:

  1. Git event trigger: An event is triggered when you commit code to a Git repository.

  2. CI workflow execution: The CI system runs pre-build tests, builds a Docker image, and pushes it to an image repository.

After the image is successfully built, you can use a Continuous Deployment (CD) system, such as ACK One GitOps, to sync the new image tag to your Kubernetes cluster.

image

In this tutorial, the event-driven solution uses EventBridge, which offers advantages in areas such as availability, ease of use, security, and scalability. The CI component is built on Argo Workflows, a CNCF graduated project. The ACK One workflow cluster fully manages Argo Workflows, improves performance in aspects such as stability and observability, provides operations and maintenance (O&M) capabilities, and helps you implement larger-scale CI pipelines with faster execution speeds and at lower costs.

image
  1. A user commits code to the Git repository.

  2. EventBridge captures the Git event based on the configured event rule and delivers the event to the ACK One workflow cluster to trigger the CI workflow.

  3. A CI workflow in the ACK One workflow cluster builds a Docker image and pushes it to an image repository. You can then use GitOps to automatically sync the image changes to an ACK cluster.

Step 1: Prepare the CI environment

  1. Create access credentials for ACR EE and mount a NAS volume. For more information, see Step 1 and Step 2 in Create a CI pipeline for a Go project in a workflow cluster.

    Note

    Ensure the namespace is the same as the one specified for the Workflow resource.

  2. The sample app code repository for this topic is the echo-server project. Fork this project to your GitHub account and modify the WorkflowTemplate by following the instructions in Clone a private Git repository in a CI pipeline.

Step 2: Implement a Git event-driven CI pipeline

  1. Create a custom event bus.

  2. Integrate EventBridge with GitHub. For more information, see GitHub integration.

  3. (Optional) Configure an event rule. This example uses the following configuration. For more information about configuring an event rule, see Manage event rules.

    1. Event pattern: The following pattern triggers events only for changes to the release-v1 branch.

      {
          "source": [
              "github.event"
          ],
          "data": {
              "body": {
                  "ref": [
                      "refs/heads/release-v1"
                  ]
              }
          }
      }
      
    2. Configure an event target.

      1. Service Type: Select Container Service for Kubernetes.

      2. Kubernetes Cluster File: Enter the kubeconfig of the ACK One workflow cluster.

      3. YAML Configuration: For this example, select Template.

      4. Variable: Add the workflowName variable and set it to the event ID.

        {
        	"workflowName": "$.id"
        }
      5. Template: Enter the Workflow CI custom resource (CR). Use the following example as a reference and configure the CR with your information.

        Important

        In the resource configuration, you must explicitly set the name and namespace. You cannot use generateName. Even if the resource belongs to the default namespace, you must still declare it.

        apiVersion: argoproj.io/v1alpha1
        kind: Workflow
        metadata:
          name: ci-go-v1-eb-${workflowName}
          namespace: default
          labels:
            workflows.argoproj.io/workflow-template: ackone-ci
        spec:
          arguments:
            parameters:
            - name: repo_url
              value: https://github.com/ivan-cai/echo-server.git
            - name: repo_name
              value: echo-server
            - name: target_branch
              value: release-v1
            - name: container_image
              value: "YOUR-IMAGE-REGISTRY-ADDRESS"     # The address of your image repository. Replace this with your actual address.
            - name: container_tag
              value: "v1.0.0"
            - name: dockerfile
              value: ./Dockerfile
            - name: enable_suffix_commitid
              value: "true"
            - name: enable_test
              value: "true"
          workflowTemplateRef:
            name: ci-go-v1
            clusterScope: true
      6. Network Access: For this example, select Internet.

  4. With this configuration, any code change committed to the release-v1 branch of your GitHub repository triggers the automated workflow. You can verify this in the following ways:

    1. View the event trace.

      1. Log on to the EventBridge console. In the left-side navigation pane, click Event Buses.

      2. Click the name of the target event bus. In the left-side navigation pane, click Event Tracking.

      3. On the Event tracing page, you can view the corresponding event trace.

        image

    2. View the execution topology of the new workflow.

      View the execution topology of the new workflow in the ACK One workflow cluster. For more information, see Enable the Argo server to access a workflow cluster.

      image