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:

ParameterRequiredDescription
metadata.nameYesSpecifies the name of the CR.
metadata.namespaceNoDefines the Namespace in which the CR is available. It is set to default unless your specify otherwise.
spec.typeMatchingNoDefines the matching type (standard or exact) for event types. When it is set to exact, Eventing does not do any kind of modifications to the provided spec.types internally. In case of standard, Eventing modifies the types internally to fulfil the backend requirements. It is set to standard unless you specify otherwise. NOTE: The exact type matching with NATS JetStream is only supported to upgrade a Subscription CR from version v1alpha1 to v1alpha2, and it will be deprecated in future.
spec.sourceYesThe origin from which events are published.
spec.typesYesDefines the list of event types used to trigger workloads.
spec.sinkYesSpecifies the HTTP endpoint where matching events should be sent to, for example: test.test.svc.cluster.local.
spec.config.maxInFlightMessagesNoThe maximum idle "in-flight messages" sent by NATS to the sink without waiting for a response. By default, it is set to 10.

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.