Knative: Operator’s Handbook

Service

In Knative Eventing, an event eventually ends up in a Knative or Kubernetes Service. The exact route the event takes to the Service depends on the delivery mode.

In Simple Delivery, a Service is defined as the only event sink:

apiVersion: sources.eventing.knative.dev/v1alpha1
kind: CronJobSource
metadata:
  name: source
spec:
  schedule: "* * * * *"
  data: '{"message": "Hello world from cron!"}'
  sink:
    apiVersion: serving.knative.dev/v1
    kind: Service
    name: service

In Complex Delivery, a Service is defined as a subscriber to a Subscription of a Channel:

apiVersion: messaging.knative.dev/v1alpha1
kind: Subscription
metadata:
  name: subscription1
spec:
  channel:
    apiVersion: messaging.knative.dev/v1alpha1
    kind: InMemoryChannel
    name: channel
  subscriber:
    ref:
      apiVersion: serving.knative.dev/v1
      kind: Service
      name: service1

In Broker and Trigger Delivery, a Service is a subscriber in a Trigger:

apiVersion: eventing.knative.dev/v1alpha1
kind: Trigger
metadata:
  name: trigger-event-display
spec:
  subscriber:
    ref:
      apiVersion: serving.knative.dev/v1
      kind: Service
      name: event-display

In all cases, the event sink or subscriber can be a Kubernetes Service as well:

apiVersion: eventing.knative.dev/v1alpha1
kind: Trigger
metadata:
  name: trigger-event-display
spec:
  subscriber:
    ref:
      apiVersion: v1
      kind: Service
      name: event-display