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.
apiVersion: eventing.kyma-project.io/v1alpha2kind: Subscriptionmetadata: name: test namespace: testspec: 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:
Parameter | Type | Description |
---|---|---|
config | map[string]string | Map of configuration options that will be applied on the backend. |
id | string | Unique identifier of the Subscription, read-only. |
sink (required) | string | Kubernetes 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) | string | Defines the origin of the event. |
typeMatching | string | Defines 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) | []string | List of event types that will be used for subscribing on the backend. |
Status:
Parameter | Type | Description |
---|---|---|
backend | object | Backend-specific status which is applicable to the active backend only. |
backend.apiRuleName | string | Name of the APIRule which is used by the Subscription. |
backend.emsSubscriptionStatus | object | Status of the Subscription as reported by EventMesh. |
backend.emsSubscriptionStatus.lastFailedDelivery | string | Timestamp of the last failed delivery. |
backend.emsSubscriptionStatus.lastFailedDeliveryReason | string | Reason for the last failed delivery. |
backend.emsSubscriptionStatus.lastSuccessfulDelivery | string | Timestamp of the last successful delivery. |
backend.emsSubscriptionStatus.status | string | Status of the Subscription as reported by the backend. |
backend.emsSubscriptionStatus.statusReason | string | Reason for the current status. |
backend.emsTypes | []object | List of mappings from event type to EventMesh compatible types. Used only with EventMesh as the backend. |
backend.emsTypes.eventMeshType (required) | string | Event type that is used on the EventMesh backend. |
backend.emsTypes.originalType (required) | string | Event type that was originally used to subscribe. |
backend.emshash | integer | Hash used to identify an EventMesh Subscription retrieved from the server without the WebhookAuth config. |
backend.ev2hash | integer | Checksum for the Subscription custom resource. |
backend.eventMeshLocalHash | integer | Hash used to identify an EventMesh Subscription posted to the server without the WebhookAuth config. |
backend.externalSink | string | Webhook URL used by EventMesh to trigger subscribers. |
backend.failedActivation | string | Provides the reason if a Subscription failed activation in EventMesh. |
backend.types | []object | List of event type to consumer name mappings for the NATS backend. |
backend.types.consumerName | string | Name of the JetStream consumer created for the event type. |
backend.types.originalType (required) | string | Event type that was originally used to subscribe. |
backend.webhookAuthHash | integer | Hash used to identify the WebhookAuth of an EventMesh Subscription existing on the server. |
conditions | []object | Current state of the Subscription. |
conditions.lastTransitionTime | string | Defines the date of the last condition status change. |
conditions.message | string | Provides more details about the condition status change. |
conditions.reason | string | Defines the reason for the condition status change. |
conditions.status (required) | string | Status of the condition. The value is either True , False , or Unknown . |
conditions.type | string | Short description of the condition. |
ready (required) | boolean | Overall readiness of the Subscription. |
types (required) | []object | List of event types after cleanup for use with the configured backend. |
types.cleanType (required) | string | Event type after it was cleaned up from backend compatible characters. |
types.originalType (required) | string | Event 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:
Parameter | Type | Description |
---|---|---|
config | object | Defines additional configuration for the active backend. |
config.maxInFlightMessages | integer | Defines how many not-ACKed messages can be in flight simultaneously. |
filter (required) | object | Defines which events will be sent to the sink. |
filter.dialect | string | Contains a URI-reference to the CloudEvent filter dialect. See here for more details. |
filter.filters (required) | []object | Defines the BEB filter element as a combination of two CE filter elements. |
filter.filters.eventSource (required) | object | Defines the source of the CE filter. |
filter.filters.eventSource.property (required) | string | Defines the property of the filter. |
filter.filters.eventSource.type | string | Defines the type of the filter. |
filter.filters.eventSource.value (required) | string | Defines the value of the filter. |
filter.filters.eventType (required) | object | Defines the type of the CE filter. |
filter.filters.eventType.property (required) | string | Defines the property of the filter. |
filter.filters.eventType.type | string | Defines the type of the filter. |
filter.filters.eventType.value (required) | string | Defines the value of the filter. |
id | string | Unique identifier of the Subscription, read-only. |
protocol | string | Defines the CE protocol specification implementation. |
protocolsettings | object | Defines the CE protocol settings specification implementation. |
protocolsettings.contentMode | string | Defines the content mode for eventing based on BEB. The value is either BINARY , or STRUCTURED . |
protocolsettings.exemptHandshake | boolean | Defines if the exempt handshake for eventing is based on BEB. |
protocolsettings.qos | string | Defines the quality of service for eventing based on BEB. |
protocolsettings.webhookAuth | object | Defines the Webhook called by an active subscription on BEB. |
protocolsettings.webhookAuth.clientId (required) | string | Defines the clientID for OAuth2. |
protocolsettings.webhookAuth.clientSecret (required) | string | Defines the Client Secret for OAuth2. |
protocolsettings.webhookAuth.grantType (required) | string | Defines the grant type for OAuth2. |
protocolsettings.webhookAuth.scope | []string | Defines the scope for OAuth2. |
protocolsettings.webhookAuth.tokenUrl (required) | string | Defines the token URL for OAuth2. |
protocolsettings.webhookAuth.type | string | Defines the authentication type. |
sink (required) | string | Kubernetes 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:
Parameter | Type | Description |
---|---|---|
apiRuleName | string | Defines the name of the APIRule which is used by the Subscription. |
cleanEventTypes (required) | []string | CleanEventTypes defines the filter's event types after cleanup to use it with the configured backend. |
conditions | []object | Current state of the Subscription. |
conditions.lastTransitionTime | string | Defines the date of the last condition status change. |
conditions.message | string | Provides more details about the condition status change. |
conditions.reason | string | Defines the reason for the condition status change. |
conditions.status (required) | string | Status of the condition. The value is either True , False , or Unknown . |
conditions.type | string | Short description of the condition. |
config | object | Defines the configurations that have been applied to the eventing backend when creating this Subscription. |
config.maxInFlightMessages | integer | Defines how many not-ACKed messages can be in flight simultaneously. |
emsSubscriptionStatus | object | Defines the status of the Subscription in EventMesh. |
emsSubscriptionStatus.lastFailedDelivery | string | Timestamp of the last failed delivery. |
emsSubscriptionStatus.lastFailedDeliveryReason | string | Reason for the last failed delivery. |
emsSubscriptionStatus.lastSuccessfulDelivery | string | Timestamp of the last successful delivery. |
emsSubscriptionStatus.subscriptionStatus | string | Status of the Subscription as reported by EventMesh. |
emsSubscriptionStatus.subscriptionStatusReason | string | Reason for the current status. |
emshash | integer | Defines the checksum for the Subscription in EventMesh. |
ev2hash | integer | Defines the checksum for the Subscription custom resource. |
externalSink | string | Defines the webhook URL which is used by EventMesh to trigger subscribers. |
failedActivation | string | Defines the reason if a Subscription failed activation in EventMesh. |
ready (required) | boolean | Overall readiness of the Subscription. |
Related resources and components
These components use this CR:
Component | Description |
---|---|
Eventing Controller | The Eventing Controller reconciles on Subscriptions and creates a connection between subscribers and the Eventing backend. |
Event Publisher Proxy | The Event Publisher Proxy reads the Subscriptions to find out how events are used for each Application. |