Subscription

The subscriptions.eventing.kyma-project.io CustomResourceDefinition (CRD) is a detailed description of the kind of data and the format used to subscribe to events. To get the up-to-date CRD and show the output in the YAML format, run this command:

kubectl get crd subscriptions.eventing.kyma-project.io -o yaml

Sample custom resource

This sample Subscription custom resource (CR) subscribes to an event called order.created.v1.

WARNING: Prohibited characters in event names under the spec.types property, are not supported in some backends. If any are detected, Eventing will remove them. Read Event names for more information.

NOTE: Both the subscriber and the Subscription should exist in the same Namespace.

Click to copy
apiVersion: eventing.kyma-project.io/v1alpha2
kind: Subscription
metadata:
name: test
namespace: test
spec:
typeMatching: standard
source: commerce
types:
- order.created.v1
sink: http://test.test.svc.cluster.local
config:
maxInFlightMessages: "10"

Custom resource parameters

This table lists all the possible parameters of a given resource together with their descriptions:

Subscription.eventing.kyma-project.io/v1alpha2

Spec:

ParameterTypeDescription
configmap[string]stringMap of configuration options that will be applied on the backend.
idstringUnique identifier of the Subscription, read-only.
sink (required)stringKubernetes Service that should be used as a target for the events that match the Subscription. Must exist in the same Namespace as the Subscription.
source (required)stringDefines the origin of the event.
typeMatchingstringDefines how types should be handled. - standard: backend-specific logic will be applied to the configured source and types. - exact: no further processing will be applied to the configured source and types.
types (required)[]stringList of event types that will be used for subscribing on the backend.

Status:

ParameterTypeDescription
backendobjectBackend-specific status which is applicable to the active backend only.
backend.apiRuleNamestringName of the APIRule which is used by the Subscription.
backend.emsSubscriptionStatusobjectStatus of the Subscription as reported by EventMesh.
backend.emsSubscriptionStatus.lastFailedDeliverystringTimestamp of the last failed delivery.
backend.emsSubscriptionStatus.lastFailedDeliveryReasonstringReason for the last failed delivery.
backend.emsSubscriptionStatus.lastSuccessfulDeliverystringTimestamp of the last successful delivery.
backend.emsSubscriptionStatus.statusstringStatus of the Subscription as reported by the backend.
backend.emsSubscriptionStatus.statusReasonstringReason for the current status.
backend.emsTypes[]objectList of mappings from event type to EventMesh compatible types. Used only with EventMesh as the backend.
backend.emsTypes.eventMeshType (required)stringEvent type that is used on the EventMesh backend.
backend.emsTypes.originalType (required)stringEvent type that was originally used to subscribe.
backend.emshashintegerHash used to identify an EventMesh Subscription retrieved from the server without the WebhookAuth config.
backend.ev2hashintegerChecksum for the Subscription custom resource.
backend.eventMeshLocalHashintegerHash used to identify an EventMesh Subscription posted to the server without the WebhookAuth config.
backend.externalSinkstringWebhook URL used by EventMesh to trigger subscribers.
backend.failedActivationstringProvides the reason if a Subscription failed activation in EventMesh.
backend.types[]objectList of event type to consumer name mappings for the NATS backend.
backend.types.consumerNamestringName of the JetStream consumer created for the event type.
backend.types.originalType (required)stringEvent type that was originally used to subscribe.
backend.webhookAuthHashintegerHash used to identify the WebhookAuth of an EventMesh Subscription existing on the server.
conditions[]objectCurrent state of the Subscription.
conditions.lastTransitionTimestringDefines the date of the last condition status change.
conditions.messagestringProvides more details about the condition status change.
conditions.reasonstringDefines the reason for the condition status change.
conditions.status (required)stringStatus of the condition. The value is either True, False, or Unknown.
conditions.typestringShort description of the condition.
ready (required)booleanOverall readiness of the Subscription.
types (required)[]objectList of event types after cleanup for use with the configured backend.
types.cleanType (required)stringEvent type after it was cleaned up from backend compatible characters.
types.originalType (required)stringEvent type as specified in the Subscription spec.

Subscription.eventing.kyma-project.io/v1alpha1

CAUTION: The v1alpha1 API version is deprecated as of Kyma 2.14.X.

Spec:

ParameterTypeDescription
configobjectDefines additional configuration for the active backend.
config.maxInFlightMessagesintegerDefines how many not-ACKed messages can be in flight simultaneously.
filter (required)objectDefines which events will be sent to the sink.
filter.dialectstringContains a URI-reference to the CloudEvent filter dialect. See here for more details.
filter.filters (required)[]objectDefines the BEB filter element as a combination of two CE filter elements.
filter.filters.eventSource (required)objectDefines the source of the CE filter.
filter.filters.eventSource.property (required)stringDefines the property of the filter.
filter.filters.eventSource.typestringDefines the type of the filter.
filter.filters.eventSource.value (required)stringDefines the value of the filter.
filter.filters.eventType (required)objectDefines the type of the CE filter.
filter.filters.eventType.property (required)stringDefines the property of the filter.
filter.filters.eventType.typestringDefines the type of the filter.
filter.filters.eventType.value (required)stringDefines the value of the filter.
idstringUnique identifier of the Subscription, read-only.
protocolstringDefines the CE protocol specification implementation.
protocolsettingsobjectDefines the CE protocol settings specification implementation.
protocolsettings.contentModestringDefines the content mode for eventing based on BEB. The value is either BINARY, or STRUCTURED.
protocolsettings.exemptHandshakebooleanDefines if the exempt handshake for eventing is based on BEB.
protocolsettings.qosstringDefines the quality of service for eventing based on BEB.
protocolsettings.webhookAuthobjectDefines the Webhook called by an active subscription on BEB.
protocolsettings.webhookAuth.clientId (required)stringDefines the clientID for OAuth2.
protocolsettings.webhookAuth.clientSecret (required)stringDefines the Client Secret for OAuth2.
protocolsettings.webhookAuth.grantType (required)stringDefines the grant type for OAuth2.
protocolsettings.webhookAuth.scope[]stringDefines the scope for OAuth2.
protocolsettings.webhookAuth.tokenUrl (required)stringDefines the token URL for OAuth2.
protocolsettings.webhookAuth.typestringDefines the authentication type.
sink (required)stringKubernetes Service that should be used as a target for the events that match the Subscription. Must exist in the same Namespace as the Subscription.

Status:

ParameterTypeDescription
apiRuleNamestringDefines the name of the APIRule which is used by the Subscription.
cleanEventTypes (required)[]stringCleanEventTypes defines the filter's event types after cleanup to use it with the configured backend.
conditions[]objectCurrent state of the Subscription.
conditions.lastTransitionTimestringDefines the date of the last condition status change.
conditions.messagestringProvides more details about the condition status change.
conditions.reasonstringDefines the reason for the condition status change.
conditions.status (required)stringStatus of the condition. The value is either True, False, or Unknown.
conditions.typestringShort description of the condition.
configobjectDefines the configurations that have been applied to the eventing backend when creating this Subscription.
config.maxInFlightMessagesintegerDefines how many not-ACKed messages can be in flight simultaneously.
emsSubscriptionStatusobjectDefines the status of the Subscription in EventMesh.
emsSubscriptionStatus.lastFailedDeliverystringTimestamp of the last failed delivery.
emsSubscriptionStatus.lastFailedDeliveryReasonstringReason for the last failed delivery.
emsSubscriptionStatus.lastSuccessfulDeliverystringTimestamp of the last successful delivery.
emsSubscriptionStatus.subscriptionStatusstringStatus of the Subscription as reported by EventMesh.
emsSubscriptionStatus.subscriptionStatusReasonstringReason for the current status.
emshashintegerDefines the checksum for the Subscription in EventMesh.
ev2hashintegerDefines the checksum for the Subscription custom resource.
externalSinkstringDefines the webhook URL which is used by EventMesh to trigger subscribers.
failedActivationstringDefines the reason if a Subscription failed activation in EventMesh.
ready (required)booleanOverall readiness of the Subscription.

These components use this CR:

ComponentDescription
Eventing ControllerThe Eventing Controller reconciles on Subscriptions and creates a connection between subscribers and the Eventing backend.
Event Publisher ProxyThe Event Publisher Proxy reads the Subscriptions to find out how events are used for each Application.