Warning
You are currently viewing v2.20 of the documentation and it is not the latest. For the most recent documentation, kindly click here.
CloudEvent Support
Experimental support for cloud events
CloudEventSource CloudEventSource resource can be used in KEDA for subscribing to events that are emitted to the user’s defined CloudEvent sink.
📝 When a CloudEventSource resource is created, KEDA continues to emit Kubernetes Events and will additionally emit CloudEvents for the supported event types listed in this document.
Here is a the schema of the CloudEventSource CRD:
apiVersion: eventing.keda.sh/v1alpha1
kind: CloudEventSource
metadata:
name: {cloud-event-name}
spec:
clusterName: {cluster-name} #Optional. Will be used in the source/subject to specify where the event comes from. The default value is 'kubernetes-default' and it can also be set during the installation of KEDA with --k8sClusterName. This one will overwrite others if set.
authenticationRef:
name: {trigger-authentication-name} #Optional. Used to reference a `TriggerAuthentication` for authentication.
kind: TriggerAuthentication # Optional. Used to choose the authentication scopes. https://keda.sh/docs/latest/concepts/authentication/#authentication-scopes-namespace-vs-cluster
destination:
http:
uri: http://foo.bar
azureEventGridTopic:
endpoint: https://my-topic.eastus-1.eventgrid.azure.net/api/events
eventSubscription: #Optional. Submit included/excluded event types will filter events when emitting events.
includedEventTypes: #Optional. Only events in this section will be emitted.
- keda.scaledobject.failed.v1
excludedEventTypes: #Optional. Events in this section will not be emitted.
- keda.scaledobject.ready.v1
In general, an event emitted by KEDA would fundamentally come down to the following structure:
{
"specversion" : "1.0",
"type" : "com.cloudeventsource.keda",
"source" : "/{cluster-name}/{keda-namespace}/keda",
"subject" : "/{cluster-name}/{namespace}/{object-type}/{object-name}",
"id" : "<guid>",
"time" : "2018-04-05T17:31:00Z",
"datacontenttype" : "application/json",
"data" : {
"reason":"<event-reason>",
"message":"<event-message>"
}
}
There will be multiple types of destination to emit KEDA events to.
Here is an overview of the supported destinations:
destination:
http:
uri: http://foo.bar #An http endpoint that can receive cloudevent
destination:
azureEventGrid:
endpoint: foo.bar #endpoint from AzureEventGrid Topic
Authentication information must be provided by using authenticationRef which allows you to provide the access key or managed identity for Azure Event Grid authentication by providing a TriggerAuthentication.
Here is an overview of the supported authentication types:
accessKey - Access key string for the Azure Event Grid connection auth.Azure AD Workload Identity provider can be used.
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: nameOfTriggerAuth
namespace: default
spec:
podIdentity:
provider: azure-workload
You can include filter(s) to define what event types you are interested in, or want to ignore. This is done by using includedEventTypes or excludedEventTypes respectively for a given sink.
eventSubscription: #Optional. Submit included/excluded event types will filter events when emitting events.
includedEventTypes: #Optional. Only events in this section will be emitted.
- keda.scaledobject.failed.v1
excludedEventTypes: #Optional. Events in this section will not be emitted.
- keda.scaledobject.ready.v1
| Event Type | Scenario Description |
|---|---|
keda.scaledobject.ready.v1 | On the first time a ScaledObject is ready, or if the previous ready condition status of the object was Unknown or False |
keda.scaledobject.failed.v1 | If the check validation for a ScaledObject fails |
keda.scaledobject.removed.v1 | When a ScaledObject is deleted |
keda.scaledobject.paused.v1 | When a ScaledObject is paused |
keda.scaledobject.unpaused.v1 | When a ScaledObject is unpaused |
keda.scaledjob.ready.v1 | On the first time a ScaledJob is ready, or if the previous ready condition status of the object was Unknown or False |
keda.scaledjob.failed.v1 | If the check validation for a ScaledJob fails |
keda.scaledjob.removed.v1 | When a ScaledJob is deleted |
keda.scaledjob.paused.v1 | When a ScaledJob is paused |
keda.scaledjob.unpaused.v1 | When a ScaledJob is unpaused |
keda.scaledjob.rolloutcleanup.started.v1 | When KEDA starts cleaning up Jobs owned by the previous version of a ScaledJob |
keda.scaledjob.rolloutcleanup.completed.v1 | When KEDA completes cleanup of Jobs owned by the previous version of a ScaledJob |
keda.scaledjob.rolloutcleanup.failed.v1 | When KEDA fails to delete a Job owned by the previous version of a ScaledJob |
keda.authentication.triggerauthentication.created.v1 | On the first time a TriggerAuthentication is created |
keda.authentication.triggerauthentication.updated.v1 | When a TriggerAuthentication is updated |
keda.authentication.triggerauthentication.removed.v1 | When a TriggerAuthentication is deleted |
keda.authentication.clustertriggerauthentication.created.v1 | On the first time a ClusterTriggerAuthentication is created |
keda.authentication.clustertriggerauthentication.updated.v1 | When a ClusterTriggerAuthentication is updated |
keda.authentication.clustertriggerauthentication.removed.v1 | When a ClusterTriggerAuthentication is deleted |