Use EventBridge as the event broker in a Knative Eventing setup to drive on-demand workloads in Container Service for Kubernetes (ACK). When an event arrives — for example, an object upload to Object Storage Service (OSS) — EventBridge routes it through the default event bus to a Trigger. The Trigger filters by event source and type, then forwards matching events to a Knative Service for processing.
Event flow: OSS upload → EventBridge → eventbridge-default-broker → Trigger (filtered by source + type) → Knative Service pod.
You can connect Object Storage Service (OSS) to EventBridge as an event source. For more information, see OSS events.
Prerequisites
Before you begin, make sure you have:
Knative Serving 1.12.7 or later installed in your ACK cluster
ossutil installed and an OSS bucket created. For details, see Install ossutil and Create a bucket
EventBridge activated and your RAM user granted the required permissions. For details, see Activate EventBridge and grant permissions to a RAM user
For an overview of EventBridge concepts, see What is EventBridge?
Step 1: Deploy the Eventing and EventBridge components
Deploy Eventing first, then EventBridge. Eventing provides the broker and trigger infrastructure; EventBridge connects Alibaba Cloud service event sources to that infrastructure.
Log on to the ACK console. In the left-side navigation pane, click ACK consoleACK consoleClusters.
On the Clusters page, click the name of the cluster you want to manage. In the left-side navigation pane, choose Applications > Knative.
On the Components tab, deploy the two components in order: Both components show Deployed in the Status column when ready.
Find Eventing and click Deploy in the Actions column.
After Eventing shows Deployed in the Status column, find EventBridge and click Deploy in the Actions column. In the dialog box, enter your AccessKey ID and AccessKey secret, then click OK. To get your AccessKey pair, see Create an AccessKey. > Note: To protect your RAM user account, bind a multi-factor authentication (MFA) device for secondary verification on console logon and sensitive operations. For details, see Bind an MFA device to a RAM user.
Step 2: Create a Knative Service
Create a Knative Service to act as the event consumer. The following steps use a service named event-display, which records all received events. This makes it useful for verifying end-to-end event delivery.
Use the ACK console
Log on to the ACK console and navigate to your cluster's Applications > Knative page.
Click the Services tab, then click Create from Template.
Paste the following YAML and submit.
apiVersion: serving.knative.dev/v1 kind: Service metadata: name: event-display namespace: default spec: template: spec: containers: - image: registry.cn-hangzhou.aliyuncs.com/knative-sample/event-display:20230207194118_3874dbdOn the Services tab, the service is ready when the Status column shows Created.
Use kubectl
Create a file named
event-display.yamlwith the following content:apiVersion: serving.knative.dev/v1 kind: Service metadata: name: event-display namespace: default spec: template: spec: containers: - image: registry.cn-hangzhou.aliyuncs.com/knative-sample/event-display:20230207194118_3874dbdApply the manifest:
kubectl apply -f event-display.yamlVerify the service is ready:
kubectl get ksvcThe service is ready when
READYisTrue:NAME URL LATESTCREATED LATESTREADY READY REASON event-display http://event-display.default.example.com event-display-00001 event-display-00001 TrueIf
READYisFalse, wait a few seconds and run the command again.
Step 3: Create a Trigger
A Trigger tells the broker which events to forward and where to send them. The broker field connects the Trigger to an event bus. The filter fields determine which events pass through — only events matching all specified attributes reach the subscriber. The subscriber field points to the Knative Service that receives matching events.
Use the ACK console
On the Knative page, click the Services tab and then click the name of the Knative Service. On the service detail page, click the Trigger tab.
Click Create Trigger and configure the parameters on the Configure page. After the Trigger is created, it appears on the Triggers tab.
Parameter Description Example Name A name for the Trigger my-service-triggerBroker Select EventBridge or Other EventBridgeEvent source The event source to filter on. Multiple event sources are supported. OSSEvent type The event type to filter on. Multiple types are supported. Events that do not match any specified type are dropped. oss:ActionTrail:ConsoleOperation
Use kubectl
Create a file named
my-service-trigger.yamlwith the following content:Field Value Effect brokereventbridge-default-brokerConnects the Trigger to the default EventBridge event bus. Events not on this bus are ignored. sourceacs.ossOnly events from OSS are forwarded. Events from other sources are dropped. typeoss:ActionTrail:ConsoleOperationOnly events of this type are forwarded. Separate multiple types with commas ( ,).subscriberService name and namespace The Knative Service that receives matching events. apiVersion: eventing.knative.dev/v1 kind: Trigger metadata: name: my-service-trigger spec: broker: eventbridge-default-broker filter: attributes: source: acs.oss type: 'oss:ActionTrail:ConsoleOperation' subscriber: ref: apiVersion: serving.knative.dev/v1 kind: Service name: helloworld-go namespace: defaultKey fields and their effect on event routing:
Apply the manifest:
kubectl apply -f my-service-trigger.yamlVerify the Trigger is ready:
kubectl get triggersThe Trigger is ready when
READYisTrue:NAME BROKER SUBSCRIBER_URI AGE READY REASON my-service-trigger eventbridge-default-broker http://helloworld-go.default.svc.cluster.local 42h TrueIf
READYisFalse, wait a few seconds and run the command again.
Step 4: Verify end-to-end event delivery
Trigger an OSS event and confirm that EventBridge delivers it to the Knative Service.
Upload an object to your OSS bucket:
ImportantThe OSS bucket and EventBridge must be in the same region.
ossutil cp <file-name> oss://<bucket-name>After the upload completes, EventBridge detects the event and routes it through the Trigger to the Knative Service.
Check the event trace in the EventBridge console:
Log on to the EventBridge console. In the left-side navigation pane, click Event Buses.
On the Event Buses page, find the default event bus and click Event Tracking in the Actions column.
On the Query By Time Range tab, set a Time Range and click Query.
Set Event Source to OSS and Event Type to Put Object, then click Event Trace in the Operations column to confirm the event was delivered.

Confirm the Knative Service consumed the event:
Check that a pod is running:
kubectl get podExpected output:
NAME READY STATUS RESTARTS AGE event-display-00001-deployment-56cc79****-z2vhv 2/2 Running 0 7sIf no pod appears, wait a few seconds and run the command again. The Knative Service scales to zero when idle and starts a new pod when it receives an event.
View the event log:
kubectl logs event-display-00001-deployment-56cc79****-z2vhv user-containerExpected output:
{"data":{"eventVersion":"1.0","responseElements":{"requestId":"63E21F5FEE852133319101AD"},"eventSource":"acs:oss","eventTime":"2023-02-07T09:52:31.000Z","requestParameters":{"sourceIPAddress":"XX.XXX.XX.XXX"},"eventName":"ObjectCreated:PutObject","userIdentity":{"principalId":"1118324452360952"},"region":"cn-hangzhou","oss":{"bucket":{"name":"knative","arn":"acs:oss:cn-hangzhou:1581204543170042:knative","virtualBucket":"","ownerIdentity":"1581204543170042"},"ossSchemaVersion":"1.0","object":{"size":225496,"objectMeta":{"mimeType":"application/octet-stream"},"deltaSize":0,"eTag":"B350C082843DAC7E9E634193437EBA30","key":"demo.data"}}}}}The log shows \"eventSource\":\"acs:oss\" and \"eventName\":\"ObjectCreated:PutObject\", confirming that EventBridge successfully triggered the Knative Service to consume the OSS upload event.
What's next
To set up event-driven workflows with other event sources, see Use GitHub events in Knative.