Knative: Operator’s Handbook


Knative Eventing Sources are Kubernetes Custom Resources that read external events (eg. AWS SQS, Kafka, GCP Pub/Sub) into Knative cluster and pass them to different sinks of Knative components such as Broker or Services.

Each event source has its own way of installation and configuration. For example, CronJobSource is an event source that produces events on the specified cron schedule with an in-memory timer.

Here’s an example of a CronJobSource with a schedule of every 1 min:

kind: CronJobSource
  name: test-cronjob-source
  schedule: "* * * * *"
  data: '{"message": "Hello world from cron!"}'
    apiVersion: v1
    kind: Service
    name: event-display

Create it:

$ kubectl apply -f cronjob-source.yaml created

Check that it works:

$ kubectl get cronjobsource
NAME                  READY   AGE
test-cronjob-source   True    7s

The previous sample shows Simple Delivery method where the sink is a Service.

In Complex Delivery and Broker and Trigger Delivery, the sink can be another Channel or a Broker as well.