7 Sources and Sinks

 

This chapter covers

  • Sources, where CloudEvents come from and where to send them
  • Sinks, a key field of Sources
  • How to create, update, and inspect a Source
  • What SinkBinding is and how it works
  • Inbuilt and third-party Sources for Eventing

Sources and their slightly less visible companion, Sinks, are the bread-and-butter concepts you use most often in Knative Eventing. Quickly revisiting: a Source describes a thing that can emit CloudEvents and a place (the Sink) where those events should be sent. Sources are the canonical way of describing how CloudEvents will move between points in a Knative Eventing design. Luckily, these are not super-complicated, so this chapter will be relatively brief.

7.1 Sources

In this section, I’m going to briefly look at the anatomy of Sources, then we’ll poke one to see how it works. It’s worth remembering that while I am putting “Source” and “Sink” on the same conceptual level, Knative’s structure is that Sources are the top-level concept and that Sinks are a component of Sources.

7.1.1 The anatomy of Sources

Figure 7.1 is a representation of a Source, as seen by an X-ray machine. In figure 7.1, I’ve represented a Source as having two parts, but confusingly, only one is actually labeled ‘Source’. That box contains Sink and CloudEventOverrides. Then underneath is the very helpful ??? box. We’ll profit from ??? in a second, but first, what’s the duck inside the octagon all about?

Figure 7.1 What’s in the box?
07-01

7.1.2 Using kn to work with Sources

7.2 The Sink

7.3 The mysterious SinkBinding (and its sidekick, ContainerSource)

7.3.1 Provisioning and binding are not the same

7.4 Other Sources

Summary

References