Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/spec/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Knative Eventing API spec

This directory contains the specification of the Knative Eventing API, which is
implemented in [`channels.knative.dev`](/pkg/apis/channels/v1alpha1) and
[`feeds.knative.dev`](/pkg/apis/feeds/v1alpha1) and verified via [the e2e
test](/test/e2e).

**Updates to this spec should include a corresponding change to the
API implementation for [channels](/pkg/apis/channels/v1alpha1) or
in [feeds](/pkg/apis/feeds/v1alpha1) and [the e2e test](/test/e2e).**

Docs in this directory:

* [Motivation and goals](motivation.md)
* [Resource type overview](overview.md)
<!-- * [Knative Eventing API spec](spec.md) -->
<!-- * [Error conditions and reporting](errors.md) -->
<!-- * [Sample API usage](normative_examples.md) -->
32 changes: 32 additions & 0 deletions docs/spec/images/overview-reference.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// This is the overview graph for object refrences in the control plane.
//
// To reproduce the PNG, run the following:
// $ dot -Tpng overview-reference.dot -o overview-reference.png
//
digraph G {
ordering = out;
rankdir = LR;

node [shape=rectangle; width=1.25; height=.5; fixedsize=true;]

subgraph cluster_A {
Source -> EventType;
color=white;
{rank = same; Source; EventType}
}

subgraph cluster_B {
Channel
Subscription;
label = "Bus";
color=black;
}

EventType -> Feed [dir=back];
Feed -> Channel;

Subscription -> Service;
Channel -> Subscription [dir=back];

{rank = max; Service;}
}
Binary file added docs/spec/images/overview-reference.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions docs/spec/motivation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Motivation

Knative Eventing implements the common components for an event delivery
ecosystem. These common components enable producing and consuming events
adhering to the [CloudEvents
Specification](https://github.com/cloudevents/spec), in a decoupled way.

Kubernetes has no primitives related to event processing, yet this is an
essential component in serverless workloads. Eventing introduces high-level
primitives for event production and delivery with a focus on push over HTTP. If
a new event source or type is required of your application, the effort required
to plumb them into the existing eventing framework will be minimal and will
integrate with CloudEvents middleware and message consumers.

The Knative Eventing APIs is intended to operate independently, and interop
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: APIs is should be changed to either API is or APIs are.

Is "intended to operate independently" an accurate description of the relationship between serving and eventing? My understanding is that the API definition and control plane are intended to be independent of serving, but the data plane (bus, channel, and feed implementations) have no such intent.

well with the [Serving API](https://github.com/knative/serving) and [Build
API](https://github.com/knative/build).
78 changes: 78 additions & 0 deletions docs/spec/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Resource Groups

Knative Eventing API is grouped into _Channels_ and _Feeds_:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slight preference for "Delivery" over "Channels", but @scothis may have sharper opinions than I.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am just basing this on the k8s grouping currently being used in the CRDs


* _Channels_ define an abstraction between the eventing infrastructure and the
consumption and production of the events.

* _Feeds_ bridge the event source into the eventing framework.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably worth mentioning that Feeds perform out-of-cluster provisioning, while Channels are within-cluster management of event delivery buses or brokers.


* _Flows_ are the higher order abstractions for eventing that use _Channels_
and _Feeds_.

Typically, _Feeds_ perform out-of-cluster provisioning, while _Channels_ are
within-cluster management of event delivery.

# Resource Types

The primary resources in the Knative Eventing _Feeds_ API are EventSource, EventType and Bind:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bind -> Feed


* **EventSource**, an archetype of an event producer.

* **EventType**, the schema for an event.

* **Feed**, the association between the output of an event producer to the
input of an event consumer.


The primary resources in the Knative Eventing _Channels_ API are Channel, Subscription and Bus:

* **Channel**, a named endpoint which accepts and forwards events.

* **Bus**, an implementation of an event delivery mechanism.

* **Subscription**, an expressed interest in events to be delivered to a
service.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This definition of Subscription might cause confusion in combination with Bind.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is another reason I prefer "Feed" since that would then emphasize its role as the manifestation of events from a source, and if it simply has a target (k8s) Service, that could be a direct connection to a Knative workload via the Service created by its Route, or it could be the Service that corresponds to a Channel. Only when using a Channel would there be something to "subscribe" to.

The primary resources in the Knative Eventing _Flows_ API are Flow:

* **Flow**, the connection between an event producer to the event consumer.

![Object Model](images/overview-reference.png)

## EventSource

A software system which wishes to make changes in state discoverable via
eventing, without prior knowledge of systems which might consume state changes.

## EventType

TODO

## Feed

A configuration of event transmission from a single Source to a single Action.
A Feed may contain additional properties of the event transmission such as
filtering, timeouts, rate limits, and buffering.

## Channel

A named in-cluster Service on a Bus which accepts events delivered from a Feed.

## Bus

A system which routes events from Channels to subscribed Service endpoints. The
Broker MAY (RFC 2119) provide durable, at-least-once semantics and buffering of
events between the Source and the Action. Brokers also perform event fan-out
across multiple actions which are subscribed to the same channel.


## Subscription

A control plane construct which allows the Bus to route events received on a
Channel to the subscribed Service.

# Eventing

TODO an overview of how these objects are created and perhaps the persona
expected to make each.