We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
You can customize your kn CLI setup by creating a config.yaml configuration file. You can provide this configuration by using the --config flag, otherwise the configuration is picked up from a default location. The default configuration location conforms to the XDG Base Directory Specification, and is different for Unix systems and Windows systems.
-
-
If the XDG_CONFIG_HOME environment variable is set, the default configuration location that kn looks for is $XDG_CONFIG_HOME/kn.
-
If the XDG_CONFIG_HOME environment variable is not set, kn looks for the configuration in the home directory of the user at $HOME/.config/kn/config.yaml.
-
For Windows systems, the default kn configuration location is %APPDATA%\kn.
path-lookup specifies whether kn should look for plugins in the PATH environment variable. This is a boolean configuration option. The default value is false.
-
directory specifies the directory where kn will look for plugins. The default path depends on the operating system, as described above. This can be any directory that is visible to the user.
-
sink-mappings defines the Kubernetes Addressable resource that is used when you use the --sink flag with a kn CLI command.
-
-
prefix: The prefix you want to use to describe your sink. Service, svc, channel, and broker are predefined prefixes in kn.
-
-
-
-
group: The API group of the Kubernetes resource.
-
version: The version of the Kubernetes resource.
-
resource: The plural name of the Kubernetes resource type. For example, services or brokers.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
The following CLI tools are supported for use with Knative.
-
kubectl
-
You can use kubectl to apply the YAML files required to install Knative components, and also to create Knative resources, such as services and event sources using YAML.
kn provides a quick and easy interface for creating Knative resources such as services and event sources, without the need to create or modify YAML files directly. kn also simplifies completion of otherwise complex procedures such as autoscaling and traffic splitting.
-
NOTE:kn cannot be used to install Knative components such as Serving or Eventing.
After you have installed kubectl or kn, these tools will search for the kubeconfig file of your cluster in the default location of $HOME/.kube/config, and will use this file to connect to the cluster.
-
A kubeconfig file is usually automatically created when you create a Kubernetes cluster.
Starting minikube writes this file automatically, or provides an appropriate context in an existing configuration file.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/client/index.xml b/archived/v0.22-docs/client/index.xml
deleted file mode 100644
index 60f2fb544..000000000
--- a/archived/v0.22-docs/client/index.xml
+++ /dev/null
@@ -1,134 +0,0 @@
-
-
- Knative – CLI tools
- https://knative.dev/v0.22-docs/client/
- Recent content in CLI tools on Knative
- Hugo -- gohugo.io
-
-
-
-
-
-
-
-
-
-
- V0.22-Docs: Installing kn
- https://knative.dev/v0.22-docs/client/install-kn/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/client/install-kn/
-
-
-
- <p>This guide provides details about how you can install the Knative <code>kn</code> CLI.</p>
-<h2 id="install-kn-using-brew">Install kn using brew</h2>
-<p>For macOS, you can install <code>kn</code> by using <a href="https://github.com/knative/homebrew-client" target="_blank">Homebrew</a>.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">brew install knative/client/kn
-</code></pre></div><h2 id="install-kn-using-a-binary">Install kn using a binary</h2>
-<p>You can install <code>kn</code> by downloading the executable binary for your system and placing it in the system path.</p>
-<p>A link to the latest stable binary release is available on the <a href="https://github.com/knative/client/releases" target="_blank"><code>kn</code> release page</a>.</p>
-<h3 id="install-kn-using-the-nightly-built-binary">Install kn using the nightly-built binary</h3>
-<p>Nightly-built executable binaries are available for users who want to install the latest pre-release build of <code>kn</code>.</p>
-<p><strong>WARNING:</strong> Nightly-built executable binaries include features which may not be included in the latest Knative release and are not considered to be stable.</p>
-<p>Links to the latest nightly-built executable binaries are available here:</p>
-<ul>
-<li><a href="https://storage.googleapis.com/knative-nightly/client/latest/kn-darwin-amd64" target="_blank">macOS</a></li>
-<li><a href="https://storage.googleapis.com/knative-nightly/client/latest/kn-linux-amd64" target="_blank">Linux</a></li>
-<li><a href="https://storage.googleapis.com/knative-nightly/client/latest/kn-windows-amd64.exe" target="_blank">Windows</a></li>
-</ul>
-<h2 id="install-kn-using-go">Install kn using Go</h2>
-<ol>
-<li>
-<p>Check out the <code>kn</code> client repository:</p>
-<pre><code>git clone https://github.com/knative/client.git
-cd client/
-</code></pre></li>
-<li>
-<p>Build an executable binary:</p>
-<pre><code>hack/build.sh -f
-</code></pre></li>
-<li>
-<p>Move <code>kn</code> into your system path, and verify that <code>kn</code> commands are working properly. For example:</p>
-<pre><code>kn version
-</code></pre></li>
-</ol>
-<h2 id="running-kn-using-container-images">Running kn using container images</h2>
-<p><strong>WARNING:</strong> Nightly container images include features which may not be included in the latest Knative release and are not considered to be stable.</p>
-<p>Links to images are available here:</p>
-<ul>
-<li><a href="https://gcr.io/knative-releases/knative.dev/client/cmd/kn" target="_blank">Latest release</a></li>
-<li><a href="https://gcr.io/knative-nightly/knative.dev/client/cmd/kn" target="_blank">Nightly container image</a></li>
-</ul>
-<p>You can run <code>kn</code> from a container image. For example:</p>
-<pre><code>docker run --rm -v "$HOME/.kube/config:/root/.kube/config" gcr.io/knative-releases/knative.dev/client/cmd/kn:latest service list
-</code></pre><p><strong>NOTE:</strong> Running <code>kn</code> from a container image does not place the binary on a permanent path. This procedure must be repeated each time you want to use <code>kn</code>.</p>
-<h2 id="using-kn-with-tekton">Using kn with Tekton</h2>
-<p>See the <a href="http://hub.tekton.dev/tekton/task/kn" target="_blank">Tekton documentation</a>.</p>
-
-
-
-
-
- V0.22-Docs: Customizing kn
- https://knative.dev/v0.22-docs/client/configure-kn/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/client/configure-kn/
-
-
-
- <p>You can customize your <code>kn</code> CLI setup by creating a <code>config.yaml</code> configuration file. You can provide this configuration by using the <code>--config</code> flag, otherwise the configuration is picked up from a default location. The default configuration location conforms to the <a href="https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html">XDG Base Directory Specification</a>, and is different for Unix systems and Windows systems.</p>
-<ul>
-<li>If the <code>XDG_CONFIG_HOME</code> environment variable is set, the default configuration location that <code>kn</code> looks for is <code>$XDG_CONFIG_HOME/kn</code>.</li>
-<li>If the <code>XDG_CONFIG_HOME</code> environment variable is not set, <code>kn</code> looks for the configuration in the home directory of the user at <code>$HOME/.config/kn/config.yaml</code>.</li>
-<li>For Windows systems, the default <code>kn</code> configuration location is <code>%APPDATA%\kn</code>.</li>
-</ul>
-<h2 id="example-configuration-file">Example configuration file</h2>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">plugins</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">path-lookup</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">true</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">directory</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">~/.config/kn/plugins</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">eventing</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sink-mappings</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">prefix</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">svc</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">group</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">core</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">version</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">resource</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">services</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Where</p>
-<ul>
-<li><code>path-lookup</code> specifies whether <code>kn</code> should look for <a href="../kn-plugins">plugins</a> in the <code>PATH</code> environment variable. This is a boolean configuration option. The default value is <code>false</code>.</li>
-<li><code>directory</code> specifies the directory where <code>kn</code> will look for plugins. The default path depends on the operating system, as described above. This can be any directory that is visible to the user.</li>
-<li><code>sink-mappings</code> defines the Kubernetes Addressable resource that is used when you use the <code>--sink</code> flag with a <code>kn</code> CLI command.
-<ul>
-<li><code>prefix</code>: The prefix you want to use to describe your sink. Service, <code>svc</code>, <code>channel</code>, and <code>broker</code> are predefined prefixes in <code>kn</code>.</li>
-</ul>
- <!--can be a prefix be anything? Otherwise let's provide a full list of what's allowed, limitations, etc.-->
-<ul>
-<li><code>group</code>: The API group of the Kubernetes resource.</li>
-<li><code>version</code>: The version of the Kubernetes resource.</li>
-<li><code>resource</code>: The plural name of the Kubernetes resource type. For example, <code>services</code> or <code>brokers</code>.</li>
-</ul>
-</li>
-</ul>
-
-
-
-
-
- V0.22-Docs: kn plugins
- https://knative.dev/v0.22-docs/client/kn-plugins/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/client/kn-plugins/
-
-
-
- <p>The <code>kn</code> CLI supports the use of plugins. Plugins enable you to extend the functionality of your <code>kn</code> installation by adding custom commands and other shared commands that are not part of the core distribution of <code>kn</code>.</p>
-<!--TODO: Add details about installing and using different available plugins, list of available plugins-->
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/client/install-kn/index.html b/archived/v0.22-docs/client/install-kn/index.html
deleted file mode 100644
index a70a3fbe8..000000000
--- a/archived/v0.22-docs/client/install-kn/index.html
+++ /dev/null
@@ -1,2316 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-Installing kn | Knative
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Installing kn | Knative
-
-
-
-
-
-
-
-
-
Black lives matter.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
You can install kn by downloading the executable binary for your system and placing it in the system path.
-
A link to the latest stable binary release is available on the kn release page.
-
Install kn using the nightly-built binary
-
Nightly-built executable binaries are available for users who want to install the latest pre-release build of kn.
-
WARNING: Nightly-built executable binaries include features which may not be included in the latest Knative release and are not considered to be stable.
-
Links to the latest nightly-built executable binaries are available here:
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
The kn CLI supports the use of plugins. Plugins enable you to extend the functionality of your kn installation by adding custom commands and other shared commands that are not part of the core distribution of kn.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Depending on the request tracing tool that you have installed on your Knative
-Eventing cluster, see the corresponding section for details about how to
-visualize and trace your requests.
-
Before you begin
-
You must have a Knative cluster running with the Eventing component installed. Learn more
-
Configuring tracing
-
With the exception of importers, the Knative Eventing tracing is configured through the
-config-tracing ConfigMap in the knative-eventing namespace.
-
Most importers do not use the ConfigMap and instead, use a static 1% sampling rate.
-
You can use the config-tracing ConfigMap to configure the following Eventing components:
-
-
Brokers
-
Triggers
-
InMemoryChannel
-
ApiServerSource
-
PingSource
-
GitlabSource
-
KafkaSource
-
PrometheusSource
-
-
Example:
-
The following example config-tracing ConfigMap samples 10% of all CloudEvents:
You can configure your config-tracing with following options:
-
-
-
backend: Valid values are zipkin, stackdriver, or none. The default is none.
-
-
-
zipkin-endpoint: Specifies the URL to the zipkin collector where you want to send the traces.
-Must be set if backend is set to zipkin.
-
-
-
stackdriver-project-id: Specifies the GCP project ID into which the Stackdriver traces are written.
-You must specify the backend as stackdriver. If backendis unspecified, the GCP project ID is read
-from GCP metadata when running on GCP.
-
-
-
sample-rate: Specifies the sampling rate. Valid values are decimals from 0 to 1
-(interpreted as a float64), which indicate the probability that any given request is sampled.
-An example value is 0.5, which gives each request a 50% sampling probablity.
-
-
-
debug: Enables debugging. Valid values are true or false. Defaults to false when not specified.
-Set to true to enable debug mode, which forces the sample-rate to 1.0 and sends all spans to
-the server.
-
-
-
Viewing your config-tracing ConfigMap
-
To view your current configuration:
-
kubectl -n knative-eventing get configmap config-tracing -oyaml
-
Editing and deploying your config-tracing ConfigMap
-
To edit and then immediately deploy changes to your ConfigMap, run the following command:
To access the traces, you use either the Zipkin or Jaeger tool. Details about using these tools to access
-traces are provided in the Knative Serving observability section:
The following demonstrates how to trace requests in Knative Eventing with Zipkin, using the
-TestBrokerTracing
-End-to-End test.
-
For this example, assume the following details:
-
-
Everything happens in the includes-incoming-trace-id-2qszn namespace.
-
The Broker is named br.
-
There are two Triggers that are associated with the Broker:
-
-
transformer - Filters to only allow events whose type is transformer.
-Sends the event to the Kubernetes Service transformer, which will reply with an
-identical event, except the replied event’s type will be logger.
-
logger - Filters to only allow events whose type is logger. Sends the event to
-the Kubernetes Service logger.
-
-
-
An event is sent to the Broker with the type transformer, by the Pod named sender.
-
-
Given the above, the expected path and behavior of an event is as follows:
-
-
sender Pod sends the request to the Broker.
-
Go to the Broker’s ingress Pod.
-
Go to the imc-dispatcher Channel (imc stands for InMemoryChannel).
-
Go to both Triggers.
-
-
Go to the Broker’s filter Pod for the Trigger logger. The Trigger’s filter ignores this event.
-
Go to the Broker’s filter Pod for the Trigger transformer. The filter does pass, so it goes to the Kubernetes Service pointed at, also named transformer.
-
-
transformer Pod replies with the modified event.
-
Go to an InMemory dispatcher.
-
Go to the Broker’s ingress Pod.
-
Go to the InMemory dispatcher.
-
Go to both Triggers.
-
-
Go to the Broker’s filter Pod for the Trigger transformer. The Trigger’s filter ignores the event.
-
Go to the Broker’s filter Pod for the Trigger logger. The filter passes.
-
-
Go to the logger Pod. There is no reply.
-
-
-
-
-
-
-
-
-
-
This is a screenshot of the trace view in Zipkin. All the red letters have been added to the screenshot and correspond to the expectations earlier in this section:
-
-
This is the same screenshot without the annotations.
-
-
If you are interested, here is the raw JSON of the trace.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
In the Knative Eventing ecosystem, alternate Broker implementations are welcome as long as they
-respect the Broker Conformance Spec.
-
Below is a list of brokers provided by the community or vendors in addition to the default broker
-implementations provided by Knative Eventing.
-
GCP Broker
-
The GCP Broker is optimized for running in GCP. For more details, refer to the doc.
-
Apache Kafka Broker
-
For information about the Apache Kafka broker, see link.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
NOTE: This guide assumes Knative Eventing is installed in the knative-eventing namespace. If you have installed Knative Eventing in a different namespace, replace default with the name of that namespace.
-
Knative Eventing provides a config-br-defaults ConfigMap, which provides default configuration settings to enable the creation of Brokers and Channels.
-
If you are using the config-br-defaults ConfigMap default configuration, the example below will create a Broker called default in the default namespace, and uses MTChannelBasedBroker as the
-implementation.
The following example shows a Broker where the configuration is specified in a ConfigMap config-br-default-channel:
-
apiVersion:eventing.knative.dev/v1
-kind:Broker
-metadata:
-annotations:
-eventing.knative.dev/broker.class:MTChannelBasedBroker
-name:default
-spec:
-# Configuration specific to this broker.
-config:
-apiVersion:v1
-kind:ConfigMap
-name:config-br-default-channel
-namespace:knative-eventing
-
Format of the file
-
Let’s look at the ConfigMap that comes out of the box when you install a
-release (v0.16.0 in this example):
-
apiVersion:v1
-kind:ConfigMap
-metadata:
-name:config-br-defaults
-namespace:knative-eventing
-labels:
-eventing.knative.dev/release:devel
-data:
-# Configuration for defaulting channels that do not specify CRD implementations.
-default-br-config:|
- clusterDefault:
- brokerClass: MTChannelBasedBroker
- apiVersion: v1
- kind: ConfigMap
- name: config-br-default-channel
- namespace: knative-eventing
-
This means that any Broker created without a specific BrokerClass annotation
-will use MTChannelBasedBroker, and any Broker without a spec.config
-will have spec.config like so:
If you have installed a different Broker, or multiple, you can change the
-default Broker used at the cluster level and by namespace. If you for example
-have installed MT Channel Based Broker as well as YourBroker and would prefer
-that by default any Broker created uses YourBroker you could modify the
-ConfigMap to look like this:
-
apiVersion:v1
-kind:ConfigMap
-metadata:
-name:config-br-defaults
-namespace:knative-eventing
-labels:
-eventing.knative.dev/release:devel
-data:
-# Configuration for defaulting channels that do not specify CRD implementations.
-default-br-config:|
- clusterDefault:
- brokerClass: YourBroker
-
Now every Broker created in the cluster without the BrokerClass annotation will
-be using YourBroker as the Broker implementation. Note that you can always use
-a different implementation by explicitly specifying the BrokerClass annotation
-when you create a Broker.
-
Changing the default BrokerClass for namespaces
-
As mentioned, you can also control the defaulting behaviour for some set of
-namespaces. So, if for example, you wanted to use YourBroker for all the other
-Brokers created, but wanted to use MTChannelBasedBroker for the following
-namespaces: namespace1 and namespace2. You would modify the config map like
-this:
-
apiVersion:v1
-kind:ConfigMap
-metadata:
-name:config-br-defaults
-namespace:knative-eventing
-labels:
-eventing.knative.dev/release:devel
-data:
-# Configuration for defaulting channels that do not specify CRD implementations.
-default-br-config:|
- clusterDefault:
- brokerClass: YourBroker
- namespaceDefaults:
- namespace1:
- brokerClass: MTChannelBasedBroker
- namespace2:
- brokerClass: MTChannelBasedBroker
-
Changing the default configuration of the Broker
-
Changing the default configuration for the cluster
-
You can also control Broker configuration defaulting behaviour by specifying
-what gets defaulted into a broker.spec.config if left empty when being created.
-
If you have installed a different Channel implementation (for example Kafka),
-and by default would like to use that for any Broker created you could change
-the ConfigMap to look like this:
-
apiVersion:v1
-kind:ConfigMap
-metadata:
-name:config-br-defaults
-namespace:knative-eventing
-labels:
-eventing.knative.dev/release:devel
-data:
-# Configuration for defaulting channels that do not specify CRD implementations.
-default-br-config:|
- clusterDefault:
- brokerClass: MTChannelBasedBroker
- apiVersion: v1
- kind: ConfigMap
- name: config-kafka-channel
- namespace: knative-eventing
-
Now every Broker created in the cluster without spec.config will be configured
-to use config-kafka-channelConfigMap. Note that you can always still
-explicitly specify a different configuration for any given Broker by specifying
-it in the spec.config.
-
Changing the default configuration for namespaces
-
As mentioned, you can also control the defaulting behaviour for some set of
-namespaces. So, if for example, you wanted to use config-kafka-channel for all
-the other Brokers created, but wanted to use config-br-default-channel config
-the following namespaces: namespace3 and namespace4. You would modify the
-ConfigMap like this:
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Knative provides a multi-tenant, channel-based broker implementation that uses channels for event routing.
-
Before you can use the Knative Channel-based Broker, you must install a channel provider, such as InMemoryChannel, Kafka or Nats.
-
NOTE: InMemoryChannel channels are for development use only and must not be used in a production deployment.
-
For more information on which channels are available and how to install them,
-see the list of available channels.
-
How it works
-
-
When an Event is sent to the Broker, all request metadata other than the CloudEvent data and context attributes is stripped away.
-Unless the information existed as a CloudEvent attribute, no information is retained about how this Event entered the Broker.
-
Once an Event has entered the Broker, it can be forwarded to event Channels by using Triggers.
-This event delivery mechanism hides details of event routing from the event producer and event consumer.
-
Triggers register a subscriber’s interest in a particular class of events, so that the subscriber’s event sink will receive events that match the Trigger’s filter.
-
Default Broker configuration
-
Knative Eventing provides a config-br-defaults ConfigMap, which lives in the
-knative-eventing namespace, and provides default configuration settings to
-enable the creation of Brokers and Channels by using defaults.
-For more information, see the config-br-defaults ConfigMap documentation.
You can configure Knative Eventing so that when you create a broker, it uses a
-different type of broker than the default Knative channel-based broker. To
-configure a different broker type, or class, you must modify the
-eventing.knative.dev/broker.class annotation and spec.config for the Broker
-object. MTChannelBasedBroker is the broker class default.
-
Procedure
-
-
Modify the eventing.knative.dev/broker.class annotation. Replace
-MTChannelBasedBroker with the class type you want to use:
Create a Trigger that sends only events of a particular type to the subscriber
-created above (my-service). For this example, we use Ping Source, and it
-emits events types dev.knative.sources.ping.
Knative Eventing comes with a Ping Source which
-emits an event on a configured schedule. For this we’ll configure it to emit
-events once a minute, saying, yes, you guessed it Hello World!.
The following example is more complex, and demonstrates the use of deadLetterSink configuration to send failed events to Knative Service called dlq-service:
-
apiVersion:eventing.knative.dev/v1
-kind:Broker
-metadata:
-annotations:
-eventing.knative.dev/broker.class:MTChannelBasedBroker
-name:default
-spec:
-# Configuration specific to this broker.
-config:
-apiVersion:v1
-kind:ConfigMap
-name:config-br-default-channel
-namespace:knative-eventing
-# Where to deliver Events that failed to be processed.
-delivery:
-deadLetterSink:
-ref:
-apiVersion:serving.knative.dev/v1
-kind:Service
-name:dlq-service
-
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/broker/index.xml b/archived/v0.22-docs/eventing/broker/index.xml
deleted file mode 100644
index 500466368..000000000
--- a/archived/v0.22-docs/eventing/broker/index.xml
+++ /dev/null
@@ -1,502 +0,0 @@
-
-
- Knative – Broker
- https://knative.dev/v0.22-docs/eventing/broker/
- Recent content in Broker on Knative
- Hugo -- gohugo.io
-
-
-
-
-
-
-
-
-
-
- V0.22-Docs: Apache Kafka Broker
- https://knative.dev/v0.22-docs/eventing/broker/kafka-broker/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/broker/kafka-broker/
-
-
-
- <p>The Apache Kafka Broker is a native Broker implementation, that reduces
-network hops, supports any Kafka version, and has a better integration
-with Apache Kafka for the Knative Broker and Trigger model.</p>
-<p>Notable features are:</p>
-<ul>
-<li>Control plane High Availability</li>
-<li>Horizontally scalable data plane</li>
-<li><a href="#kafka-producer-and-consumer-configurations">Extensively configurable</a></li>
-<li>Ordered delivery of events based on <a href="https://github.com/cloudevents/spec/blob/master/extensions/partitioning.md">CloudEvents partitioning extension</a></li>
-<li>Support any Kafka version, see <a href="https://cwiki.apache.org/confluence/display/KAFKA/Compatibility+Matrix">compatibility matrix</a></li>
-</ul>
-<h2 id="prerequisites">Prerequisites</h2>
-<ol>
-<li><a href="../../../install/install-eventing-with-yaml">Installing Eventing using YAML files</a>.</li>
-<li>An Apache Kafka cluster (if you’re just getting started you can follow <a href="https://strimzi.io/quickstarts/">Strimzi Quickstart page</a>).</li>
-</ol>
-<h2 id="installation">Installation</h2>
-<ol>
-<li>
-<p>Install the Kafka controller by entering the following command:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply --filename https://github.com/knative-sandbox/eventing-kafka-broker/releases/download/v0.22.0/eventing-kafka-controller.yaml
-</code></pre></div></li>
-<li>
-<p>Install the Kafka Broker data plane by entering the following command:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply --filename https://github.com/knative-sandbox/eventing-kafka-broker/releases/download/v0.22.0/eventing-kafka-broker.yaml
-</code></pre></div></li>
-<li>
-<p>Verify that <code>kafka-controller</code>, <code>kafka-broker-receiver</code> and <code>kafka-broker-dispatcher</code> are running,
-by entering the following command:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl get deployments.apps -n knative-eventing
-</code></pre></div><p>Example output:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">NAME READY UP-TO-DATE AVAILABLE AGE
-eventing-controller 1/1 <span style="color:#0000cf;font-weight:bold">1</span> <span style="color:#0000cf;font-weight:bold">1</span> 10s
-eventing-webhook 1/1 <span style="color:#0000cf;font-weight:bold">1</span> <span style="color:#0000cf;font-weight:bold">1</span> 9s
-kafka-controller 1/1 <span style="color:#0000cf;font-weight:bold">1</span> <span style="color:#0000cf;font-weight:bold">1</span> 3s
-kafka-broker-dispatcher 1/1 <span style="color:#0000cf;font-weight:bold">1</span> <span style="color:#0000cf;font-weight:bold">1</span> 4s
-kafka-broker-receiver 1/1 <span style="color:#0000cf;font-weight:bold">1</span> <span style="color:#0000cf;font-weight:bold">1</span> 5s
-</code></pre></div></li>
-</ol>
-<h2 id="create-a-kafka-broker">Create a Kafka Broker</h2>
-<p>A Kafka Broker object looks like this:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Broker</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">annotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># case-sensitive</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">eventing.knative.dev/broker.class</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kafka</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># Configuration specific to this broker.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-broker-config</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># Optional dead letter sink, you can specify either:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># - deadLetterSink.ref, which is a reference to a Callable</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># - deadLetterSink.uri, which is an absolute URI to a Callable (It can potentially be out of the Kubernetes cluster)</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">delivery</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">deadLetterSink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">dlq-service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p><code>spec.config</code> should reference any <code>ConfigMap</code> that looks like the following:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-broker-config</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># Number of topic partitions</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">default.topic.partitions</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"10"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># Replication factor of topic messages.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">default.topic.replication.factor</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"1"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># A comma separated list of bootstrap servers. (It can be in or out the k8s cluster)</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">bootstrap.servers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"my-cluster-kafka-bootstrap.kafka:9092"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>The above <code>ConfigMap</code> is installed in the cluster. You can edit
-the configuration or create a new one with the same values
-depending on your needs.</p>
-<p><strong>NOTE:</strong> The <code>default.topic.replication.factor</code> value must be less than or equal to the number of Kafka broker instances in your cluster. For example, if you only have one Kafka broker, the <code>default.topic.replication.factor</code> value should not be more than <code>1</code>.</p>
-<h2 id="set-as-default-broker-implementation">Set as default broker implementation</h2>
-<p>To set the Kafka broker as the default implementation for all brokers in the Knative deployment,
-you can apply global settings by modifying the <code>config-br-defaults</code> ConfigMap in the <code>knative-eventing</code> namespace.</p>
-<p>This allows you to avoid configuring individual or per-namespace settings for each broker,
-such as <code>metadata.annotations.eventing.knative.dev/broker.class</code> or <code>spec.config</code>.</p>
-<p>The following YAML is an example of a <code>config-br-defaults</code> ConfigMap using Kafka broker as the default implementation.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">config-br-defaults</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">default-br-config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|</span><span style="color:#8f5902;font-style:italic">
-</span><span style="color:#8f5902;font-style:italic"> clusterDefault:
-</span><span style="color:#8f5902;font-style:italic"> brokerClass: Kafka
-</span><span style="color:#8f5902;font-style:italic"> apiVersion: v1
-</span><span style="color:#8f5902;font-style:italic"> kind: ConfigMap
-</span><span style="color:#8f5902;font-style:italic"> name: kafka-broker-config
-</span><span style="color:#8f5902;font-style:italic"> namespace: knative-eventing
-</span><span style="color:#8f5902;font-style:italic"> namespaceDefaults:
-</span><span style="color:#8f5902;font-style:italic"> namespace1:
-</span><span style="color:#8f5902;font-style:italic"> brokerClass: Kafka
-</span><span style="color:#8f5902;font-style:italic"> apiVersion: v1
-</span><span style="color:#8f5902;font-style:italic"> kind: ConfigMap
-</span><span style="color:#8f5902;font-style:italic"> name: kafka-broker-config
-</span><span style="color:#8f5902;font-style:italic"> namespace: knative-eventing
-</span><span style="color:#8f5902;font-style:italic"> namespace2:
-</span><span style="color:#8f5902;font-style:italic"> brokerClass: Kafka
-</span><span style="color:#8f5902;font-style:italic"> apiVersion: v1
-</span><span style="color:#8f5902;font-style:italic"> kind: ConfigMap
-</span><span style="color:#8f5902;font-style:italic"> name: kafka-broker-config
-</span><span style="color:#8f5902;font-style:italic"> namespace: knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><h2 id="security">Security</h2>
-<p>Apache Kafka supports different security features, Knative supports the followings:</p>
-<ul>
-<li><a href="#authentication-using-sasl">Authentication using <code>SASL</code> without encryption</a></li>
-<li><a href="#authentication-using-sasl-and-encryption-using-ssl">Authentication using <code>SASL</code> and encryption using <code>SSL</code></a></li>
-<li><a href="#authentication-and-encryption-using-ssl">Authentication and encryption using <code>SSL</code></a></li>
-<li><a href="#encryption-using-ssl-without-client-authentication">Encryption using <code>SSL</code> without client authentication</a></li>
-</ul>
-<p>To enable security features, in the <code>ConfigMap</code> referenced by <code>broker.spec.config</code>, we can reference a <code>Secret</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-broker-config</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># Other configurations</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># ...</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># Reference a Secret called my_secret</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">auth.secret.ref.name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my_secret</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>The <code>Secret</code> <code>my_secret</code> must exist in the same namespace of the <code>ConfigMap</code> referenced by <code>broker.spec.config</code>,
-in this case: <code>knative-eventing</code>.</p>
-<p><em>Note: Certificates and keys must be in <a href="https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail"><code>PEM</code> format</a>.</em></p>
-<h3 id="authentication-using-sasl">Authentication using SASL</h3>
-<p>Knative supports the following SASL mechanisms:</p>
-<ul>
-<li><code>PLAIN</code></li>
-<li><code>SCRAM-SHA-256</code></li>
-<li><code>SCRAM-SHA-512</code></li>
-</ul>
-<p>To use a specific SASL mechanism replace <code><sasl_mechanism></code> with the mechanism of your choice.</p>
-<h3 id="authentication-using-sasl-without-encryption">Authentication using SASL without encryption</h3>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl create secret --namespace <namespace> generic <my_secret> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">protocol</span><span style="color:#ce5c00;font-weight:bold">=</span>SASL_PLAINTEXT <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span>sasl.mechanism<span style="color:#ce5c00;font-weight:bold">=</span><sasl_mechanism> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">user</span><span style="color:#ce5c00;font-weight:bold">=</span><my_user> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">password</span><span style="color:#ce5c00;font-weight:bold">=</span><my_password>
-</code></pre></div><h3 id="authentication-using-sasl-and-encryption-using-ssl">Authentication using SASL and encryption using SSL</h3>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl create secret --namespace <namespace> generic <my_secret> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">protocol</span><span style="color:#ce5c00;font-weight:bold">=</span>SASL_SSL <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span>sasl.mechanism<span style="color:#ce5c00;font-weight:bold">=</span><sasl_mechanism> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-file<span style="color:#ce5c00;font-weight:bold">=</span>ca.crt<span style="color:#ce5c00;font-weight:bold">=</span>caroot.pem <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">user</span><span style="color:#ce5c00;font-weight:bold">=</span><my_user> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">password</span><span style="color:#ce5c00;font-weight:bold">=</span><my_password>
-</code></pre></div><h3 id="encryption-using-ssl-without-client-authentication">Encryption using SSL without client authentication</h3>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl create secret --namespace <namespace> generic <my_secret> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">protocol</span><span style="color:#ce5c00;font-weight:bold">=</span>SSL <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-file<span style="color:#ce5c00;font-weight:bold">=</span>ca.crt<span style="color:#ce5c00;font-weight:bold">=</span><my_caroot.pem_file_path> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span>user.skip<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#204a87">true</span>
-</code></pre></div><h3 id="authentication-and-encryption-using-ssl">Authentication and encryption using SSL</h3>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl create secret --namespace <namespace> generic <my_secret> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">protocol</span><span style="color:#ce5c00;font-weight:bold">=</span>SSL <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-file<span style="color:#ce5c00;font-weight:bold">=</span>ca.crt<span style="color:#ce5c00;font-weight:bold">=</span><my_caroot.pem_file_path> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-file<span style="color:#ce5c00;font-weight:bold">=</span>user.crt<span style="color:#ce5c00;font-weight:bold">=</span><my_cert.pem_file_path> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-file<span style="color:#ce5c00;font-weight:bold">=</span>user.key<span style="color:#ce5c00;font-weight:bold">=</span><my_key.pem_file_path>
-</code></pre></div><p><em>NOTE: <code>ca.crt</code> can be omitted to fallback to use system’s root CA set.</em></p>
-<h2 id="kafka-producer-and-consumer-configurations">Kafka Producer and Consumer configurations</h2>
-<p>Knative exposes all available Kafka producer and consumer configurations that can be modified to suit your workloads.</p>
-<p>You can change these configurations by modifying the <code>config-kafka-broker-data-plane</code> <code>ConfigMap</code> in
-the <code>knative-eventing</code> namespace.</p>
-<p>Documentation for the settings available in this <code>ConfigMap</code> is available on the
-<a href="https://kafka.apache.org/documentation/">Apache Kafka website</a>,
-in particular, <a href="https://kafka.apache.org/documentation/#producerconfigs">Producer configurations</a>
-and <a href="https://kafka.apache.org/documentation/#consumerconfigs">Consumer configurations</a>.</p>
-<h2 id="enable-debug-logging-for-data-plane-components">Enable debug logging for data plane components</h2>
-<p>The following YAML shows the default logging configuration for data plane components, that is created during the
-installation step:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-config-logging</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">config.xml</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|</span><span style="color:#8f5902;font-style:italic">
-</span><span style="color:#8f5902;font-style:italic"> <configuration>
-</span><span style="color:#8f5902;font-style:italic"> <appender name="jsonConsoleAppender" class="ch.qos.logback.core.ConsoleAppender">
-</span><span style="color:#8f5902;font-style:italic"> <encoder class="net.logstash.logback.encoder.LogstashEncoder"/>
-</span><span style="color:#8f5902;font-style:italic"> </appender>
-</span><span style="color:#8f5902;font-style:italic"> <root level="INFO">
-</span><span style="color:#8f5902;font-style:italic"> <appender-ref ref="jsonConsoleAppender"/>
-</span><span style="color:#8f5902;font-style:italic"> </root>
-</span><span style="color:#8f5902;font-style:italic"> </configuration></span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>To change the logging level to <code>DEBUG</code>, you must:</p>
-<ol>
-<li>
-<p>Apply the following <code>kafka-config-logging</code> <code>ConfigMap</code> or replace <code>level="INFO"</code> with <code>level="DEBUG"</code> to the
-<code>ConfigMap</code> <code>kafka-config-logging</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-config-logging</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">config.xml</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|</span><span style="color:#8f5902;font-style:italic">
-</span><span style="color:#8f5902;font-style:italic"> <configuration>
-</span><span style="color:#8f5902;font-style:italic"> <appender name="jsonConsoleAppender" class="ch.qos.logback.core.ConsoleAppender">
-</span><span style="color:#8f5902;font-style:italic"> <encoder class="net.logstash.logback.encoder.LogstashEncoder"/>
-</span><span style="color:#8f5902;font-style:italic"> </appender>
-</span><span style="color:#8f5902;font-style:italic"> <root level="DEBUG">
-</span><span style="color:#8f5902;font-style:italic"> <appender-ref ref="jsonConsoleAppender"/>
-</span><span style="color:#8f5902;font-style:italic"> </root>
-</span><span style="color:#8f5902;font-style:italic"> </configuration></span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>
-<p>Restart the <code>kafka-broker-receiver</code> and the <code>kafka-broker-dispatcher</code>, by entering the following commands:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl rollout restart deployment -n knative-eventing kafka-broker-receiver
-kubectl rollout restart deployment -n knative-eventing kafka-broker-dispatcher
-</code></pre></div></li>
-</ol>
-<h3 id="additional-information">Additional information</h3>
-<ul>
-<li>To report bugs or add feature requests, open an issue in the <a href="https://github.com/knative-sandbox/eventing-kafka-broker">eventing-kafka-broker repository</a>.</li>
-</ul>
-
-
-
-
-
- V0.22-Docs: Default Broker ConfigMap
- https://knative.dev/v0.22-docs/eventing/broker/config-br-defaults/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/broker/config-br-defaults/
-
-
-
- <p><strong>NOTE:</strong> This guide assumes Knative Eventing is installed in the <code>knative-eventing</code> namespace. If you have installed Knative Eventing in a different namespace, replace <code>default</code> with the name of that namespace.</p>
-<p>Knative Eventing provides a <code>config-br-defaults</code> ConfigMap, which provides default configuration settings to enable the creation of Brokers and Channels.</p>
-<p>If you are using the <code>config-br-defaults</code> ConfigMap default configuration, the example below will create a Broker called <code>default</code> in the default namespace, and uses <code>MTChannelBasedBroker</code> as the
-implementation.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create -f - <span style="color:#4e9a06"><<EOF
-</span><span style="color:#4e9a06">apiVersion: eventing.knative.dev/v1
-</span><span style="color:#4e9a06">kind: Broker
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: default
-</span><span style="color:#4e9a06"> namespace: default
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div><p>The following example shows a Broker where the configuration is specified in a ConfigMap <code>config-br-default-channel</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Broker</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">annotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">eventing.knative.dev/broker.class</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MTChannelBasedBroker</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># Configuration specific to this broker.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">config-br-default-channel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><h2 id="format-of-the-file">Format of the file</h2>
-<p>Let’s look at the <code>ConfigMap</code> that comes out of the box when you install a
-release (v0.16.0 in this example):</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">config-br-defaults</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">eventing.knative.dev/release</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">devel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># Configuration for defaulting channels that do not specify CRD implementations.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">default-br-config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|</span><span style="color:#8f5902;font-style:italic">
-</span><span style="color:#8f5902;font-style:italic"> clusterDefault:
-</span><span style="color:#8f5902;font-style:italic"> brokerClass: MTChannelBasedBroker
-</span><span style="color:#8f5902;font-style:italic"> apiVersion: v1
-</span><span style="color:#8f5902;font-style:italic"> kind: ConfigMap
-</span><span style="color:#8f5902;font-style:italic"> name: config-br-default-channel
-</span><span style="color:#8f5902;font-style:italic"> namespace: knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>This means that any Broker created without a specific BrokerClass annotation
-will use <code>MTChannelBasedBroker</code>, and any Broker without a <code>spec.config</code>
-will have <code>spec.config</code> like so:</p>
-<pre><code>spec:
- config:
- apiVersion: v1
- kind: ConfigMap
- name: config-br-default-channel
- namespace: knative-eventing
-</code></pre><h2 id="changing-the-default-brokerclass">Changing the default BrokerClass</h2>
-<h3 id="changing-the-default-brokerclass-for-the-cluster">Changing the default BrokerClass for the cluster</h3>
-<p>If you have installed a different Broker, or multiple, you can change the
-default Broker used at the cluster level and by namespace. If you for example
-have installed MT Channel Based Broker as well as <code>YourBroker</code> and would prefer
-that by default any Broker created uses <code>YourBroker</code> you could modify the
-<code>ConfigMap</code> to look like this:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">config-br-defaults</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">eventing.knative.dev/release</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">devel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># Configuration for defaulting channels that do not specify CRD implementations.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">default-br-config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|</span><span style="color:#8f5902;font-style:italic">
-</span><span style="color:#8f5902;font-style:italic"> clusterDefault:
-</span><span style="color:#8f5902;font-style:italic"> brokerClass: YourBroker</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Now every Broker created in the cluster without the BrokerClass annotation will
-be using <code>YourBroker</code> as the Broker implementation. Note that you can always use
-a different implementation by explicitly specifying the BrokerClass annotation
-when you create a Broker.</p>
-<h3 id="changing-the-default-brokerclass-for-namespaces">Changing the default BrokerClass for namespaces</h3>
-<p>As mentioned, you can also control the defaulting behaviour for some set of
-namespaces. So, if for example, you wanted to use <code>YourBroker</code> for all the other
-Brokers created, but wanted to use <code>MTChannelBasedBroker</code> for the following
-namespaces: <code>namespace1</code> and <code>namespace2</code>. You would modify the config map like
-this:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">config-br-defaults</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">eventing.knative.dev/release</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">devel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># Configuration for defaulting channels that do not specify CRD implementations.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">default-br-config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|</span><span style="color:#8f5902;font-style:italic">
-</span><span style="color:#8f5902;font-style:italic"> clusterDefault:
-</span><span style="color:#8f5902;font-style:italic"> brokerClass: YourBroker
-</span><span style="color:#8f5902;font-style:italic"> namespaceDefaults:
-</span><span style="color:#8f5902;font-style:italic"> namespace1:
-</span><span style="color:#8f5902;font-style:italic"> brokerClass: MTChannelBasedBroker
-</span><span style="color:#8f5902;font-style:italic"> namespace2:
-</span><span style="color:#8f5902;font-style:italic"> brokerClass: MTChannelBasedBroker</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><h2 id="changing-the-default-configuration-of-the-broker">Changing the default configuration of the Broker</h2>
-<h3 id="changing-the-default-configuration-for-the-cluster">Changing the default configuration for the cluster</h3>
-<p>You can also control Broker configuration defaulting behaviour by specifying
-what gets defaulted into a broker.spec.config if left empty when being created.</p>
-<p>If you have installed a different Channel implementation (for example Kafka),
-and by default would like to use that for any Broker created you could change
-the ConfigMap to look like this:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">config-br-defaults</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">eventing.knative.dev/release</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">devel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># Configuration for defaulting channels that do not specify CRD implementations.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">default-br-config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|</span><span style="color:#8f5902;font-style:italic">
-</span><span style="color:#8f5902;font-style:italic"> clusterDefault:
-</span><span style="color:#8f5902;font-style:italic"> brokerClass: MTChannelBasedBroker
-</span><span style="color:#8f5902;font-style:italic"> apiVersion: v1
-</span><span style="color:#8f5902;font-style:italic"> kind: ConfigMap
-</span><span style="color:#8f5902;font-style:italic"> name: config-kafka-channel
-</span><span style="color:#8f5902;font-style:italic"> namespace: knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Now every Broker created in the cluster without spec.config will be configured
-to use <code>config-kafka-channel</code> <code>ConfigMap</code>. Note that you can always still
-explicitly specify a different configuration for any given Broker by specifying
-it in the <code>spec.config</code>.</p>
-<h3 id="changing-the-default-configuration-for-namespaces">Changing the default configuration for namespaces</h3>
-<p>As mentioned, you can also control the defaulting behaviour for some set of
-namespaces. So, if for example, you wanted to use <code>config-kafka-channel</code> for all
-the other Brokers created, but wanted to use <code>config-br-default-channel</code> config
-the following namespaces: <code>namespace3</code> and <code>namespace4</code>. You would modify the
-<code>ConfigMap</code> like this:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">config-br-defaults</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">eventing.knative.dev/release</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">devel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># Configuration for defaulting channels that do not specify CRD implementations.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">default-br-config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|</span><span style="color:#8f5902;font-style:italic">
-</span><span style="color:#8f5902;font-style:italic"> clusterDefault:
-</span><span style="color:#8f5902;font-style:italic"> brokerClass: MTChannelBasedBroker
-</span><span style="color:#8f5902;font-style:italic"> apiVersion: v1
-</span><span style="color:#8f5902;font-style:italic"> kind: ConfigMap
-</span><span style="color:#8f5902;font-style:italic"> name: config-kafka-channel
-</span><span style="color:#8f5902;font-style:italic"> namespace: knative-eventing
-</span><span style="color:#8f5902;font-style:italic"> namespaceDefaults:
-</span><span style="color:#8f5902;font-style:italic"> namespace3:
-</span><span style="color:#8f5902;font-style:italic"> apiVersion: v1
-</span><span style="color:#8f5902;font-style:italic"> kind: ConfigMap
-</span><span style="color:#8f5902;font-style:italic"> name: config-br-default-channel
-</span><span style="color:#8f5902;font-style:italic"> namespace: knative-eventing
-</span><span style="color:#8f5902;font-style:italic"> namespace4:
-</span><span style="color:#8f5902;font-style:italic"> apiVersion: v1
-</span><span style="color:#8f5902;font-style:italic"> kind: ConfigMap
-</span><span style="color:#8f5902;font-style:italic"> name: config-br-default-channel
-</span><span style="color:#8f5902;font-style:italic"> namespace: knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Note that we do not override the brokerClass for these namespaces. The
-brokerClass and config are independently configurable.</p>
-
-
-
-
-
- V0.22-Docs: Kafka Channel ConfigMap
- https://knative.dev/v0.22-docs/eventing/broker/kafka-configmap/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/broker/kafka-configmap/
-
-
-
- <p><strong>NOTE:</strong> This guide assumes Knative Eventing is installed in the <code>knative-eventing</code>
-namespace. If you have installed Knative Eventing in a different namespace, replace
-<code>knative-eventing</code> with the name of that namespace.</p>
-<p>To use Kafka channels, you must create a YAML file that specifies how these
-channels will be created.</p>
-<p><strong>NOTE:</strong> You must install the Kafka Channel first.</p>
-<p>You can copy the following sample code into your <code>kafka-channel</code> ConfigMap:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-channel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">channelTemplateSpec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|</span><span style="color:#8f5902;font-style:italic">
-</span><span style="color:#8f5902;font-style:italic"> apiVersion: messaging.knative.dev/v1beta1
-</span><span style="color:#8f5902;font-style:italic"> kind: KafkaChannel
-</span><span style="color:#8f5902;font-style:italic"> spec:
-</span><span style="color:#8f5902;font-style:italic"> numPartitions: 3
-</span><span style="color:#8f5902;font-style:italic"> replicationFactor: 1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p><strong>NOTE:</strong> This example specifies two extra parameters that are specific to Kafka
-Channels; <code>numPartitions</code> and <code>replicationFactor</code>.</p>
-<p>To create a Broker that uses the KafkaChannel, specify the <code>kafka-channel</code> ConfigMap:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create -f - <span style="color:#4e9a06"><<EOF
-</span><span style="color:#4e9a06">apiVersion: eventing.knative.dev/v1
-</span><span style="color:#4e9a06">kind: Broker
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> annotations:
-</span><span style="color:#4e9a06"> eventing.knative.dev/broker.class: MTChannelBasedBroker
-</span><span style="color:#4e9a06"> name: kafka-backed-broker
-</span><span style="color:#4e9a06"> namespace: default
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> config:
-</span><span style="color:#4e9a06"> apiVersion: v1
-</span><span style="color:#4e9a06"> kind: ConfigMap
-</span><span style="color:#4e9a06"> name: kafka-channel
-</span><span style="color:#4e9a06"> namespace: knative-eventing
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div>
-
-
-
-
- V0.22-Docs: Alternate Brokers
- https://knative.dev/v0.22-docs/eventing/broker/alternate/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/broker/alternate/
-
-
-
- <p>In the Knative Eventing ecosystem, alternate Broker implementations are welcome as long as they
-respect the <a href="https://github.com/knative/eventing/blob/main/docs/spec/broker.md">Broker Conformance Spec</a>.</p>
-<p>Below is a list of brokers provided by the community or vendors in addition to the default broker
-implementations provided by Knative Eventing.</p>
-<h2 id="gcp-broker">GCP Broker</h2>
-<p>The GCP Broker is optimized for running in GCP. For more details, refer to the <a href="https://github.com/google/knative-gcp/blob/master/docs/install/install-gcp-broker.md">doc</a>.</p>
-<h2 id="apache-kafka-broker">Apache Kafka Broker</h2>
-<p>For information about the Apache Kafka broker, see <a href="../kafka-broker">link</a>.</p>
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/broker/kafka-broker/index.html b/archived/v0.22-docs/eventing/broker/kafka-broker/index.html
deleted file mode 100644
index 84a5d5fbe..000000000
--- a/archived/v0.22-docs/eventing/broker/kafka-broker/index.html
+++ /dev/null
@@ -1,2505 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-Apache Kafka Broker | Knative
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Apache Kafka Broker | Knative
-
-
-
-
-
-
-
-
-
Black lives matter.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
The Apache Kafka Broker is a native Broker implementation, that reduces
-network hops, supports any Kafka version, and has a better integration
-with Apache Kafka for the Knative Broker and Trigger model.
Verify that kafka-controller, kafka-broker-receiver and kafka-broker-dispatcher are running,
-by entering the following command:
-
kubectl get deployments.apps -n knative-eventing
-
Example output:
-
NAME READY UP-TO-DATE AVAILABLE AGE
-eventing-controller 1/1 11 10s
-eventing-webhook 1/1 11 9s
-kafka-controller 1/1 11 3s
-kafka-broker-dispatcher 1/1 11 4s
-kafka-broker-receiver 1/1 11 5s
-
-
-
Create a Kafka Broker
-
A Kafka Broker object looks like this:
-
apiVersion:eventing.knative.dev/v1
-kind:Broker
-metadata:
-annotations:
-# case-sensitive
-eventing.knative.dev/broker.class:Kafka
-name:default
-namespace:default
-spec:
-# Configuration specific to this broker.
-config:
-apiVersion:v1
-kind:ConfigMap
-name:kafka-broker-config
-namespace:knative-eventing
-# Optional dead letter sink, you can specify either:
-# - deadLetterSink.ref, which is a reference to a Callable
-# - deadLetterSink.uri, which is an absolute URI to a Callable (It can potentially be out of the Kubernetes cluster)
-delivery:
-deadLetterSink:
-ref:
-apiVersion:serving.knative.dev/v1
-kind:Service
-name:dlq-service
-
spec.config should reference any ConfigMap that looks like the following:
-
apiVersion:v1
-kind:ConfigMap
-metadata:
-name:kafka-broker-config
-namespace:knative-eventing
-data:
-# Number of topic partitions
-default.topic.partitions:"10"
-# Replication factor of topic messages.
-default.topic.replication.factor:"1"
-# A comma separated list of bootstrap servers. (It can be in or out the k8s cluster)
-bootstrap.servers:"my-cluster-kafka-bootstrap.kafka:9092"
-
The above ConfigMap is installed in the cluster. You can edit
-the configuration or create a new one with the same values
-depending on your needs.
-
NOTE: The default.topic.replication.factor value must be less than or equal to the number of Kafka broker instances in your cluster. For example, if you only have one Kafka broker, the default.topic.replication.factor value should not be more than 1.
-
Set as default broker implementation
-
To set the Kafka broker as the default implementation for all brokers in the Knative deployment,
-you can apply global settings by modifying the config-br-defaults ConfigMap in the knative-eventing namespace.
-
This allows you to avoid configuring individual or per-namespace settings for each broker,
-such as metadata.annotations.eventing.knative.dev/broker.class or spec.config.
-
The following YAML is an example of a config-br-defaults ConfigMap using Kafka broker as the default implementation.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
NOTE: This guide assumes Knative Eventing is installed in the knative-eventing
-namespace. If you have installed Knative Eventing in a different namespace, replace
-knative-eventing with the name of that namespace.
-
To use Kafka channels, you must create a YAML file that specifies how these
-channels will be created.
-
NOTE: You must install the Kafka Channel first.
-
You can copy the following sample code into your kafka-channel ConfigMap:
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Knative provides the InMemoryChannel channel implementation by default. This default implementation is useful for developers who do not want to configure a specific implementation type, such as Apache Kafka or NATSS channels.
-
NOTE: InMemoryChannel channels should not be used in production environments.
-
The default channel implementation is specified in the default-ch-webhook ConfigMap in the knative-eventing namespace.
-For more information about modifying ConfigMaps, see Configuring the Eventing Operator custom resource.
-
In the following example, the cluster default channel implementation is InMemoryChannel, while the namespace default channel implementation for the example-namespace is KafkaChannel.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Channels are backed by Apache Kafka topics. The original Knative KafkaChannel implementation which utilizes a single combined Kafka Producer / Consumer deployment.
Channels are backed by Apache Kafka topics. An alternate KafkaChannel implementation, contributed by SAP’s Kyma project, which provides a more granular deployment of Producers / Consumers.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/channels/channels.yaml b/archived/v0.22-docs/eventing/channels/channels.yaml
deleted file mode 100644
index a65814905..000000000
--- a/archived/v0.22-docs/eventing/channels/channels.yaml
+++ /dev/null
@@ -1,32 +0,0 @@
-# List of available Channel implementation for persistence of the events associated with a given channel
-channels:
- - name: InMemoryChannel
- url: https://github.com/knative/eventing/tree/{{< branch >}}/config/channels/in-memory-channel/README.md
- status: Proof of Concept
- support: None
- description: >
- In-memory channels are a best effort Channel. They should NOT be used in Production. They are useful for development.
- - name: KafkaChannel
- url: https://github.com/knative-sandbox/eventing-kafka/tree/{{< branch >}}/pkg/channel/consolidated/README.md
- status: Proof of Concept
- support: None
- description: >
- Channels are backed by [Apache Kafka](http://kafka.apache.org/) topics.
- - name: NatssChannel
- url: https://github.com/knative-sandbox/eventing-natss/tree/{{< branch >}}/config/README.md
- status: Proof of Concept
- support: None
- description: >
- Channels are backed by [NATS Streaming](https://github.com/nats-io/nats-streaming-server#configuring).
- - name: GCP PubSub
- url: https://github.com/google/knative-gcp
- status: Proof of Concept
- support: None
- description: >
- Channels are backed by [GCP PubSub](https://cloud.google.com/pubsub/).
- - name: Knative sandbox channel that uses Confluent Go Client, and the librdkafka C library
- url: https://github.com/knative-sandbox/eventing-kafka
- status: Proof of Concept
- support: None
- description: >
- Kafka Channel implementation, contributed by SAP's Kyma project, is a Knative Eventing implementation of a Kafka backed channel which provides advanced functionality and production grade qualities as an alternative to what the eventing-contrib/kafka implementation offers.
diff --git a/archived/v0.22-docs/eventing/channels/create-default-channel/index.html b/archived/v0.22-docs/eventing/channels/create-default-channel/index.html
deleted file mode 100644
index 20542eb80..000000000
--- a/archived/v0.22-docs/eventing/channels/create-default-channel/index.html
+++ /dev/null
@@ -1,2300 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-Creating a channel using cluster or namespace defaults | Knative
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Creating a channel using cluster or namespace defaults | Knative
-
-
-
-
-
-
-
-
-
Black lives matter.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Since this object is created in the default namespace, according to the default ConfigMap example in the previous section, it will be an InMemoryChannel channel implementation.
-
-
-
-
-
-
After the Channel object is created, a mutating admission webhook sets the
-spec.channelTemplate based on the default channel implementation:
NOTE: The spec.channelTemplate property cannot be changed after creation, since it is set by the default channel mechanism, not the user.
-
-
-
The channel controller creates a backing channel instance
-based on the spec.channelTemplate.
-
When this mechanism is used, two objects are created, a generic Channel object, and an InMemoryChannel object. The generic object acts as a proxy for the InMemoryChannel object, by copying its subscriptions to and setting its status to that of the InMemoryChannel object.
-
-
-
NOTE: Defaults only apply on object creation. Defaults are applied by the webhook only on Channel or Sequence creation. If the default settings change, the new defaults will only apply to newly-created channels, brokers, or sequences. Existing ones will not change.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/channels/generator/ReadmeTemplate.gomd b/archived/v0.22-docs/eventing/channels/generator/ReadmeTemplate.gomd
deleted file mode 100644
index e63e0289f..000000000
--- a/archived/v0.22-docs/eventing/channels/generator/ReadmeTemplate.gomd
+++ /dev/null
@@ -1,37 +0,0 @@
----
-title: "Available Channels"
-#linkTitle: "Channels"
-weight: 40
-type: "docs"
----
-
-{{ "" }}
-
-{{- /* This will be interpreted given a yamlChannels object. */ -}}
-
-{{- /* Ignore this next paragraph, it is only intended in the generated markdown, not here. */ -}}
-
-
-This is a non-exhaustive list of the available Channels for Knative Eventing.
-
-Notes:
-
-* Inclusion in this list is not an endorsement, nor does it imply any level of
- support.
-
-Name | Status | Support | Description
---- | --- | --- | ---
-{{ range .Channels -}}
-[{{ .Name }}]({{ .Url }}) | {{ .Status }} | {{ .Support }} | {{ .Description }}
-{{- end }}
-
diff --git a/archived/v0.22-docs/eventing/channels/generator/main.go b/archived/v0.22-docs/eventing/channels/generator/main.go
deleted file mode 100644
index a0eaab36e..000000000
--- a/archived/v0.22-docs/eventing/channels/generator/main.go
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
-Copyright 2019 The Knative Authors
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package main
-
-import (
- "flag"
- "io/ioutil"
- "log"
- "os"
- "sort"
- "text/template"
-
- yaml "gopkg.in/yaml.v2"
-)
-
-var (
- yamlFile = flag.String("yaml", "eventing/channels/channels.yaml", "The YAML file to parse to generate the mark down.")
- templateFile = flag.String("template", "eventing/channels/generator/ReadmeTemplate.gomd", "The template file to fill in.")
- mdFile = flag.String("md", "eventing/channels/channels-crds.md", "The mark down file to write to. Any existing file will be overwritten.")
-)
-
-func main() {
- flag.Parse()
-
- yamlChannels := parseYaml()
- tmpl := createTemplate()
- writeMarkdown(yamlChannels, tmpl)
-}
-
-func parseYaml() *yamlChannels {
- fileBytes, err := ioutil.ReadFile(*yamlFile)
- if err != nil {
- log.Fatalf("Unable to read the YAML file '%s': %v", *yamlFile, err)
- }
-
- channels := &yamlChannels{}
- err = yaml.UnmarshalStrict(fileBytes, channels)
- if err != nil {
- log.Fatalf("Unable to unmarshal the YAML file '%s': %v", *yamlFile, err)
- }
-
- // Sort the three lists.
- sortAlphabetically(channels.Channels)
-
- return channels
-}
-
-func sortAlphabetically(slice []channel) {
- sortByName := func(i, j int) bool {
- return slice[i].Name < slice[j].Name
- }
- sort.SliceStable(slice, sortByName)
-}
-
-type yamlChannels struct {
- Channels []channel `yaml:"channels"`
-}
-
-type channel struct {
- Name string `yaml:"name"`
- Url string `yaml:"url"`
- Status string `yaml:"status"` // TODO Make this an enum.
- Support string `yaml:"support"`
- Description string `yaml:"description"`
-}
-
-func createTemplate() *template.Template {
- fileBytes, err := ioutil.ReadFile(*templateFile)
- if err != nil {
- log.Fatalf("Unable to read the template file '%s': %v", *templateFile, err)
- }
- fileString := string(fileBytes)
- tmpl, err := template.New("markdown template").Parse(fileString)
- if err != nil {
- log.Fatalf("Unable to parse the template file '%s': %v", *templateFile, err)
- }
- return tmpl
-}
-
-func writeMarkdown(yamlChannels *yamlChannels, tmpl *template.Template) {
- md, err := os.Create(*mdFile)
- if err != nil {
- log.Fatalf("Unable to create the markdown file '%s': %v", *mdFile, err)
- }
- defer md.Close()
-
- err = tmpl.Execute(md, yamlChannels)
- if err != nil {
- log.Fatalf("Unable to execute the template: %v", err)
- }
-}
diff --git a/archived/v0.22-docs/eventing/channels/images/channel-workflow.png b/archived/v0.22-docs/eventing/channels/images/channel-workflow.png
deleted file mode 100644
index 38d4c3aac..000000000
Binary files a/archived/v0.22-docs/eventing/channels/images/channel-workflow.png and /dev/null differ
diff --git a/archived/v0.22-docs/eventing/channels/index.html b/archived/v0.22-docs/eventing/channels/index.html
deleted file mode 100644
index ef41e8ad8..000000000
--- a/archived/v0.22-docs/eventing/channels/index.html
+++ /dev/null
@@ -1,2194 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Channels | Knative
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Channels | Knative
-
-
-
-
-
-
-
-
-
Black lives matter.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Channels are Kubernetes custom resources that define a single event forwarding and persistence layer.
-
A channel provides an event delivery mechanism that can fan-out received events, through subscriptions, to multiple destinations, or sinks. Examples of sinks include brokers and Knative services.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/channels/index.xml b/archived/v0.22-docs/eventing/channels/index.xml
deleted file mode 100644
index 5628f396f..000000000
--- a/archived/v0.22-docs/eventing/channels/index.xml
+++ /dev/null
@@ -1,372 +0,0 @@
-
-
- Knative – Channels
- https://knative.dev/v0.22-docs/eventing/channels/
- Recent content in Channels on Knative
- Hugo -- gohugo.io
-
-
-
-
-
-
-
-
-
-
- V0.22-Docs: Channel types and defaults
- https://knative.dev/v0.22-docs/eventing/channels/channel-types-defaults/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/channels/channel-types-defaults/
-
-
-
- <p>Knative provides the InMemoryChannel channel implementation by default. This default implementation is useful for developers who do not want to configure a specific implementation type, such as Apache Kafka or NATSS channels.</p>
-<p><strong>NOTE:</strong> InMemoryChannel channels should not be used in production environments.</p>
-<p>The default channel implementation is specified in the <code>default-ch-webhook</code> ConfigMap in the <code>knative-eventing</code> namespace.
-For more information about modifying ConfigMaps, see <a href="../docs/install/configuring-eventing-cr/">Configuring the Eventing Operator custom resource</a>.</p>
-<p>In the following example, the cluster default channel implementation is InMemoryChannel, while the namespace default channel implementation for the <code>example-namespace</code> is KafkaChannel.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default-ch-webhook</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">default-ch-config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|</span><span style="color:#8f5902;font-style:italic">
-</span><span style="color:#8f5902;font-style:italic"> clusterDefault:
-</span><span style="color:#8f5902;font-style:italic"> apiVersion: messaging.knative.dev/v1
-</span><span style="color:#8f5902;font-style:italic"> kind: InMemoryChannel
-</span><span style="color:#8f5902;font-style:italic"> namespaceDefaults:
-</span><span style="color:#8f5902;font-style:italic"> example-namespace:
-</span><span style="color:#8f5902;font-style:italic"> apiVersion: messaging.knative.dev/v1beta1
-</span><span style="color:#8f5902;font-style:italic"> kind: KafkaChannel
-</span><span style="color:#8f5902;font-style:italic"> spec:
-</span><span style="color:#8f5902;font-style:italic"> numPartitions: 2
-</span><span style="color:#8f5902;font-style:italic"> replicationFactor: 1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Default channels can be configured for the cluster, a namespace on the cluster, or both.</p>
-<p><strong>NOTE:</strong> If a default channel implementation is configured for a namespace, this will overwrite the configuration for the cluster.</p>
-
-
-
-
-
- V0.22-Docs: Creating a channel using cluster or namespace defaults
- https://knative.dev/v0.22-docs/eventing/channels/create-default-channel/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/channels/create-default-channel/
-
-
-
- <p>Developers can create channels of any supported implementation type by creating an instance of a Channel object.</p>
-<ol>
-<li>
-<p>Create a Channel object:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">messaging.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Channel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-channel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Since this object is created in the <code>default</code> namespace, according to the default ConfigMap example in the previous section, it will be an InMemoryChannel channel implementation.</p>
-</li>
-</ol>
-<!--TODO: Add tabs for kn etc-->
-<ol start="2">
-<li>
-<p>After the Channel object is created, a mutating admission webhook sets the
-<code>spec.channelTemplate</code> based on the default channel implementation:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">messaging.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Channel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-channel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">channelTemplate</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">messaging.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">InMemoryChannel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p><strong>NOTE:</strong> The <code>spec.channelTemplate</code> property cannot be changed after creation, since it is set by the default channel mechanism, not the user.</p>
-</li>
-<li>
-<p>The channel controller creates a backing channel instance
-based on the <code>spec.channelTemplate</code>.</p>
-<p>When this mechanism is used, two objects are created, a generic Channel object, and an InMemoryChannel object. The generic object acts as a proxy for the InMemoryChannel object, by copying its subscriptions to and setting its status to that of the InMemoryChannel object.</p>
-</li>
-</ol>
-<p><strong>NOTE:</strong> Defaults only apply on object creation. Defaults are applied by the webhook only on Channel or Sequence creation. If the default settings change, the new defaults will only apply to newly-created channels, brokers, or sequences. Existing ones will not change.</p>
-
-
-
-
-
- V0.22-Docs: Available Channels
- https://knative.dev/v0.22-docs/eventing/channels/channels-crds/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/channels/channels-crds/
-
-
-
- <!--
-This is a generated file and should not be changed manually. All changes should follow the
-procedure:
-
-1. Update the information in [`channels.yaml`](channels.yaml).
-
-2. Run the generator tool:
- ```shell
- go run eventing/channels/generator/main.go
- ```
--->
-<p>This is a non-exhaustive list of the available Channels for Knative Eventing.</p>
-<p>Notes:</p>
-<ul>
-<li>Inclusion in this list is not an endorsement, nor does it imply any level of
-support.</li>
-</ul>
-<table>
-<thead>
-<tr>
-<th>Name</th>
-<th>Status</th>
-<th>Support</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td><a href="https://github.com/google/knative-gcp">GCP PubSub</a></td>
-<td>Proof of Concept</td>
-<td>None</td>
-<td>Channels are backed by <a href="https://cloud.google.com/pubsub/">GCP PubSub</a>.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/knative/eventing/tree/release-0.22/config/channels/in-memory-channel/README.md">InMemoryChannel</a></td>
-<td>Proof of Concept</td>
-<td>None</td>
-<td>In-memory channels are a best effort Channel. They should NOT be used in Production. They are useful for development.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/knative-sandbox/eventing-kafka/tree/release-0.22/pkg/channel/consolidated/README.md">KafkaChannel - Consolidated</a></td>
-<td>Proof of Concept</td>
-<td>None</td>
-<td>Channels are backed by <a href="http://kafka.apache.org/">Apache Kafka</a> topics. The original Knative KafkaChannel implementation which utilizes a single combined Kafka Producer / Consumer deployment.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/knative-sandbox/eventing-kafka/tree/release-0.22/pkg/channel/distributed/README.md">KafkaChannel - Distributed</a></td>
-<td>Proof of Concept</td>
-<td>None</td>
-<td>Channels are backed by <a href="http://kafka.apache.org/">Apache Kafka</a> topics. An alternate KafkaChannel implementation, contributed by SAP’s <a href="https://kyma-project.io/">Kyma</a> project, which provides a more granular deployment of Producers / Consumers.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/knative-sandbox/eventing-natss/tree/release-0.22/config/README.md">NatssChannel</a></td>
-<td>Proof of Concept</td>
-<td>None</td>
-<td>Channels are backed by <a href="https://github.com/nats-io/nats-streaming-server#configuring">NATS Streaming</a>.</td>
-</tr>
-</tbody>
-</table>
-
-
-
-
-
- V0.22-Docs: Subscriptions
- https://knative.dev/v0.22-docs/eventing/channels/subscriptions/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/channels/subscriptions/
-
-
-
- <p>After you have created a channel and a sink, you can create a subscription to enable event delivery.</p>
-<h2 id="creating-a-subscription">Creating a subscription</h2>
-
-
-
-
-
-<ul class="nav nav-tabs" id="creating-a-subscription" role="tablist">
-
-
-
-
-
-
- <li class="nav-item active">
- <a class="nav-link active" id="creating-a-subscription-0-tab" data-toggle="tab" href="#creating-a-subscription-0" role="tab" aria-controls="creating-a-subscription-0" aria-selected="true">kn</a>
- </li>
-
-
-
-
- <li class="nav-item ">
- <a class="nav-link " id="creating-a-subscription-1-tab" data-toggle="tab" href="#creating-a-subscription-1" role="tab" aria-controls="creating-a-subscription-1" aria-selected="true">YAML</a>
- </li>
-
-</ul>
-
-<div class="tab-content" >
-
-
-
-
-
-
- <div class="tab-pane fade show active" id="creating-a-subscription-0" role="tabpanel" aria-labelledby="creating-a-subscription-0-tab">
-
- <p>Create a subscription between a channel and a sink:</p>
-<pre><code>kn subscription create <subscription_name> \
- --channel <Group:Version:Kind>:<channel_name> \
- --sink <sink_prefix>:<sink_name> \
- --sink-reply <sink_prefix>:<sink_name> \
- --sink-dead-letter <sink_prefix>:<sink_name>
-</code></pre><ul>
-<li>
-<p><code>--channel</code> specifies the source for cloud events that should be processed. You must provide the channel name. If you are not using the default channel that is backed by the Channel resource, you must prefix the channel name with the <code><Group:Version:Kind></code> for the specified channel type. For example, this will be <code>messaging.knative.dev:v1beta1:KafkaChannel</code> for a Kafka backed channel.</p>
-</li>
-<li>
-<p><code>--sink</code> specifies the target destination to which the event should be delivered. By default, the <code><sink_name></code> is interpreted as a Knative service of this name, in the same namespace as the subscription. You can specify the type of the sink by using one of the following prefixes:</p>
-<ul>
-<li><code>ksvc</code>: A Knative service.</li>
-<li><code>svc</code>: A Kubernetes Service.</li>
-<li><code>channel</code>: A channel that should be used as destination. Only default channel types can be referenced here.</li>
-<li><code>broker</code>: An Eventing broker.
-<br>
- </li>
-</ul>
-</li>
-<li>
-<p><code>--sink-reply</code> and <code>--sink-dead-letter</code> are optional arguments. They can be used to specify where the sink reply will be sent to, and where to send the cloud event in case of a failure, respectively. Both use the same naming conventions for specifying the sink as the <code>--sink</code> flag.</p>
-</li>
-</ul>
-<p>Example command:</p>
-<pre><code>kn subscription create mysubscription --channel mychannel --sink ksvc:myservice
-</code></pre><p>This example command creates a channel named <code>mysubscription</code>, that routes events from a channel named <code>mychannel</code> to a Knative service named <code>myservice</code>.</p>
-<p><strong>NOTE:</strong> The sink prefix is optional. It is also possible to specify the service for <code>--sink</code> as just <code>--sink <service_name></code> and omit the <code>ksvc</code> prefix.</p>
-
-
- </div>
-
-
-
-
- <div class="tab-pane fade " id="creating-a-subscription-1" role="tabpanel" aria-labelledby="creating-a-subscription-1-tab">
-
- <ol>
-<li>
-<p>Create a Subscription object in a YAML file:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">messaging.knative.dev/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Subscription</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000"><subscription_name></span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># Name of the subscription.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">channel</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">messaging.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Channel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000"><channel_name></span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># Configuration settings for the channel that the subscription connects to.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">delivery</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">deadLetterSink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000"><service_name></span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># Configuration settings for event delivery.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># This tells the subscription what happens to events that cannot be delivered to the subscriber.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># When this is configured, events that failed to be consumed are sent to the deadLetterSink.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># The event is dropped, no re-delivery of the event is attempted, and an error is logged in the system.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># The deadLetterSink value must be a Destination.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">subscriber</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000"><service_name></span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># Configuration settings for the subscriber. This is the event sink that events are delivered to from the channel.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>
-<p>Apply the YAML file:</p>
-<pre><code>kubectl apply -f <filename>
-</code></pre></li>
-</ol>
-
-
- </div>
-
-</div>
-
-<h2 id="listing-subscriptions">Listing subscriptions</h2>
-<p>You can list all existing subscriptions by using the <code>kn</code> CLI tool.</p>
-<ul>
-<li>
-<p>List all subscriptions:</p>
-<pre><code>kn subscription list
-</code></pre></li>
-<li>
-<p>List subscriptions in YAML format:</p>
-<pre><code>kn subscription list -o yaml
-</code></pre></li>
-</ul>
-<h2 id="describing-a-subscription">Describing a subscription</h2>
-<p>You can print details about a subscription by using the <code>kn</code> CLI tool:</p>
-<pre><code>kn subscription describe <subscription_name>
-</code></pre><!--TODO: Add an example command and output-->
-<!--TODO: Add details for kn subscription update - existing generated docs weren't clear enough, need better explained examples-->
-<h2 id="deleting-subscriptions">Deleting subscriptions</h2>
-<p>You can delete a subscription by using the <code>kn</code> or <code>kubectl</code> CLI tools.</p>
-
-
-
-
-
-<ul class="nav nav-tabs" id="deleting-a-subscription" role="tablist">
-
-
-
-
-
-
- <li class="nav-item active">
- <a class="nav-link active" id="deleting-a-subscription-0-tab" data-toggle="tab" href="#deleting-a-subscription-0" role="tab" aria-controls="deleting-a-subscription-0" aria-selected="true">kn</a>
- </li>
-
-
-
-
- <li class="nav-item ">
- <a class="nav-link " id="deleting-a-subscription-1-tab" data-toggle="tab" href="#deleting-a-subscription-1" role="tab" aria-controls="deleting-a-subscription-1" aria-selected="true">kubectl</a>
- </li>
-
-</ul>
-
-<div class="tab-content" >
-
-
-
-
-
-
- <div class="tab-pane fade show active" id="deleting-a-subscription-0" role="tabpanel" aria-labelledby="deleting-a-subscription-0-tab">
-
- <pre><code>kn subscription delete <subscription_name>
-</code></pre>
-
- </div>
-
-
-
-
- <div class="tab-pane fade " id="deleting-a-subscription-1" role="tabpanel" aria-labelledby="deleting-a-subscription-1-tab">
-
- <pre><code>kubectl subscription delete <subscription_name>
-</code></pre>
-
- </div>
-
-</div>
-
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/channels/subscriptions/index.html b/archived/v0.22-docs/eventing/channels/subscriptions/index.html
deleted file mode 100644
index 774a8931d..000000000
--- a/archived/v0.22-docs/eventing/channels/subscriptions/index.html
+++ /dev/null
@@ -1,2460 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-Subscriptions | Knative
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Subscriptions | Knative
-
-
-
-
-
-
-
-
-
Black lives matter.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
--channel specifies the source for cloud events that should be processed. You must provide the channel name. If you are not using the default channel that is backed by the Channel resource, you must prefix the channel name with the <Group:Version:Kind> for the specified channel type. For example, this will be messaging.knative.dev:v1beta1:KafkaChannel for a Kafka backed channel.
-
-
-
--sink specifies the target destination to which the event should be delivered. By default, the <sink_name> is interpreted as a Knative service of this name, in the same namespace as the subscription. You can specify the type of the sink by using one of the following prefixes:
-
-
ksvc: A Knative service.
-
svc: A Kubernetes Service.
-
channel: A channel that should be used as destination. Only default channel types can be referenced here.
-
broker: An Eventing broker.
-
-
-
-
-
-
--sink-reply and --sink-dead-letter are optional arguments. They can be used to specify where the sink reply will be sent to, and where to send the cloud event in case of a failure, respectively. Both use the same naming conventions for specifying the sink as the --sink flag.
This example command creates a channel named mysubscription, that routes events from a channel named mychannel to a Knative service named myservice.
-
NOTE: The sink prefix is optional. It is also possible to specify the service for --sink as just --sink <service_name> and omit the ksvc prefix.
-
-
-
-
-
-
-
-
-
-
-
-
Create a Subscription object in a YAML file:
-
apiVersion:messaging.knative.dev/v1beta1
-kind:Subscription
-metadata:
-name:<subscription_name># Name of the subscription.
-namespace:default
-spec:
-channel:
-apiVersion:messaging.knative.dev/v1
-kind:Channel
-name:<channel_name># Configuration settings for the channel that the subscription connects to.
-delivery:
-deadLetterSink:
-ref:
-apiVersion:serving.knative.dev/v1
-kind:Service
-name:<service_name>
-# Configuration settings for event delivery.
-# This tells the subscription what happens to events that cannot be delivered to the subscriber.
-# When this is configured, events that failed to be consumed are sent to the deadLetterSink.
-# The event is dropped, no re-delivery of the event is attempted, and an error is logged in the system.
-# The deadLetterSink value must be a Destination.
-subscriber:
-ref:
-apiVersion:serving.knative.dev/v1
-kind:Service
-name:<service_name># Configuration settings for the subscriber. This is the event sink that events are delivered to from the channel.
-
-
-
Apply the YAML file:
-
kubectl apply -f <filename>
-
-
-
-
-
-
-
-
-
Listing subscriptions
-
You can list all existing subscriptions by using the kn CLI tool.
-
-
-
List all subscriptions:
-
kn subscription list
-
-
-
List subscriptions in YAML format:
-
kn subscription list -o yaml
-
-
-
Describing a subscription
-
You can print details about a subscription by using the kn CLI tool:
-
kn subscription describe <subscription_name>
-
-
-
Deleting subscriptions
-
You can delete a subscription by using the kn or kubectl CLI tools.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
This is an evolving document on how to debug a non-working Knative Eventing
-setup.
-
Audience
-
This document is intended for people that are familiar with the object model of
-Knative Eventing. You don’t need to be an expert, but do need to
-know roughly how things fit together.
This guide uses an example consisting of an event source that sends events to a
-function.
-
-
See example.yaml for the entire YAML. For any commands in this
-guide to work, you must apply example.yaml:
-
kubectl apply --filename example.yaml
-
Triggering Events
-
Knative events will occur whenever a Kubernetes
-Event
-occurs in the knative-debug namespace. We can cause this to occur with the
-following commands:
-
kubectl --namespace knative-debug run to-be-deleted --image=image-that-doesnt-exist --restart=Never
-# 5 seconds is arbitrary. We want K8s to notice that the Pod needs to be scheduled and generate at least one event.
-sleep 5
-kubectl --namespace knative-debug delete pod to-be-deleted
-
Then we can see the Kubernetes Events (note that these are not Knative
-events!):
-
kubectl --namespace knative-debug get events
-
This should produce output along the lines of:
-
LAST SEEN FIRST SEEN COUNT NAME KIND SUBOBJECT TYPE REASON SOURCE MESSAGE
-20s 20s 1 to-be-deleted.157aadb9f376fc4e Pod Normal Scheduled default-scheduler Successfully assigned knative-debug/to-be-deleted to gke-kn24-default-pool-c12ac83b-pjf2
-
Where are my events?
-
You’ve applied example.yaml and you are inspecting fn’s logs:
kubectl --namespace knative-debug get service svc
-
We just want to ensure this exists and has the correct name. If it doesn’t
-exist, then you probably need to re-apply example.yaml.
-
Verify it points at the expected pod.
-
svcLabels=$(kubectl --namespace knative-debug get service svc -o go-template='{{range $k, $v := .spec.selector}}{{ $k }}={{ $v }},{{ end }}'| sed 's/.$//')
-kubectl --namespace knative-debug get pods -l $svcLabels
-
This should return a single Pod, which if you inspect is the one generated by
-fn.
-
chan
-
chan uses the
-[in-memory-channel]( https://github.com/knative/eventing/tree/{{< branch >}}/config/channels/in-memory-channel).
-This is a very basic channel and has few
-failure modes that will be exhibited in chan’s status.
This should return True. If it doesn’t, get the full resource:
-
kubectl --namespace knative-debug get channel.messaging.knative.dev chan --output yaml
-
If status is completely missing, it implies that something is wrong with the
-in-memory-channel controller. See Channel Controller.
-
Next verify that chan is addressable:
-
kubectl --namespace knative-debug get channel.messaging.knative.dev chan -o jsonpath='{.status.address.hostname}'
-
This should return a URI, likely ending in ‘.cluster.local’. If it doesn’t, then
-it implies that something went wrong during reconciliation. See
-Channel Controller.
-
We will verify that the two resources that the chan creates exist and are
-Ready.
-
Service
-
chan creates a K8s Service.
-
kubectl --namespace knative-debug get service -l messaging.knative.dev/role=in-memory-channel
-
It’s spec is completely unimportant, as Istio will ignore it. It just needs to
-exist so that src can send events to it. If it doesn’t exist, it implies that
-something went wrong during chan reconciliation. See
-Channel Controller.
kubectl --namespace knative-debug get apiserversource src -o jsonpath='{.spec.sink}'
-
Which should return
-map[apiVersion:messaging.knative.dev/v1 kind:Channel name:chan]. If it
-doesn’t, then src was setup incorrectly and its spec needs to be fixed.
-Fixing should be as simple as updating its spec to have the correct sink
-(see example.yaml).
-
Now that we know src is sending to chan, let’s verify that it is Ready.
kubectl --namespace knative-debug get subscription sub -o jsonpath='{.status.conditions[?(.type == "Ready")].status}'
-
This should return True. If it doesn’t then, look at all the status entries.
-
kubectl --namespace knative-debug get subscription sub --output yaml
-
Controllers
-
Each of the resources has a Controller that is watching it. As of today, they
-tend to do a poor job of writing failure status messages and events, so we need
-to look at the Controller’s logs.
-
Deployment Controller
-
The Kubernetes Deployment Controller, controlling fn, is out of scope for this
-document.
-
Service Controller
-
The Kubernetes Service Controller, controlling svc, is out of scope for this
-document.
-
Channel Controller
-
There is not a single Channel Controller. Instead, there is one
-Controller for each Channel CRD. chan uses the
-InMemoryChannelChannel CRD, whose Controller is:
-
kubectl --namespace knative-eventing get pod -l messaging.knative.dev/channel=in-memory-channel,messaging.knative.dev/role=controller --output yaml
-
Pay particular attention to any lines that have a logging level of warning or
-error.
-
Subscription Controller
-
The Subscription Controller controls sub. It attempts to resolve the
-addresses that a Channel should send events to, and once resolved, inject
-those into the Channel’s spec.subscribable.
-
kubectl --namespace knative-eventing get pod -l app=eventing-controller
-
Pay particular attention to any lines that have a logging level of warning or
-error.
-
Data Plane
-
The entire Control Plane looks healthy, but we’re still not
-getting any events. Now we need to investigate the data plane.
-
The Knative event takes the following path:
-
-
-
Event is generated by src.
-
-
In this case, it is caused by having a Kubernetes Event trigger it, but
-as far as Knative is concerned, the Source is generating the event denovo
-(from nothing).
-
-
-
-
src is POSTing the event to chan’s address,
-http://chan-kn-channel.knative-debug.svc.cluster.local.
-
-
-
The Channel Dispatcher receives the request and introspects the Host header
-to determine which Channel it corresponds to. It sees that it corresponds
-to knative-debug/chan so forwards the request to the subscribers defined in
-sub, in particular svc, which is backed by fn.
-
-
-
fn receives the request and logs it.
-
-
-
We will investigate components in the order in which events should travel.
-
Channel Dispatcher
-
The Channel Dispatcher is the component that receives POSTs pushing events into
-Channels and then POSTs to subscribers of those Channels when an event is
-received. For the in-memory-channel used in this example, there is a single
-binary that handles both the receiving and dispatching sides for all
-in-memory-channelChannels.
-
First we will inspect the Dispatcher’s logs to see if it is anything obvious:
{"level":"info","ts":"2019-08-16T13:50:55.424Z","logger":"inmemorychannel-dispatcher.in-memory-channel-dispatcher","caller":"provisioners/message_receiver.go:147","msg":"Request mapped to channel: knative-debug/chan-kn-channel","knative.dev/controller":"in-memory-channel-dispatcher"}
-{"level":"info","ts":"2019-08-16T13:50:55.425Z","logger":"inmemorychannel-dispatcher.in-memory-channel-dispatcher","caller":"provisioners/message_dispatcher.go:112","msg":"Dispatching message to http://svc.knative-debug.svc.cluster.local/","knative.dev/controller":"in-memory-channel-dispatcher"}
-{"level":"info","ts":"2019-08-16T13:50:55.981Z","logger":"inmemorychannel-dispatcher.in-memory-channel-dispatcher","caller":"provisioners/message_receiver.go:140","msg":"Received request for chan-kn-channel.knative-debug.svc.cluster.local","knative.dev/controller":"in-memory-channel-dispatcher"}
-
Which shows that the request is being received and then sent to svc, which is
-returning a 2XX response code (likely 200, 202, or 204).
-
However if we see something like:
-
-
{"level":"info","ts":"2019-08-16T16:10:16.859Z","logger":"inmemorychannel-dispatcher.in-memory-channel-dispatcher","caller":"provisioners/message_receiver.go:140","msg":"Received request for chan-kn-channel.knative-debug.svc.cluster.local","knative.dev/controller":"in-memory-channel-dispatcher"}
-{"level":"info","ts":"2019-08-16T16:10:16.859Z","logger":"inmemorychannel-dispatcher.in-memory-channel-dispatcher","caller":"provisioners/message_receiver.go:147","msg":"Request mapped to channel: knative-debug/chan-kn-channel","knative.dev/controller":"in-memory-channel-dispatcher"}
-{"level":"info","ts":"2019-08-16T16:10:16.859Z","logger":"inmemorychannel-dispatcher.in-memory-channel-dispatcher","caller":"provisioners/message_dispatcher.go:112","msg":"Dispatching message to http://svc.knative-debug.svc.cluster.local/","knative.dev/controller":"in-memory-channel-dispatcher"}
-{"level":"error","ts":"2019-08-16T16:10:38.169Z","logger":"inmemorychannel-dispatcher.in-memory-channel-dispatcher","caller":"fanout/fanout_handler.go:121","msg":"Fanout had an error","knative.dev/controller":"in-memory-channel-dispatcher","error":"Unable to complete request Post http://svc.knative-debug.svc.cluster.local/: dial tcp 10.4.44.156:80: i/o timeout","stacktrace":"knative.dev/eventing/pkg/provisioners/fanout.(*Handler).dispatch\n\t/Users/xxxxxx/go/src/knative.dev/eventing/pkg/provisioners/fanout/fanout_handler.go:121\nknative.dev/eventing/pkg/provisioners/fanout.createReceiverFunction.func1.1\n\t/Users/i512777/go/src/knative.dev/eventing/pkg/provisioners/fanout/fanout_handler.go:95"}
-
Then we know there was a problem posting to
-http://svc.knative-debug.svc.cluster.local/.
-
TODO Finish this section. Especially after the Channel Dispatcher emits K8s
-events about failures.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Knative Eventing provides various configuration parameters to control the delivery
-of events in case of failure. For instance, you can decide to retry sending events
-that failed to be consumed, and if this didn’t work you can decide to forward those
-events to a dead letter sink.
-
Configuring Subscription Delivery
-
Knative Eventing offers fine-grained control on how events are delivered for each subscription by adding a delivery section. Consider this example:
The deadLetterSink specifies where to send events that failed be consumed by subscriber.
-
Configuring Broker Delivery
-
Knative Eventing offers fine-grained control on how events are delivered for each broker by adding a delivery section. Consider this example:
-
apiVersion:messaging.knative.dev/v1
-kind:Subscription
-metadata:
-name:with-dead-letter-sink
-spec:
-channel:
-apiVersion:messaging.knative.dev/v1
-kind:InMemoryChannel
-name:default
-delivery:
-retry:5
-backoffPolicy:exponential# or linear
-backoffDelay:"PT0.5S"# or ISO8601 duration
-deadLetterSink:
-ref:
-apiVersion:serving.knative.dev/v1
-kind:Service
-name:error-handler
-subscriber:
-uri:http://doesnotexist.default.svc.cluster.local
-
The Broker will retry sending events 5 times with a backoff delay of 500 milliseconds
-and exponential backoff policy.
-
The deadLetterSink specifies where to send events that failed to be consumed by subscriber
-after the specified number of retries.
-
Common Delivery Parameters
-
The delivery value must be a Delivery Spec, which is a partial schema that is embedded in resources like Broker, Trigger and Subscription.
-
# DeadLetterSink is the sink receiving event that could not be sent to
-# a destination.
-deadLetterSink:
-ref:
-apiVersion:v1
-kind:Service
-name:my-service
-uri:/my-path
-
-# Retry is the minimum number of retries the sender should attempt when
-# sending an event before moving it to the dead letter sink.
-retry:5
-
-// BackoffPolicy is the retry backoff policy (linear, exponential).
-backoffPolicy:exponential
-
-# BackoffDelay is the delay before retrying.
-# More information on Duration format:
-# - https://www.iso.org/iso-8601-date-and-time-format.html
-# - https://en.wikipedia.org/wiki/ISO_8601
-#
-# For linear policy, backoff delay is backoffDelay*<numberOfRetries>.
-# For exponential policy, backoff delay is backoffDelay*2^<numberOfRetries>.
-backoffDelay:PT2S
-
deadLetterSink
-
When present, events that failed to be consumed are sent to the deadLetterSink.
-In case of failure, the event is dropped and an error is logged into the system.
-
The deadLetterSink value must be a Destination.
-
# DeadLetterSink is the sink receiving event that could not be sent to
-# a destination.
-deadLetterSink:
-ref:
-apiVersion:v1
-kind:Service
-name:my-service
-uri:/my-path
-
Failed events may, depending on the specific Channel implementation in use, be
-enhanced with extension attributes prior to forwarding to thedeadLetterSink.
-These extension attributes are as follows:
-
-
-
knativeerrorcode
-
-
Type: Int
-
Description: The HTTP Response StatusCode from the final event
-dispatch attempt.
-
Constraints: Should always be present as every HTTP Response contains
-a StatusCode.
-
Examples:
-
-
“500”
-
…any HTTP StatusCode…
-
-
-
-
-
-
knativeerrordata
-
-
Type: String
-
Description: The HTTP Response Body from the final event dispatch
-attempt.
-
Constraints: Will be empty if the HTTP Response Body was empty,
-and might be truncated if the length is excessive.
-
Examples:
-
-
‘Internal Server Error: Failed to process event.’
-
‘{“key”: “value”}’
-
…any HTTP Response Body…
-
-
-
-
-
-
Channel Support
-
The table below summarizes what delivery parameters are supported for each channel implementation.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
The event registry maintains a catalog of event types that can be consumed
-from different brokers. It introduces the EventType custom resource in order to persist the event
-type information in the cluster data store.
Using the registry, you can discover different types of events that can be consumed by broker event meshes. The registry is designed for use with
-the broker and trigger model, and aims to help you create triggers.
-
To see event types in the registry that are available to subscribe to, enter the following command:
-
kubectl get eventtypes -n <namespace>
-
Below, we show an example output of executing the above command using the
-default namespace in a testing cluster. We will address the question of how
-this registry was populated in a later section.
From a consumer standpoint, the fields that matter the most are the spec
-fields as well as the status.
-
The name is advisory (i.e., non-authoritative), and we typically generate it
-(generateName) to avoid naming collisions (e.g., two EventTypes listening to
-pull requests on two different Github repositories). As name nor
-generateName are needed for consumers to create Triggers, we defer their
-discussion for later on.
-
Regarding status, its main purpose it to tell consumers (or cluster operators)
-whether the EventType is ready for consumption or not. That readiness is based
-on the Broker being ready. We can see from the example output that the PubSub
-EventType is not ready, as its dev Broker isn’t.
-
Let’s talk in more details about the spec fields:
-
-
-
type: is authoritative. This refers to the CloudEvent type as it enters into
-the event mesh. It is mandatory. Event consumers can (and in most cases would)
-create Triggers filtering on this attribute.
-
-
-
source: refers to the CloudEvent source as it enters into the event mesh. It
-is mandatory. Event consumers can (and in most cases would) create Triggers
-filtering on this attribute.
-
-
-
schema: is a valid URI with the EventType schema. It may be a JSON schema, a
-protobuf schema, etc. It is optional.
-
-
-
description: is a string describing what the EventType is about. It is
-optional.
-
-
-
broker refers to the Broker that can provide the EventType. It is mandatory.
-
-
-
Subscribing to events
-
Now that you know what events can be consumed from the Brokers' event meshes,
-you can create Triggers to subscribe to particular events.
-
Here are a few example Triggers that subscribe to events using exact matching on
-type and/or source, based on the above registry output:
As per the registry output above, only two sources exist for that particular
-type of event (knative’s eventing and serving repositories). If later on
-new sources are registered for GitHub pushes, this trigger will be able to
-consume them.
-
-
-
Subscribes to GitHub pull requests from knative’s eventing repository.
Note that events won’t be able to be consumed by this Trigger’s subscriber
-until the Broker becomes ready.
-
-
-
Populating the registry
-
Now that we know how to discover events using the registry and how we can
-leverage that information to subscribe to events of interest, let’s move on to
-the next topic: How do we actually populate the registry in the first place?
-
-
-
Manual Registration
-
In order to populate the registry, a cluster configurator can manually
-register the EventTypes. This means that the configurator can simply apply
-EventTypes yaml files, just as with any other Kubernetes resource:
-
kubectl apply -f <event_type.yaml>
-
-
-
Automatic Registration
-
As Manual Registration might be tedious and error-prone, we also support
-automatic registration of EventTypes. The creation of the EventTypes is done
-upon instantiation of an Event Source. We currently support automatic
-registration of EventTypes for the following Event Sources:
-
-
CronJobSource
-
ApiServerSource
-
GithubSource
-
GcpPubSubSource
-
KafkaSource
-
AwsSqsSource
-
-
Let’s look at an example, in particular, the KafkaSource sample we used to
-populate the registry in our testing cluster. Below is what the yaml looks
-like.
If you are interested in more information regarding configuration options of a
-KafkaSource, please refer to the
-KafKaSource sample.
-
For this discussion, the relevant information from the yaml above are the
-sink and the topics. We observe that the sink is of kind Broker. We
-currently only support automatic creation of EventTypes for Sources instances
-that point to Brokers. Regarding topics, this is what we use to generate the
-EventTypes source field, which is equal to the CloudEvent source attribute.
-
When you kubectl apply this yaml, the KafkaSource kafka-source-sample will
-be instantiated, and two EventTypes will be added to the registry (as there
-are two topics). You can see that in the registry example output from the
-previous sections.
-
-
-
What’s next
-
To get started, install Knative Eventing if you haven’t yet, and try
-experimenting with different Event Sources in your Knative cluster.
Knative code samples is a useful resource to better understand
-some of the Event Sources (remember to point them to a Broker if you want
-automatic registration of EventTypes in the registry).
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Knative Eventing provides a collection of CRDs
-for describing event flows:
-
-
Sequence is for defining an in-order list of functions.
-
Parallel is for defining a list of branches, each receiving the same CloudEvent.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/flows/index.xml b/archived/v0.22-docs/eventing/flows/index.xml
deleted file mode 100644
index e08741613..000000000
--- a/archived/v0.22-docs/eventing/flows/index.xml
+++ /dev/null
@@ -1,145 +0,0 @@
-
-
- Knative – Eventing Flows
- https://knative.dev/v0.22-docs/eventing/flows/
- Recent content in Eventing Flows on Knative
- Hugo -- gohugo.io
-
-
-
-
-
-
-
-
-
-
- V0.22-Docs: Parallel
- https://knative.dev/v0.22-docs/eventing/flows/parallel/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/flows/parallel/
-
-
-
- <p>Parallel CRD provides a way to easily define a list of branches, each receiving
-the same CloudEvent sent to the Parallel ingress channel. Typically, each branch
-consists of a filter function guarding the execution of the branch.</p>
-<p>Parallel creates <code>Channel</code>s and <code>Subscription</code>s under the hood.</p>
-<h2 id="usage">Usage</h2>
-<h3 id="parallel-spec">Parallel Spec</h3>
-<p>Parallel has three parts for the Spec:</p>
-<ol>
-<li><code>branches</code> defines the list of <code>filter</code> and <code>subscriber</code> pairs, one per branch,
-and optionally a <code>reply</code> object. For each branch:
-<ol>
-<li>(optional) the <code>filter</code> is evaluated and when it returns an event the <code>subscriber</code> is
-executed. Both <code>filter</code> and <code>subscriber</code> must be <code>Addressable</code>.</li>
-<li>the event returned by the <code>subscriber</code> is sent to the branch <code>reply</code>
-object. When the <code>reply</code> is empty, the event is sent to the <code>spec.reply</code>
-object (see below).</li>
-</ol>
-</li>
-<li>(optional) <code>channelTemplate</code> defines the Template which will be used to
-create <code>Channel</code>s.</li>
-<li>(optional) <code>reply</code> defines where the result of each branch is sent to when
-the branch does not have its own <code>reply</code> object.</li>
-</ol>
-<h3 id="parallel-status">Parallel Status</h3>
-<p>Parallel has three parts for the Status:</p>
-<ol>
-<li><code>conditions</code> which details the overall status of the Parallel object</li>
-<li><code>ingressChannelStatus</code> and <code>branchesStatuses</code> which convey the status of
-underlying <code>Channel</code> and <code>Subscription</code> resource that are created as part of
-this Parallel.</li>
-<li><code>address</code> which is exposed so that Parallel can be used where Addressable can
-be used. Sending to this address will target the <code>Channel</code> which is fronting
-this Parallel (same as <code>ingressChannelStatus</code>).</li>
-</ol>
-<h2 id="examples">Examples</h2>
-<p>Learn how to use Parallel by following the <a href="../../samples/parallel/index.html">examples</a></p>
-
-
-
-
-
- V0.22-Docs: Sequence
- https://knative.dev/v0.22-docs/eventing/flows/sequence/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/flows/sequence/
-
-
-
- <p>Sequence CRD provides a way to define an in-order list of functions that will be
-invoked. Each step can modify, filter or create a new kind of an event. Sequence
-creates <code>Channel</code>s and <code>Subscription</code>s under the hood.</p>
-<h2 id="usage">Usage</h2>
-<h3 id="sequence-spec">Sequence Spec</h3>
-<p>Sequence has three parts for the Spec:</p>
-<ol>
-<li><code>Steps</code> which defines the in-order list of <code>Subscriber</code>s, aka, which
-functions are executed in the listed order. These are specified using the
-<code>messaging.v1.SubscriberSpec</code> just like you would when creating
-<code>Subscription</code>. Each step should be <code>Addressable</code>.</li>
-<li><code>ChannelTemplate</code> defines the Template which will be used to create
-<code>Channel</code>s between the steps.</li>
-<li><code>Reply</code> (Optional) Reference to where the results of the final step in the
-sequence are sent to.</li>
-</ol>
-<h3 id="sequence-status">Sequence Status</h3>
-<p>Sequence has four parts for the Status:</p>
-<ol>
-<li>Conditions which detail the overall Status of the Sequence object</li>
-<li>ChannelStatuses which convey the Status of underlying <code>Channel</code> resources
-that are created as part of this Sequence. It is an array and each Status
-corresponds to the Step number, so the first entry in the array is the Status
-of the <code>Channel</code> before the first Step.</li>
-<li>SubscriptionStatuses which convey the Status of underlying <code>Subscription</code>
-resources that are created as part of this Sequence. It is an array and each
-Status corresponds to the Step number, so the first entry in the array is the
-<code>Subscription</code> which is created to wire the first channel to the first step
-in the <code>Steps</code> array.</li>
-<li>AddressStatus which is exposed so that Sequence can be used where Addressable
-can be used. Sending to this address will target the <code>Channel</code> which is
-fronting the first Step in the Sequence.</li>
-</ol>
-<h2 id="examples">Examples</h2>
-<p>For each of these examples below, we’ll use
-<a href="https://knative.dev/docs/eventing/samples/ping-source/"><code>PingSource</code></a> as
-the source of events.</p>
-<p>We also use a very simple
-<a href="https://github.com/vaikas-google/transformer">transformer</a> which performs very
-trivial transformation of the incoming events to demonstrate they have passed
-through each stage.</p>
-<h3 id="sequence-with-no-reply-terminal-last-stepsamplessequencesequence-terminalindexhtml"><a href="../../samples/sequence/sequence-terminal/index.html">Sequence with no reply (terminal last Step)</a></h3>
-<p>For the first example, we’ll use a 3 Step <code>Sequence</code> that is wired directly into
-the <code>PingSource</code>. Each of the steps simply tacks on “- Handled by
-<STEP NUMBER>”, for example the first Step in the <code>Sequence</code> will take the
-incoming message and append “- Handled by 0” to the incoming message.</p>
-<h3 id="sequence-with-reply-last-step-produces-outputsamplessequencesequence-reply-to-event-displayindexhtml"><a href="../../samples/sequence/sequence-reply-to-event-display/index.html">Sequence with reply (last Step produces output)</a></h3>
-<p>For the next example, we’ll use the same 3 Step <code>Sequence</code> that is wired
-directly into the <code>PingSource</code>. Each of the steps simply tacks on “- Handled
-by <STEP NUMBER>”, for example the first Step in the <code>Sequence</code> will take the
-incoming message and append “- Handled by 0” to the incoming message.</p>
-<p>The only difference is that we’ll use the <code>Subscriber.Spec.Reply</code> field to wire
-the output of the last Step to an event display pod.</p>
-<h3 id="chaining-sequences-togethersamplessequencesequence-reply-to-sequenceindexhtml"><a href="../../samples/sequence/sequence-reply-to-sequence/index.html">Chaining Sequences together</a></h3>
-<p>For the next example, we’ll use the same 3 Step <code>Sequence</code> that is wired
-directly into the <code>PingSource</code>. Each of the steps simply tacks on “- Handled
-by <STEP NUMBER>”, for example the first Step in the <code>Sequence</code> will take the
-incoming message and append “- Handled by 0” to the incoming message.</p>
-<p>The only difference is that we’ll use the <code>Subscriber.Spec.Reply</code> field to wire
-the output of the last Step to another <code>Sequence</code> that does the same message
-modifications as the first pipeline (with different steps however).</p>
-<h3 id="using-sequence-with-brokertrigger-modelsamplessequencesequence-with-broker-triggerindexhtml"><a href="../../samples/sequence/sequence-with-broker-trigger/index.html">Using Sequence with Broker/Trigger model</a></h3>
-<p>You can also create a Trigger which targets <code>Sequence</code>. This time we’ll wire
-<code>PingSource</code> to send events to a <code>Broker</code> and then we’ll have the <code>Sequence</code>
-emit the resulting Events back into the Broker so that the results of the
-<code>Sequence</code> can be observed by other <code>Trigger</code>s.</p>
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/flows/parallel/index.html b/archived/v0.22-docs/eventing/flows/parallel/index.html
deleted file mode 100644
index 714ff3f35..000000000
--- a/archived/v0.22-docs/eventing/flows/parallel/index.html
+++ /dev/null
@@ -1,2301 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-Parallel | Knative
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Parallel | Knative
-
-
-
-
-
-
-
-
-
Black lives matter.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Parallel CRD provides a way to easily define a list of branches, each receiving
-the same CloudEvent sent to the Parallel ingress channel. Typically, each branch
-consists of a filter function guarding the execution of the branch.
-
Parallel creates Channels and Subscriptions under the hood.
-
Usage
-
Parallel Spec
-
Parallel has three parts for the Spec:
-
-
branches defines the list of filter and subscriber pairs, one per branch,
-and optionally a reply object. For each branch:
-
-
(optional) the filter is evaluated and when it returns an event the subscriber is
-executed. Both filter and subscriber must be Addressable.
-
the event returned by the subscriber is sent to the branch reply
-object. When the reply is empty, the event is sent to the spec.reply
-object (see below).
-
-
-
(optional) channelTemplate defines the Template which will be used to
-create Channels.
-
(optional) reply defines where the result of each branch is sent to when
-the branch does not have its own reply object.
-
-
Parallel Status
-
Parallel has three parts for the Status:
-
-
conditions which details the overall status of the Parallel object
-
ingressChannelStatus and branchesStatuses which convey the status of
-underlying Channel and Subscription resource that are created as part of
-this Parallel.
-
address which is exposed so that Parallel can be used where Addressable can
-be used. Sending to this address will target the Channel which is fronting
-this Parallel (same as ingressChannelStatus).
-
-
Examples
-
Learn how to use Parallel by following the examples
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Sequence CRD provides a way to define an in-order list of functions that will be
-invoked. Each step can modify, filter or create a new kind of an event. Sequence
-creates Channels and Subscriptions under the hood.
-
Usage
-
Sequence Spec
-
Sequence has three parts for the Spec:
-
-
Steps which defines the in-order list of Subscribers, aka, which
-functions are executed in the listed order. These are specified using the
-messaging.v1.SubscriberSpec just like you would when creating
-Subscription. Each step should be Addressable.
-
ChannelTemplate defines the Template which will be used to create
-Channels between the steps.
-
Reply (Optional) Reference to where the results of the final step in the
-sequence are sent to.
-
-
Sequence Status
-
Sequence has four parts for the Status:
-
-
Conditions which detail the overall Status of the Sequence object
-
ChannelStatuses which convey the Status of underlying Channel resources
-that are created as part of this Sequence. It is an array and each Status
-corresponds to the Step number, so the first entry in the array is the Status
-of the Channel before the first Step.
-
SubscriptionStatuses which convey the Status of underlying Subscription
-resources that are created as part of this Sequence. It is an array and each
-Status corresponds to the Step number, so the first entry in the array is the
-Subscription which is created to wire the first channel to the first step
-in the Steps array.
-
AddressStatus which is exposed so that Sequence can be used where Addressable
-can be used. Sending to this address will target the Channel which is
-fronting the first Step in the Sequence.
-
-
Examples
-
For each of these examples below, we’ll use
-PingSource as
-the source of events.
-
We also use a very simple
-transformer which performs very
-trivial transformation of the incoming events to demonstrate they have passed
-through each stage.
For the first example, we’ll use a 3 Step Sequence that is wired directly into
-the PingSource. Each of the steps simply tacks on “- Handled by
-”, for example the first Step in the Sequence will take the
-incoming message and append “- Handled by 0” to the incoming message.
For the next example, we’ll use the same 3 Step Sequence that is wired
-directly into the PingSource. Each of the steps simply tacks on “- Handled
-by ”, for example the first Step in the Sequence will take the
-incoming message and append “- Handled by 0” to the incoming message.
-
The only difference is that we’ll use the Subscriber.Spec.Reply field to wire
-the output of the last Step to an event display pod.
For the next example, we’ll use the same 3 Step Sequence that is wired
-directly into the PingSource. Each of the steps simply tacks on “- Handled
-by ”, for example the first Step in the Sequence will take the
-incoming message and append “- Handled by 0” to the incoming message.
-
The only difference is that we’ll use the Subscriber.Spec.Reply field to wire
-the output of the last Step to another Sequence that does the same message
-modifications as the first pipeline (with different steps however).
You can also create a Trigger which targets Sequence. This time we’ll wire
-PingSource to send events to a Broker and then we’ll have the Sequence
-emit the resulting Events back into the Broker so that the results of the
-Sequence can be observed by other Triggers.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Verify that the broker is working correctly, by entering the following command:
-
kubectl -n event-example get broker default
-
This shows information about your broker. If the broker is working correctly, it shows a READY status of True:
-
NAME READY REASON URL AGE
-default True http://broker-ingress.knative-eventing.svc.cluster.local/event-example/default 1m
-
If READY is False, wait a few moments and then run the command again.
-If you continue to receive the False status, see the Debugging Guide to troubleshoot the issue.
-
-
-
Creating event consumers
-
In this step, you create two event consumers, hello-display and goodbye-display, to
-demonstrate how you can configure your event producers to target a specific consumer.
-
-
-
To deploy the hello-display consumer to your cluster, run the following
-command:
Verify that the event consumers are working by entering the following command:
-
kubectl -n event-example get deployments hello-display goodbye-display
-
This lists the hello-display and goodbye-display consumers that you
-deployed:
-
NAME READY UP-TO-DATE AVAILABLE AGE
-hello-display 1/1 1 1 26s
-goodbye-display 1/1 1 1 16s
-
The number of replicas in the READY column should match the number of replicas in the AVAILABLE column.
-If the numbers do not match, see the Debugging Guide to troubleshoot the issue.
-
-
-
Creating triggers
-
A trigger defines the events that each event consumer receives.
-Brokers use triggers to forward events to the correct consumers.
-Each trigger can specify a filter that enables selection of relevant events based on the Cloud Event context attributes.
-
-
-
Create a trigger by entering the following command:
The command creates a trigger that sends all events of source sendoff to
-your event consumer named goodbye-display.
-
-
-
Verify that the triggers are working correctly by running the following
-command:
-
kubectl -n event-example get triggers
-
This returns the hello-display and goodbye-display triggers that you
-created:
-
NAME READY REASON BROKER SUBSCRIBER_URI AGE
-goodbye-display True default http://goodbye-display.event-example.svc.cluster.local/ 9s
-hello-display True default http://hello-display.event-example.svc.cluster.local/ 16s
-
If the triggers are correctly configured, they will be ready and pointing to the correct broker (default) and SUBSCRIBER_URI.
-
The SUBSCRIBER_URI has a value similar to triggerName.namespaceName.svc.cluster.local.
-The exact value depends on the broker implementation.
-If this value looks incorrect, see the Debugging Guide to troubleshoot the issue.
-
-
-
Creating a pod as an event producer
-
This guide uses curl commands to manually send individual events as HTTP requests to the broker, and demonstrate how these events are received by the correct event consumer.
-
The broker can only be accessed from within the cluster where Knative Eventing is installed. You must create a pod within that cluster to act as an event producer that will execute the curl commands.
-
To create a pod, enter the following command:
-
kubectl -n event-example apply -f - << EOF
-apiVersion: v1
-kind: Pod
-metadata:
- labels:
- run: curl
- name: curl
-spec:
- containers:
- # This could be any image that we can SSH into and has curl.
- - image: radial/busyboxplus:curl
- imagePullPolicy: IfNotPresent
- name: curl
- resources: {}
- stdin: true
- terminationMessagePath: /dev/termination-log
- terminationMessagePolicy: File
- tty: true
-EOF
-
Sending events to the broker
-
-
-
SSH into the pod by running the following command:
-
kubectl -n event-example attach curl -it
-
You will see a prompt similar to the following:
-
Defaulting container name to curl.
-Use 'kubectl describe pod/ -n event-example' to see all of the containers in this pod.
-If you don't see a command prompt, try pressing enter.
-[ root@curl:/ ]$
-
-
-
Make a HTTP request to the broker. To show the various types of events you can send, you will make three requests:
-
-
-
To make the first request, which creates an event that has the type
-greeting, run the following in the SSH terminal:
When the broker receives your event, hello-display will activate and send
-it to the event consumer of the same name.
-If the event has been received, you will receive a 202 Accepted response
-similar to the one below:
When the broker receives your event, goodbye-display will activate and
-send the event to the event consumer of the same name.
-If the event has been received, you will receive a 202 Accepted response
-similar to the one below:
When the broker receives your event, hello-display and goodbye-display
-will activate and send the event to the event consumers of the same name.
-If the event has been received, you will receive a 202 Accepted response
-similar to the one below:
You have sent two events to the hello-display event consumer and two events to
-the goodbye-display event consumer (note that say-hello-goodbye activates
-the trigger conditions for bothhello-display and goodbye-display). You
-will verify that these events were received correctly in the next section.
-
Verifying that events were received
-
After you send the events, verify that the events were received by the correct subscribers.
-
-
Look at the logs for the hello-display event consumer by entering the
-following command:
-
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Knative Eventing is a system that is designed to address a common need for cloud
-native development and provides composable primitives to enable late-binding
-event sources and event consumers.
Default Channels provide a way to choose the
-persistence strategy for Channels across the cluster.
-
-
Functionality
-
Knative Eventing supports multiple modes of usage. The following scenarios are
-well-supported by the existing components; since the system is modular, it’s
-also possible to combine the components in novel ways.
-
-
-
I just want to publish events, I don’t care who consumes them. Send
-events to a broker as an HTTP POST. Sink binding can be useful to decouple the destination
-configuration from your application.
-
-
-
I just want to consume events like X, I don’t care how they are
-published. Use a trigger to consume events from a Broker based
-on CloudEvents attributes. Your application will receive the events as an
-HTTP POST.
-
-
-
I want to transform events through a series of steps. Use channels and
-subscriptions to define complex message-passing topologies. For
-simple pipelines, the Sequence automates construction of
-channels and subscriptions between each stage.
-
-
-
Knative also supports some additional patterns such as
-Parallel fanout of events, and routing response events from
-both Channels and Brokers.
-
Design overview
-
Knative Eventing is designed around the following goals:
-
-
The Knative Eventing resources are loosely coupled. These resources can be
-developed and deployed independently on, and across a variety of platforms
-(for example Kubernetes, VMs, SaaS or FaaS).
-
Event producers and event consumers are independent. Any producer (or
-source), can generate events before there are active event consumers that are
-listening. Any event consumer can express interest in an event or class of
-events, before there are producers that are creating those events.
-
Other services can be connected to the Eventing system. These services can
-perform the following functions:
-
-
Create new applications without modifying the event producer or event
-consumer.
-
Select and target specific subsets of the events from their producers.
-
-
-
Ensure cross-service interoperability. Knative Eventing is consistent with
-the
-CloudEvents
-specification that is developed by the
-CNCF Serverless WG.
-
-
Event consumers
-
To enable delivery to multiple types of Services, Knative Eventing defines two
-generic interfaces that can be implemented by multiple Kubernetes resources:
-
-
Addressable objects are able to receive and acknowledge an event
-delivered over HTTP to an address defined in their status.address.url
-field. As a special case, the core
-Kubernetes Service object
-also fulfils the Addressable interface.
-
Callable objects are able to receive an event delivered over HTTP and
-transform the event, returning 0 or 1 new events in the HTTP response. These
-returned events may be further processed in the same way that events from an
-external event source are processed.
-
-
Event sources
-
To learn about using event sources, see the event sources documentation.
-
Event brokers and triggers
-
Broker and Trigger objects make it easy to filter events based on event
-attributes.
-
A Broker provides a bucket of events which can be selected by attribute. It
-receives events and forwards them to subscribers defined by one or more matching
-Triggers. Since a Broker implements Addressable, event senders can submit events
-to the Broker by POSTing the event to the Broker’s status.address.url.
-
A Trigger describes a filter on event attributes which should be delivered to an
-Addressable. You can create as many Triggers as necessary.
-
For most use cases, a single bucket (Broker) per namespace is sufficient, but
-there are serveral use cases where multiple buckets (Brokers) can simplify
-architecture. For example, separate Brokers for events containing Personally
-Identifiable Information (PII) and non-PII events can simplify audit and access
-control rules.
-
-
Event registry
-
Knative Eventing defines an EventType object to make it easier for consumers to
-discover the types of events they can consume from Brokers.
-
The registry consists of a collection of event types. The event types stored in
-the registry contain (all) the required information for a consumer to create a
-Trigger without resorting to some other out-of-band mechanism.
Knative Eventing also defines an event forwarding and persistence layer, called
-a channel.
-Each channel is a separate Kubernetes custom resource.
-Events are delivered to services or forwarded to other channels
-(possibly of a different type) using
-subscriptions.
-This allows message delivery in a cluster to vary based on requirements, so that
-some events might be handled by an in-memory implementation while others would
-be persisted using Apache Kafka or NATS Streaming.
There are cases where you may want to utilize a set of co-operating functions
-together and for those use cases, Knative Eventing provides two additional
-resources:
-
-
Sequence provides a way to define an in-order list of functions.
-
Parallel provides a way to define a list of branches for events.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/index.xml b/archived/v0.22-docs/eventing/index.xml
deleted file mode 100644
index e9a94df47..000000000
--- a/archived/v0.22-docs/eventing/index.xml
+++ /dev/null
@@ -1,2000 +0,0 @@
-
-
- Knative – Knative Eventing
- https://knative.dev/v0.22-docs/eventing/
- Recent content in Knative Eventing on Knative
- Hugo -- gohugo.io
-
-
-
-
-
-
-
-
-
-
- V0.22-Docs: Getting Started with Knative Eventing
- https://knative.dev/v0.22-docs/eventing/getting-started/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/getting-started/
-
-
-
- <p>After you install Knative Eventing, you can create, send, and verify events.
-This guide shows how you can use a basic workflow for managing events.</p>
-<p>Before you start to manage events, you must create the objects needed to
-transport the events.</p>
-<h2 id="creating-a-knative-eventing-namespace">Creating a Knative Eventing namespace</h2>
-<p>Namespaces are used to group together and organize your Knative resources.</p>
-<!--TODO: Add documentation about namespaces to core docs?-->
-<p>Create a new namespace called <code>event-example</code> by entering the following command:</p>
-<pre><code>kubectl create namespace event-example
-</code></pre><h2 id="adding-a-broker-to-the-namespace">Adding a broker to the namespace</h2>
-<p>The <a href="../broker/index.html#broker">broker</a> allows you to route events to different event sinks or consumers.</p>
-<ol>
-<li>
-<p>Add a broker named <code>default</code> to your namespace by entering the following command:</p>
-<pre><code>kubectl create -f - <<EOF
-apiVersion: eventing.knative.dev/v1
-kind: broker
-metadata:
- name: default
- namespace: event-example
-EOF
-</code></pre></li>
-<li>
-<p>Verify that the broker is working correctly, by entering the following command:</p>
-<pre><code>kubectl -n event-example get broker default
-</code></pre><p>This shows information about your broker. If the broker is working correctly, it shows a <code>READY</code> status of <code>True</code>:</p>
-<pre><code>NAME READY REASON URL AGE
-default True http://broker-ingress.knative-eventing.svc.cluster.local/event-example/default 1m
-</code></pre><p>If <code>READY</code> is <code>False</code>, wait a few moments and then run the command again.
-If you continue to receive the <code>False</code> status, see the <a href="../debugging/index.html">Debugging Guide</a> to troubleshoot the issue.</p>
-</li>
-</ol>
-<h2 id="creating-event-consumers">Creating event consumers</h2>
-<p>In this step, you create two event consumers, <code>hello-display</code> and <code>goodbye-display</code>, to
-demonstrate how you can configure your event producers to target a specific consumer.</p>
-<ol>
-<li>
-<p>To deploy the <code>hello-display</code> consumer to your cluster, run the following
-command:</p>
-<pre><code>kubectl -n event-example apply -f - << EOF
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: hello-display
-spec:
- replicas: 1
- selector:
- matchLabels: &labels
- app: hello-display
- template:
- metadata:
- labels: *labels
- spec:
- containers:
- - name: event-display
- image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display
-
----
-
-kind: Service
-apiVersion: v1
-metadata:
- name: hello-display
-spec:
- selector:
- app: hello-display
- ports:
- - protocol: TCP
- port: 80
- targetPort: 8080
-EOF
-</code></pre></li>
-<li>
-<p>To deploy the <code>goodbye-display</code> consumer to your cluster, run the following
-command:</p>
-<pre><code>kubectl -n event-example apply -f - << EOF
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: goodbye-display
-spec:
- replicas: 1
- selector:
- matchLabels: &labels
- app: goodbye-display
- template:
- metadata:
- labels: *labels
- spec:
- containers:
- - name: event-display
- # Source code: https://github.com/knative/eventing-contrib/tree/main/cmd/event_display
- image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display
-
----
-
-kind: Service
-apiVersion: v1
-metadata:
- name: goodbye-display
-spec:
- selector:
- app: goodbye-display
- ports:
- - protocol: TCP
- port: 80
- targetPort: 8080
-EOF
-</code></pre></li>
-<li>
-<p>Verify that the event consumers are working by entering the following command:</p>
-<pre><code>kubectl -n event-example get deployments hello-display goodbye-display
-</code></pre><p>This lists the <code>hello-display</code> and <code>goodbye-display</code> consumers that you
-deployed:</p>
-<pre><code>NAME READY UP-TO-DATE AVAILABLE AGE
-hello-display 1/1 1 1 26s
-goodbye-display 1/1 1 1 16s
-</code></pre><p>The number of replicas in the <strong>READY</strong> column should match the number of replicas in the <strong>AVAILABLE</strong> column.
-If the numbers do not match, see the <a href="../debugging/index.html">Debugging Guide</a> to troubleshoot the issue.</p>
-</li>
-</ol>
-<h2 id="creating-triggers">Creating triggers</h2>
-<p>A <a href="../broker/index.html#trigger">trigger</a> defines the events that each event consumer receives.
-Brokers use triggers to forward events to the correct consumers.
-Each trigger can specify a filter that enables selection of relevant events based on the Cloud Event context attributes.</p>
-<ol>
-<li>
-<p>Create a trigger by entering the following command:</p>
-<pre><code>kubectl -n event-example apply -f - << EOF
-apiVersion: eventing.knative.dev/v1
-kind: Trigger
-metadata:
- name: hello-display
-spec:
- broker: default
- filter:
- attributes:
- type: greeting
- subscriber:
- ref:
- apiVersion: v1
- kind: Service
- name: hello-display
-EOF
-</code></pre><p>The command creates a trigger that sends all events of type <code>greeting</code> to
-your event consumer named <code>hello-display</code>.</p>
-</li>
-<li>
-<p>To add a second trigger, enter the following command:</p>
-<pre><code>kubectl -n event-example apply -f - << EOF
-apiVersion: eventing.knative.dev/v1
-kind: Trigger
-metadata:
- name: goodbye-display
-spec:
- broker: default
- filter:
- attributes:
- source: sendoff
- subscriber:
- ref:
- apiVersion: v1
- kind: Service
- name: goodbye-display
-EOF
-</code></pre><p>The command creates a trigger that sends all events of source <code>sendoff</code> to
-your event consumer named <code>goodbye-display</code>.</p>
-</li>
-<li>
-<p>Verify that the triggers are working correctly by running the following
-command:</p>
-<pre><code>kubectl -n event-example get triggers
-</code></pre><p>This returns the <code>hello-display</code> and <code>goodbye-display</code> triggers that you
-created:</p>
-<pre><code>NAME READY REASON BROKER SUBSCRIBER_URI AGE
-goodbye-display True default http://goodbye-display.event-example.svc.cluster.local/ 9s
-hello-display True default http://hello-display.event-example.svc.cluster.local/ 16s
-</code></pre><p>If the triggers are correctly configured, they will be ready and pointing to the correct broker (<code>default</code>) and <code>SUBSCRIBER_URI</code>.</p>
-<p>The <code>SUBSCRIBER_URI</code> has a value similar to <code>triggerName.namespaceName.svc.cluster.local</code>.
-The exact value depends on the broker implementation.
-If this value looks incorrect, see the <a href="../debugging/index.html">Debugging Guide</a> to troubleshoot the issue.</p>
-</li>
-</ol>
-<h2 id="creating-a-pod-as-an-event-producer">Creating a pod as an event producer</h2>
-<p>This guide uses <code>curl</code> commands to manually send individual events as HTTP requests to the broker, and demonstrate how these events are received by the correct event consumer.</p>
-<p>The broker can only be accessed from within the cluster where Knative Eventing is installed. You must create a pod within that cluster to act as an event producer that will execute the <code>curl</code> commands.</p>
-<p>To create a pod, enter the following command:</p>
-<pre><code>kubectl -n event-example apply -f - << EOF
-apiVersion: v1
-kind: Pod
-metadata:
- labels:
- run: curl
- name: curl
-spec:
- containers:
- # This could be any image that we can SSH into and has curl.
- - image: radial/busyboxplus:curl
- imagePullPolicy: IfNotPresent
- name: curl
- resources: {}
- stdin: true
- terminationMessagePath: /dev/termination-log
- terminationMessagePolicy: File
- tty: true
-EOF
-</code></pre><h2 id="sending-events-to-the-broker">Sending events to the broker</h2>
-<ol>
-<li>
-<p>SSH into the pod by running the following command:</p>
-<pre><code>kubectl -n event-example attach curl -it
-</code></pre><p>You will see a prompt similar to the following:</p>
-<pre><code>Defaulting container name to curl.
-Use 'kubectl describe pod/ -n event-example' to see all of the containers in this pod.
-If you don't see a command prompt, try pressing enter.
-[ root@curl:/ ]$
-</code></pre></li>
-<li>
-<p>Make a HTTP request to the broker. To show the various types of events you can send, you will make three requests:</p>
-<ul>
-<li>
-<p>To make the first request, which creates an event that has the <code>type</code>
-<code>greeting</code>, run the following in the SSH terminal:</p>
-<pre><code>curl -v "http://broker-ingress.knative-eventing.svc.cluster.local/event-example/default" \
- -X POST \
- -H "Ce-Id: say-hello" \
- -H "Ce-Specversion: 1.0" \
- -H "Ce-Type: greeting" \
- -H "Ce-Source: not-sendoff" \
- -H "Content-Type: application/json" \
- -d '{"msg":"Hello Knative!"}'
-</code></pre><p>When the broker receives your event, <code>hello-display</code> will activate and send
-it to the event consumer of the same name.
-If the event has been received, you will receive a <code>202 Accepted</code> response
-similar to the one below:</p>
-<pre><code>< HTTP/1.1 202 Accepted
-< Content-Length: 0
-< Date: Mon, 12 Aug 2019 19:48:18 GMT
-</code></pre></li>
-<li>
-<p>To make the second request, which creates an event that has the <code>source</code>
-<code>sendoff</code>, run the following in the SSH terminal:</p>
-<pre><code>curl -v "http://broker-ingress.knative-eventing.svc.cluster.local/event-example/default" \
- -X POST \
- -H "Ce-Id: say-goodbye" \
- -H "Ce-Specversion: 1.0" \
- -H "Ce-Type: not-greeting" \
- -H "Ce-Source: sendoff" \
- -H "Content-Type: application/json" \
- -d '{"msg":"Goodbye Knative!"}'
-</code></pre><p>When the broker receives your event, <code>goodbye-display</code> will activate and
-send the event to the event consumer of the same name.
-If the event has been received, you will receive a <code>202 Accepted</code> response
-similar to the one below:</p>
-<pre><code>< HTTP/1.1 202 Accepted
-< Content-Length: 0
-< Date: Mon, 12 Aug 2019 19:48:18 GMT
-</code></pre></li>
-<li>
-<p>To make the third request, which creates an event that has the <code>type</code>
-<code>greeting</code> and the<code>source</code> <code>sendoff</code>, run the following in the SSH terminal:</p>
-<pre><code>curl -v "http://broker-ingress.knative-eventing.svc.cluster.local/event-example/default" \
- -X POST \
- -H "Ce-Id: say-hello-goodbye" \
- -H "Ce-Specversion: 1.0" \
- -H "Ce-Type: greeting" \
- -H "Ce-Source: sendoff" \
- -H "Content-Type: application/json" \
- -d '{"msg":"Hello Knative! Goodbye Knative!"}'
-</code></pre><p>When the broker receives your event, <code>hello-display</code> and <code>goodbye-display</code>
-will activate and send the event to the event consumers of the same name.
-If the event has been received, you will receive a <code>202 Accepted</code> response
-similar to the one below:</p>
-<pre><code>< HTTP/1.1 202 Accepted
-< Content-Length: 0
-< Date: Mon, 12 Aug 2019 19:48:18 GMT
-</code></pre></li>
-</ul>
-</li>
-<li>
-<p>Exit SSH by typing <code>exit</code> into the command prompt.</p>
-</li>
-</ol>
-<p>You have sent two events to the <code>hello-display</code> event consumer and two events to
-the <code>goodbye-display</code> event consumer (note that <code>say-hello-goodbye</code> activates
-the trigger conditions for <em>both</em> <code>hello-display</code> and <code>goodbye-display</code>). You
-will verify that these events were received correctly in the next section.</p>
-<h2 id="verifying-that-events-were-received">Verifying that events were received</h2>
-<p>After you send the events, verify that the events were received by the correct subscribers.</p>
-<ol>
-<li>Look at the logs for the <code>hello-display</code> event consumer by entering the
-following command:
-<pre><code>kubectl -n event-example logs -l app=hello-display --tail=100
-</code></pre><p>This returns the <code>Attributes</code> and <code>Data</code> of the events you sent to
-<code>hello-display</code>:</p>
-<pre><code>☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: greeting
- source: not-sendoff
- id: say-hello
- time: 2019-05-20T17:59:43.81718488Z
- contenttype: application/json
-Extensions,
- knativehistory: default-broker-srk54-channel-24gls.event-example.svc.cluster.local
-Data,
- {
- "msg": "Hello Knative!"
- }
-☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: greeting
- source: sendoff
- id: say-hello-goodbye
- time: 2019-05-20T17:59:54.211866425Z
- contenttype: application/json
-Extensions,
- knativehistory: default-broker-srk54-channel-24gls.event-example.svc.cluster.local
-Data,
- {
- "msg": "Hello Knative! Goodbye Knative!"
- }
-</code></pre></li>
-<li>Look at the logs for the <code>goodbye-display</code> event consumer by entering the
-following command:
-<pre><code>kubectl -n event-example logs -l app=goodbye-display --tail=100
-</code></pre><p>This returns the <code>Attributes</code> and <code>Data</code> of the events you sent to
-<code>goodbye-display</code>:</p>
-<pre><code>☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: not-greeting
- source: sendoff
- id: say-goodbye
- time: 2019-05-20T17:59:49.044926148Z
- contenttype: application/json
- Extensions,
- knativehistory: default-broker-srk54-channel-24gls.event-example.svc.cluster.local
-Data,
- {
- "msg": "Goodbye Knative!"
- }
- ☁️ cloudevents.Event
- Validation: valid
- Context Attributes,
- specversion: 1.0
- type: greeting
- source: sendoff
- id: say-hello-goodbye
- time: 2019-05-20T17:59:54.211866425Z
- contenttype: application/json
- Extensions,
- knativehistory: default-broker-srk54-channel-24gls.event-example.svc.cluster.local
- Data,
- {
- "msg": "Hello Knative! Goodbye Knative!"
- }
-</code></pre></li>
-</ol>
-<h2 id="cleaning-up-example-resources">Cleaning up example resources</h2>
-<p>You can delete the <code>event-example</code> namespace and its associated resources from your cluster if you do not plan to use it again in the future.</p>
-<p>Delete the <code>event-example</code> namespace and all of its resources from your cluster by entering the following command:</p>
-<pre><code>kubectl delete namespace event-example
-</code></pre>
-
-
-
-
- V0.22-Docs: Event sources
- https://knative.dev/v0.22-docs/eventing/sources/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/sources/
-
-
-
- <p>An event source is a Kubernetes custom resource (CR), created by a developer or cluster administrator, that acts as a link between an event producer and an event <em>sink</em>.
-A sink can be a k8s service, including Knative Services, a Channel, or a Broker that receives events from an event source.</p>
-<p>Event sources are created by instantiating a CR from a Source object.
-The Source object defines the arguments and parameters needed to instantiate a CR.</p>
-<p>All Sources are part of the <code>sources</code> category.</p>
-
-
-
-
-
-<ul class="nav nav-tabs" id="list-event-sources" role="tablist">
-
-
-
-
-
-
- <li class="nav-item active">
- <a class="nav-link active" id="list-event-sources-0-tab" data-toggle="tab" href="#list-event-sources-0" role="tab" aria-controls="list-event-sources-0" aria-selected="true">kubectl</a>
- </li>
-
-
-
-
- <li class="nav-item ">
- <a class="nav-link " id="list-event-sources-1-tab" data-toggle="tab" href="#list-event-sources-1" role="tab" aria-controls="list-event-sources-1" aria-selected="true">kn</a>
- </li>
-
-</ul>
-
-<div class="tab-content" >
-
-
-
-
-
-
- <div class="tab-pane fade show active" id="list-event-sources-0" role="tabpanel" aria-labelledby="list-event-sources-0-tab">
-
- <p>You can list existing event sources on your cluster by entering the command:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl get sources
-</code></pre></div>
-
- </div>
-
-
-
-
- <div class="tab-pane fade " id="list-event-sources-1" role="tabpanel" aria-labelledby="list-event-sources-1-tab">
-
- <p>You can list existing event sources on your cluster by entering the kn command:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kn <span style="color:#204a87">source</span> list
-</code></pre></div>
-
- </div>
-
-</div>
-
-<h2 id="knative-sources">Knative Sources</h2>
-<table>
-<thead>
-<tr>
-<th>Name</th>
-<th>API Version</th>
-<th>Maintainer</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td><a href="./apiserversource">APIServerSource</a></td>
-<td>v1</td>
-<td>Knative</td>
-<td>Brings Kubernetes API server events into Knative. The APIServerSource fires a new event each time a Kubernetes resource is created, updated or deleted.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/knative-sandbox/eventing-awssqs/tree/main/samples">AWS SQS</a></td>
-<td>v1alpha1</td>
-<td>Knative</td>
-<td>Brings <a href="https://aws.amazon.com/sqs/">AWS Simple Queue Service</a> messages into Knative. The AwsSqsSource fires a new event each time an event is published on an <a href="https://aws.amazon.com/sqs/">AWS SQS topic</a>.</td>
-</tr>
-<tr>
-<td><a href="../samples/apache-camel-source">Apache Camel</a></td>
-<td>v1alpha1</td>
-<td>Knative</td>
-<td>Enables use of <a href="https://github.com/apache/camel">Apache Camel</a> components for pushing events into Knative. A CamelSource is an event source that can represent any existing <a href="https://github.com/apache/camel/tree/master/components">Apache Camel component</a>, that provides a consumer side, and enables publishing events to an addressable endpoint. Each Camel endpoint has the form of a URI where the scheme is the ID of the component to use. CamelSource requires <a href="https://github.com/apache/camel-k#installation">Camel-K</a> to be installed into the current namespace. See the <a href="https://github.com/knative-sandbox/eventing-camel/tree/master/samples">CamelSource</a> example.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/knative-sandbox/eventing-couchdb/blob/master/source">Apache CouchDB</a></td>
-<td>v1alpha1</td>
-<td>Knative</td>
-<td>Brings <a href="https://couchdb.apache.org/">Apache CouchDB</a> messages into Knative.</td>
-</tr>
-<tr>
-<td><a href="../samples/kafka">Apache Kafka</a></td>
-<td>v1beta1</td>
-<td>Knative</td>
-<td>Brings <a href="https://kafka.apache.org/">Apache Kafka</a> messages into Knative. The KafkaSource reads events from an Apache Kafka Cluster, and passes these events to a sink so that they can be consumed. See the <a href="https://github.com/knative-sandbox/eventing-kafka/blob/master/pkg/source">Kafka Source</a> example for more details.</td>
-</tr>
-<tr>
-<td><a href="./containersource">Container Source</a></td>
-<td>v1</td>
-<td>Knative</td>
-<td>The ContainerSource will instantiate container image(s) that can generate events until the ContainerSource is deleted. This may be used, for example, to poll an FTP server for new files or generate events at a set time interval. Given a <code>spec.template</code> with at least a container image specified, ContainerSource will keep a <code>Pod</code> running with the specified image(s). <code>K_SINK</code> (destination address) and <code>KE_CE_OVERRIDES</code> (JSON CloudEvents attributes) environment variables are injected into the running image(s). It is used by multiple other Sources as underlying infrastructure. Refer to the <a href="../samples/container-source">Container Source</a> example for more details.</td>
-</tr>
-<tr>
-<td><a href="../samples/github-source">GitHub</a></td>
-<td>v1alpha1</td>
-<td>Knative</td>
-<td>Registers for events of the specified types on the specified GitHub organization or repository, and brings those events into Knative. The GitHubSource fires a new event for selected <a href="https://developer.github.com/v3/activity/events/types/">GitHub event types</a>. See the <a href="../samples/github-source">GitHub Source</a> example for more details.</td>
-</tr>
-<tr>
-<td><a href="../samples/gitlab-source">GitLab</a></td>
-<td>v1alpha1</td>
-<td>Knative</td>
-<td>Registers for events of the specified types on the specified GitLab repository, and brings those events into Knative. The GitLabSource creates a webhooks for specified <a href="https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#events">event types</a>, listens for incoming events, and passes them to a consumer. See the <a href="../samples/gitlab-source">GitLab Source</a> example for more details.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/knative/eventing-contrib/tree/master/cmd/heartbeats">Heartbeats</a></td>
-<td>N/A</td>
-<td>Knative</td>
-<td>Uses an in-memory timer to produce events at the specified interval.</td>
-</tr>
-<tr>
-<td><a href="./pingsource">PingSource</a></td>
-<td>v1beta2</td>
-<td>Knative</td>
-<td>Produces events with a fixed payload on a specified <a href="https://en.wikipedia.org/wiki/Cron">Cron</a> schedule. See the <a href="../samples/ping-source">Ping Source</a> example for more details.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/knative-sandbox/eventing-rabbitmq">RabbitMQ</a></td>
-<td>Active development</td>
-<td>None</td>
-<td>Brings <a href="https://www.rabbitmq.com/">RabbitMQ</a> messages into Knative.</td>
-</tr>
-<tr>
-<td><a href="./sinkbinding/">SinkBinding</a></td>
-<td>v1</td>
-<td>Knative</td>
-<td>The SinkBinding can be used to author new event sources using any of the familiar compute abstractions that Kubernetes makes available (e.g. Deployment, Job, DaemonSet, StatefulSet), or Knative abstractions (e.g. Service, Configuration). SinkBinding provides a framework for injecting <code>K_SINK</code> (destination address) and <code>K_CE_OVERRIDES</code> (JSON cloudevents attributes) environment variables into any Kubernetes resource which has a <code>spec.template</code> that looks like a Pod (aka PodSpecable). See the <a href="../samples/container-source">SinkBinding</a> example for more details.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/knative/eventing-contrib/tree/main/cmd/websocketsource">WebSocket</a></td>
-<td>N/A</td>
-<td>Knative</td>
-<td>Opens a WebSocket to the specified source and packages each received message as a Knative event.</td>
-</tr>
-</tbody>
-</table>
-<h2 id="third-party-sources">Third-Party Sources</h2>
-<table>
-<thead>
-<tr>
-<th>Name</th>
-<th>API Version</th>
-<th>Maintainer</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td><a href="https://github.com/Harwayne/auto-container-source">Auto Container Source</a></td>
-<td>Proof of Concept</td>
-<td>None</td>
-<td>AutoContainerSource is a controller that allows the Source CRDs <em>without</em> needing a controller. It notices CRDs with a specific label and starts controlling resources of that type. It utilizes Container Source as underlying infrastructure.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/triggermesh/aws-event-sources/tree/master/cmd/awscloudwatchsource">Amazon CloudWatch</a></td>
-<td>Supported</td>
-<td>TriggerMesh</td>
-<td>Collects metrics from <a href="https://aws.amazon.com/cloudwatch/">Amazon CloudWatch</a>.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/triggermesh/aws-event-sources/tree/master/cmd/awscloudwatchlogssource">Amazon CloudWatch Logs</a></td>
-<td>Supported</td>
-<td>TriggerMesh</td>
-<td>Subscribes to log events from an <a href="https://aws.amazon.com/cloudwatch/">Amazon CloudWatch Logs</a> stream.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/triggermesh/aws-event-sources/blob/master/cmd/awscodecommitsource/README.md">Amazon CodeCommit</a></td>
-<td>Supported</td>
-<td>TriggerMesh</td>
-<td>Registers for events emitted by an <a href="https://aws.amazon.com/codecommit/">Amazon CodeCommit</a> source code repository.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/triggermesh/aws-event-sources/tree/master/cmd/awscognitoidentitysource/README.md">Amazon Cognito Identity</a></td>
-<td>Supported</td>
-<td>TriggerMesh</td>
-<td>Registers for events from <a href="https://aws.amazon.com/cognito/">Amazon Cognito</a> identity pools.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/triggermesh/aws-event-sources/tree/master/cmd/awscognitouserpoolsource/README.md">Amazon Cognito User</a></td>
-<td>Supported</td>
-<td>TriggerMesh</td>
-<td>Registers for events from <a href="https://aws.amazon.com/cognito/">Amazon Cognito</a> user pools.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/triggermesh/aws-event-sources/blob/master/cmd/awsdynamodbsource/README.md">Amazon DynamoDB</a></td>
-<td>Supported</td>
-<td>TriggerMesh</td>
-<td>Reads records from an <a href="https://aws.amazon.com/dynamodb/">Amazon DynamoDB</a> stream.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/triggermesh/aws-event-sources/tree/master/cmd/awskinesissource/README.md">Amazon Kinesis</a></td>
-<td>Supported</td>
-<td>TriggerMesh</td>
-<td>Reads records from an <a href="https://aws.amazon.com/kinesis/">Amazon Kinesis</a> stream.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/triggermesh/aws-event-sources/tree/master/cmd/awssnssource/README.md">Amazon SNS</a></td>
-<td>Supported</td>
-<td>TriggerMesh</td>
-<td>Subscribes to messages from an <a href="https://aws.amazon.com/sns/">Amazon SNS</a> topic.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/triggermesh/aws-event-sources/tree/master/cmd/awssqssource/README.md">Amazon SQS</a></td>
-<td>Supported</td>
-<td>TriggerMesh</td>
-<td>Consumes messages from an <a href="https://aws.amazon.com/sqs/">Amazon SQS</a> queue.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/nachocano/bitbucket-source">BitBucket</a></td>
-<td>Proof of Concept</td>
-<td>None</td>
-<td>Registers for events of the specified types on the specified BitBucket organization/repository. Brings those events into Knative.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/google/knative-gcp/blob/master/docs/examples/cloudauditlogssource/README.md">CloudAuditLogsSource</a></td>
-<td>v1</td>
-<td>Google</td>
-<td>Registers for events of the specified types on the specified <a href="https://cloud.google.com/logging/docs/audit/">Google Cloud Audit Logs</a>. Brings those events into Knative. Refer to the <a href="../samples/cloud-audit-logs-source">CloudAuditLogsSource</a> example for more details.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/google/knative-gcp/blob/master/docs/examples/cloudpubsubsource/README.md">CloudPubSubSource</a></td>
-<td>v1</td>
-<td>Google</td>
-<td>Brings <a href="https://cloud.google.com/pubsub/">Cloud Pub/Sub</a> messages into Knative. The CloudPubSubSource fires a new event each time a message is published on a <a href="https://cloud.google.com/pubsub/">Google Cloud Platform PubSub topic</a>. See the <a href="../samples/cloud-pubsub-source">CloudPubSubSource</a> example for more details.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/google/knative-gcp/blob/master/docs/examples/cloudschedulersource/README.md">CloudSchedulerSource</a></td>
-<td>v1</td>
-<td>Google</td>
-<td>Create, update, and delete <a href="https://cloud.google.com/scheduler/">Google Cloud Scheduler</a> Jobs. When those jobs are triggered, receive the event inside Knative. See the <a href="../samples/cloud-scheduler-source">CloudSchedulerSource</a> example for further details.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/google/knative-gcp/blob/master/docs/examples/cloudstoragesource/README.md">CloudStorageSource</a></td>
-<td>v1</td>
-<td>Google</td>
-<td>Registers for events of the specified types on the specified <a href="https://cloud.google.com/storage/">Google Cloud Storage</a> bucket and optional object prefix. Brings those events into Knative. See the <a href="../samples/cloud-storage-source">CloudStorageSource</a> example.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/tom24d/eventing-dockerhub">DockerHubSource</a></td>
-<td>v1alpha1</td>
-<td>None</td>
-<td>Retrieves events from <a href="https://docs.docker.com/docker-hub/webhooks/">Docker Hub Webhooks</a> and transforms them into CloudEvents for consumption in Knative.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/vaikas-google/ftp">FTP / SFTP</a></td>
-<td>Proof of concept</td>
-<td>None</td>
-<td>Watches for files being uploaded into a FTP/SFTP and generates events for those.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/Harwayne/auto-container-source/tree/master/heartbeat-source">Heartbeat</a></td>
-<td>Proof of Concept</td>
-<td>None</td>
-<td>Uses an in-memory timer to produce events as the specified interval. Uses AutoContainerSource for underlying infrastructure.</td>
-</tr>
-<tr>
-<td><a href="https://konnek.github.io/docs/#/">Konnek</a></td>
-<td>Active Development</td>
-<td>None</td>
-<td>Retrieves events from cloud platforms (like AWS and GCP) and transforms them into CloudEvents for consumption in Knative.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/Harwayne/auto-container-source/tree/master/k8s-event-source">K8s</a></td>
-<td>Proof of Concept</td>
-<td>None</td>
-<td>Brings Kubernetes cluster events into Knative. Uses AutoContainerSource for underlying infrastructure.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/lionelvillard/eventing-redis/tree/master/source">RedisSource</a></td>
-<td>v1alpha1</td>
-<td>None</td>
-<td>Brings Redis Stream into Knative.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/triggermesh/knative-sources">Slack</a></td>
-<td>v1alpha1</td>
-<td>TriggerMesh</td>
-<td>Subscribes to events from Slack.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/vmware-tanzu/sources-for-knative/blob/master/README.md">VMware</a></td>
-<td>Active Development</td>
-<td>None</td>
-<td>Brings <a href="https://www.vmware.com/products/vsphere.html">vSphere</a> events into Knative.</td>
-</tr>
-<tr>
-<td><a href="https://github.com/triggermesh/knative-sources">Zendesk</a></td>
-<td>v1alpha1</td>
-<td>TriggerMesh</td>
-<td>Subscribes to events from Zendesk.</td>
-</tr>
-</tbody>
-</table>
-<h2 id="additional-resources">Additional resources</h2>
-<ul>
-<li>For information about creating your own Source type, see the <a href="../samples/writing-event-source">tutorial on writing a Source with a Receive Adapter</a>.</li>
-<li>If your code needs to send events as part of its business logic and doesn’t fit the model of a Source, consider <a href="https://knative.dev/docs/eventing/broker/">feeding events directly to a Broker</a>.</li>
-<li>For more information about using <code>kn</code> Source related commands, see the <a href="https://github.com/knative/client/blob/main/docs/cmd/kn_source.md"><code>kn source</code> reference documentation</a>.</li>
-</ul>
-
-
-
-
-
- V0.22-Docs: Event registry
- https://knative.dev/v0.22-docs/eventing/event-registry/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/event-registry/
-
-
-
- <h2 id="overview">Overview</h2>
-<p>The event registry maintains a catalog of event types that can be consumed
-from different brokers. It introduces the EventType custom resource in order to persist the event
-type information in the cluster data store.</p>
-<h2 id="before-you-begin">Before you begin</h2>
-<ol>
-<li>Read about the <a href="../broker/">broker</a> and <a href="../triggers/">trigger</a> objects.</li>
-<li>Be familiar with the
-<a href="https://github.com/cloudevents/spec/blob/master/spec.md">CloudEvents spec</a>,
-particularly the
-<a href="https://github.com/cloudevents/spec/blob/master/spec.md#context-attributes">Context Attributes</a>
-section.</li>
-<li>Be familiar with <a href="../sources">event sources</a>.</li>
-</ol>
-<h2 id="discovering-events-with-the-registry">Discovering events with the registry</h2>
-<p>Using the registry, you can discover different types of events that can be consumed by broker event meshes. The registry is designed for use with
-the broker and trigger model, and aims to help you create triggers.</p>
-<p>To see event types in the registry that are available to subscribe to, enter the following command:</p>
-<pre><code>kubectl get eventtypes -n <namespace>
-</code></pre><p>Below, we show an example output of executing the above command using the
-<code>default</code> namespace in a testing cluster. We will address the question of how
-this registry was populated in a later section.</p>
-<pre><code>NAME TYPE SOURCE SCHEMA BROKER DESCRIPTION READY REASON
-dev.knative.source.github.push-34cnb dev.knative.source.github.push https://github.com/knative/eventing default True
-dev.knative.source.github.push-44svn dev.knative.source.github.push https://github.com/knative/serving default True
-dev.knative.source.github.pullrequest-86jhv dev.knative.source.github.pull_request https://github.com/knative/eventing default True
-dev.knative.source.github.pullrequest-97shf dev.knative.source.github.pull_request https://github.com/knative/serving default True
-dev.knative.kafka.event-cjvcr dev.knative.kafka.event /apis/v1/namespaces/default/kafkasources/kafka-sample#news default True
-dev.knative.kafka.event-tdt48 dev.knative.kafka.event /apis/v1/namespaces/default/kafkasources/kafka-sample#knative-demo default True
-google.pubsub.topic.publish-hrxhh google.pubsub.topic.publish //pubsub.googleapis.com/knative/topics/testing dev False BrokerIsNotReady
-</code></pre><p><strong>NOTE:</strong> This assumes that the event sources emitting the events reference a broker as their sink.</p>
-<p>There are seven different EventType objects in the registry of the
-<code>default</code> namespace.</p>
-<p>Use the following command to see an example of what the YAML for an EventType object looks like:</p>
-<pre><code>kubectl get eventtype dev.knative.source.github.push-34cnb -o yaml
-</code></pre><p>Omitting irrelevant fields:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">EventType</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">dev.knative.source.github.push-34cnb</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">eventing.knative.dev/sourceName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">github-sample</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">dev.knative.source.github.push</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">source</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">https://github.com/knative/eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">schema</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">description</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">broker</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">status</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">conditions</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">status</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"True"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">BrokerExists</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">status</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"True"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">BrokerReady</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">status</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"True"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Ready</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>From a consumer standpoint, the fields that matter the most are the <code>spec</code>
-fields as well as the <code>status</code>.</p>
-<p>The <code>name</code> is advisory (i.e., non-authoritative), and we typically generate it
-(<code>generateName</code>) to avoid naming collisions (e.g., two EventTypes listening to
-pull requests on two different Github repositories). As <code>name</code> nor
-<code>generateName</code> are needed for consumers to create Triggers, we defer their
-discussion for later on.</p>
-<p>Regarding <code>status</code>, its main purpose it to tell consumers (or cluster operators)
-whether the EventType is ready for consumption or not. That <em>readiness</em> is based
-on the Broker being ready. We can see from the example output that the PubSub
-EventType is not ready, as its <code>dev</code> Broker isn’t.</p>
-<p>Let’s talk in more details about the <code>spec</code> fields:</p>
-<ul>
-<li>
-<p><code>type</code>: is authoritative. This refers to the CloudEvent type as it enters into
-the event mesh. It is mandatory. Event consumers can (and in most cases would)
-create Triggers filtering on this attribute.</p>
-</li>
-<li>
-<p><code>source</code>: refers to the CloudEvent source as it enters into the event mesh. It
-is mandatory. Event consumers can (and in most cases would) create Triggers
-filtering on this attribute.</p>
-</li>
-<li>
-<p><code>schema</code>: is a valid URI with the EventType schema. It may be a JSON schema, a
-protobuf schema, etc. It is optional.</p>
-</li>
-<li>
-<p><code>description</code>: is a string describing what the EventType is about. It is
-optional.</p>
-</li>
-<li>
-<p><code>broker</code> refers to the Broker that can provide the EventType. It is mandatory.</p>
-</li>
-</ul>
-<h2 id="subscribing-to-events">Subscribing to events</h2>
-<p>Now that you know what events can be consumed from the Brokers' event meshes,
-you can create Triggers to subscribe to particular events.</p>
-<p>Here are a few example Triggers that subscribe to events using exact matching on
-<code>type</code> and/or <code>source</code>, based on the above registry output:</p>
-<ol>
-<li>
-<p>Subscribes to GitHub <em>pushes</em> from any source.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Trigger</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">push-trigger</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">broker</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">filter</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">attributes</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">dev.knative.source.github.push</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">subscriber</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">push-service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>As per the registry output above, only two sources exist for that particular
-type of event (<em>knative’s eventing and serving</em> repositories). If later on
-new sources are registered for GitHub pushes, this trigger will be able to
-consume them.</p>
-</li>
-<li>
-<p>Subscribes to GitHub <em>pull requests</em> from <em>knative’s eventing</em> repository.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Trigger</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gh-knative-eventing-pull-trigger</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">broker</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">filter</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">attributes</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">dev.knative.source.github.pull_request</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">source</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">https://github.com/knative/eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">subscriber</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gh-knative-eventing-pull-service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>
-<p>Subscribes to Kafka messages sent to the <em>knative-demo</em> topic</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Trigger</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-knative-demo-trigger</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">broker</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">filter</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">attributes</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">dev.knative.kafka.event</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">source</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">/apis/v1/namespaces/default/kafkasources/kafka-sample#knative-demo</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">subscriber</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-knative-demo-service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>
-<p>Subscribes to PubSub messages from GCP’s <em>knative</em> project sent to the
-<em>testing</em> topic</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Trigger</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcp-pubsub-knative-testing-trigger</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">broker</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">dev</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">filter</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">attributes</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">source</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">//pubsub.googleapis.com/knative/topics/testing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">subscriber</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcp-pubsub-knative-testing-service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Note that events won’t be able to be consumed by this Trigger’s subscriber
-until the Broker becomes ready.</p>
-</li>
-</ol>
-<h2 id="populating-the-registry">Populating the registry</h2>
-<p>Now that we know how to discover events using the registry and how we can
-leverage that information to subscribe to events of interest, let’s move on to
-the next topic: How do we actually populate the registry in the first place?</p>
-<ul>
-<li>
-<p>Manual Registration</p>
-<p>In order to populate the registry, a cluster configurator can manually
-register the EventTypes. This means that the configurator can simply apply
-EventTypes yaml files, just as with any other Kubernetes resource:</p>
-<p><code>kubectl apply -f <event_type.yaml></code></p>
-</li>
-<li>
-<p>Automatic Registration</p>
-<p>As Manual Registration might be tedious and error-prone, we also support
-automatic registration of EventTypes. The creation of the EventTypes is done
-upon instantiation of an Event Source. We currently support automatic
-registration of EventTypes for the following Event Sources:</p>
-<ul>
-<li>CronJobSource</li>
-<li>ApiServerSource</li>
-<li>GithubSource</li>
-<li>GcpPubSubSource</li>
-<li>KafkaSource</li>
-<li>AwsSqsSource</li>
-</ul>
-<p>Let’s look at an example, in particular, the KafkaSource sample we used to
-populate the registry in our testing cluster. Below is what the yaml looks
-like.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sources.knative.dev/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KafkaSource</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-sample</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">bootstrapServers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">my-cluster-kafka-bootstrap.kafka:9092</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">topics</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">knative-demo</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">news</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Broker</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>If you are interested in more information regarding configuration options of a
-KafkaSource, please refer to the
-<a href="../samples/kafka/">KafKaSource sample</a>.</p>
-<p>For this discussion, the relevant information from the yaml above are the
-<code>sink</code> and the <code>topics</code>. We observe that the <code>sink</code> is of kind <code>Broker</code>. We
-currently only support automatic creation of EventTypes for Sources instances
-that point to Brokers. Regarding <code>topics</code>, this is what we use to generate the
-EventTypes <code>source</code> field, which is equal to the CloudEvent source attribute.</p>
-<p>When you <code>kubectl apply</code> this yaml, the KafkaSource <code>kafka-source-sample</code> will
-be instantiated, and two EventTypes will be added to the registry (as there
-are two topics). You can see that in the registry example output from the
-previous sections.</p>
-</li>
-</ul>
-<h2 id="whats-next">What’s next</h2>
-<p>To get started, install Knative Eventing if you haven’t yet, and try
-experimenting with different Event Sources in your Knative cluster.</p>
-<ol>
-<li><a href="../../install/index.html">Installing Knative</a> in case you haven’t already done
-so.</li>
-<li><a href="../index.html">Getting started with eventing</a> in case you haven’t read it.</li>
-<li><a href="../samples/">Knative code samples</a> is a useful resource to better understand
-some of the Event Sources (remember to point them to a Broker if you want
-automatic registration of EventTypes in the registry).</li>
-</ol>
-
-
-
-
-
- V0.22-Docs: Eventing Flows
- https://knative.dev/v0.22-docs/eventing/flows/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/flows/
-
-
-
- <p>Knative Eventing provides a collection of <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/">CRDs</a>
-for describing event flows:</p>
-<ul>
-<li><a href="./sequence">Sequence</a> is for defining an in-order list of functions.</li>
-<li><a href="./parallel">Parallel</a> is for defining a list of branches, each receiving the same CloudEvent.</li>
-</ul>
-
-
-
-
-
- V0.22-Docs: Channels
- https://knative.dev/v0.22-docs/eventing/channels/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/channels/
-
-
-
- <p>Channels are Kubernetes <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/">custom resources</a> that define a single event forwarding and persistence layer.</p>
-<p>A channel provides an event delivery mechanism that can fan-out received events, through subscriptions, to multiple destinations, or sinks. Examples of sinks include brokers and Knative services.</p>
-<img src="images/channel-workflow.png" width="80%">
-<h2 id="next-steps">Next steps</h2>
-<ul>
-<li>Learn about <a href="channel-types-defaults">default available channel types</a></li>
-<li>Create a <a href="./create-default-channel">channel</a></li>
-<li>Create a <a href="./subscriptions">subscription</a></li>
-</ul>
-
-
-
-
-
- V0.22-Docs: Knative Eventing Sugar Controller
- https://knative.dev/v0.22-docs/eventing/sugar/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/sugar/
-
-
-
- <p>Knative Eventing Sugar Controller will react to special labels and annotations
-to produce or control eventing resources in a cluster or namespace. This allows
-cluster operators and developers to focus on creating fewer resources, and the
-underlying eventing infrastructure is created on-demand, and cleaned up when no
-longer needed.</p>
-<h2 id="installing">Installing</h2>
-<p>The following command installs the Eventing Sugar Controller:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply --filename https://github.com/knative/eventing/releases/download/v0.22.0/eventing-sugar-controller.yaml
-</code></pre></div><h2 id="automatic-broker-creation">Automatic Broker Creation</h2>
-<p>One way to create a Broker is to manually apply a resource to a cluster using
-the default settings:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create -f - <span style="color:#4e9a06"><<EOF
-</span><span style="color:#4e9a06">apiVersion: eventing.knative.dev/v1
-</span><span style="color:#4e9a06">kind: Broker
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: default
-</span><span style="color:#4e9a06"> namespace: default
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div><p>There might be cases where automated Broker creation is desirable, such as on
-namespace creation, or on Trigger creation. The Sugar controller enables those
-use-cases:</p>
-<ul>
-<li>When a Namespace is labeled with <code>eventing.knative.dev/injection=enabled</code>, the
-sugar controller will create a default Broker named “default” in that
-namespace.</li>
-<li>When a Trigger is annotated with <code>eventing.knative.dev/injection=enabled</code>, the
-controller will create a Broker named by that Trigger in the Trigger’s
-Namespace.</li>
-</ul>
-<p>When a Broker is deleted and the above labels or annotations are in-use, the
-Sugar Controller will automatically recreate a default Broker.</p>
-<h3 id="namespace-examples">Namespace Examples</h3>
-<p>Creating a “default” Broker when creating a Namespace:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply -f - <span style="color:#4e9a06"><<EOF
-</span><span style="color:#4e9a06">apiVersion: v1
-</span><span style="color:#4e9a06">kind: Namespace
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: example
-</span><span style="color:#4e9a06"> labels:
-</span><span style="color:#4e9a06"> eventing.knative.dev/injection: enabled
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div><p>To automatically create a Broker after a namespace exists, label the Namespace:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl label namespace default eventing.knative.dev/injection<span style="color:#ce5c00;font-weight:bold">=</span>enabled
-</code></pre></div><p>If the Broker named “default” already exists in the Namespace, the Sugar
-Controller will do nothing.</p>
-<h3 id="trigger-examples">Trigger Examples</h3>
-<p>Create a Broker named by a Trigger (<code>spec.broker</code>) in the Trigger’s Namespace:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply -f - <span style="color:#4e9a06"><< EOF
-</span><span style="color:#4e9a06">apiVersion: eventing.knative.dev/v1
-</span><span style="color:#4e9a06">kind: Trigger
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: hello-sugar
-</span><span style="color:#4e9a06"> namespace: hello
-</span><span style="color:#4e9a06"> annotations:
-</span><span style="color:#4e9a06"> eventing.knative.dev/injection: enabled
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> broker: sugar
-</span><span style="color:#4e9a06"> subscriber:
-</span><span style="color:#4e9a06"> ref:
-</span><span style="color:#4e9a06"> apiVersion: v1
-</span><span style="color:#4e9a06"> kind: Service
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div><blockquote>
-<p><em>Note</em>: If the named Broker already exists, the Sugar controller will do
-nothing, and the Trigger will not own the existing Broker.</p>
-</blockquote>
-<p>This will make a Broker called “sugar” in the Namespace “hello”, and attempt to
-send events to the “event-display” service.</p>
-<p>If the Broker of the given name already exists in the Namespace, the Sugar
-Controller will do nothing.</p>
-
-
-
-
-
- V0.22-Docs: Event delivery
- https://knative.dev/v0.22-docs/eventing/event-delivery/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/event-delivery/
-
-
-
- <h2 id="overview">Overview</h2>
-<p>Knative Eventing provides various configuration parameters to control the delivery
-of events in case of failure. For instance, you can decide to retry sending events
-that failed to be consumed, and if this didn’t work you can decide to forward those
-events to a dead letter sink.</p>
-<h2 id="configuring-subscription-delivery">Configuring Subscription Delivery</h2>
-<p>Knative Eventing offers fine-grained control on how events are delivered for each subscription by adding a <code>delivery</code> section. Consider this example:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">messaging.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Subscription</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">with-dead-letter-sink</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">channel</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">messaging.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">InMemoryChannel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">delivery</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">deadLetterSink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">error-handler</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">subscriber</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">uri</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">http://doesnotexist.default.svc.cluster.local</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>The <code>deadLetterSink</code> specifies where to send events that failed be consumed by <code>subscriber</code>.</p>
-<h2 id="configuring-broker-delivery">Configuring Broker Delivery</h2>
-<p>Knative Eventing offers fine-grained control on how events are delivered for each broker by adding a <code>delivery</code> section. Consider this example:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">messaging.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Subscription</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">with-dead-letter-sink</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">channel</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">messaging.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">InMemoryChannel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">delivery</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">retry</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">5</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">backoffPolicy</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">exponential</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># or linear</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">backoffDelay</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"PT0.5S"</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># or ISO8601 duration</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">deadLetterSink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">error-handler</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">subscriber</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">uri</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">http://doesnotexist.default.svc.cluster.local</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>The Broker will retry sending events 5 times with a backoff delay of 500 milliseconds
-and exponential backoff policy.</p>
-<p>The <code>deadLetterSink</code> specifies where to send events that failed to be consumed by <code>subscriber</code>
-after the specified number of retries.</p>
-<h2 id="common-delivery-parameters">Common Delivery Parameters</h2>
-<p>The <code>delivery</code> value must be a Delivery Spec, which is a partial schema that is embedded in resources like <code>Broker</code>, <code>Trigger</code> and <code>Subscription</code>.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># DeadLetterSink is the sink receiving event that could not be sent to</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># a destination.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">deadLetterSink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">uri</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">/my-path</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># Retry is the minimum number of retries the sender should attempt when</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># sending an event before moving it to the dead letter sink.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">retry</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">5</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">// BackoffPolicy is the retry backoff policy (linear, exponential).</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">backoffPolicy</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">exponential</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># BackoffDelay is the delay before retrying.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># More information on Duration format:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># - https://www.iso.org/iso-8601-date-and-time-format.html</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># - https://en.wikipedia.org/wiki/ISO_8601</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic">#</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># For linear policy, backoff delay is backoffDelay*<numberOfRetries>.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># For exponential policy, backoff delay is backoffDelay*2^<numberOfRetries>.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">backoffDelay</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">PT2S</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><h3 id="deadlettersink">deadLetterSink</h3>
-<p>When present, events that failed to be consumed are sent to the <code>deadLetterSink</code>.
-In case of failure, the event is dropped and an error is logged into the system.</p>
-<p>The <code>deadLetterSink</code> value must be a Destination.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># DeadLetterSink is the sink receiving event that could not be sent to</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># a destination.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">deadLetterSink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">uri</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">/my-path</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Failed events may, depending on the specific Channel implementation in use, be
-enhanced with extension attributes prior to forwarding to the<code>deadLetterSink</code>.
-These extension attributes are as follows:</p>
-<ul>
-<li>
-<p><strong>knativeerrorcode</strong></p>
-<ul>
-<li><strong>Type:</strong> Int</li>
-<li><strong>Description:</strong> The HTTP Response <strong>StatusCode</strong> from the final event
-dispatch attempt.</li>
-<li><strong>Constraints:</strong> Should always be present as every HTTP Response contains
-a <strong>StatusCode</strong>.</li>
-<li><strong>Examples:</strong>
-<ul>
-<li>“500”</li>
-<li>…any HTTP StatusCode…</li>
-</ul>
-</li>
-</ul>
-</li>
-<li>
-<p><strong>knativeerrordata</strong></p>
-<ul>
-<li><strong>Type:</strong> String</li>
-<li><strong>Description:</strong> The HTTP Response <strong>Body</strong> from the final event dispatch
-attempt.</li>
-<li><strong>Constraints:</strong> Will be empty if the HTTP Response <strong>Body</strong> was empty,
-and might be truncated if the length is excessive.</li>
-<li><strong>Examples:</strong>
-<ul>
-<li>‘Internal Server Error: Failed to process event.’</li>
-<li>‘{“key”: “value”}’</li>
-<li>…any HTTP Response Body…</li>
-</ul>
-</li>
-</ul>
-</li>
-</ul>
-<h2 id="channel-support">Channel Support</h2>
-<p>The table below summarizes what delivery parameters are supported for each channel implementation.</p>
-<table>
-<thead>
-<tr>
-<th>Channel Type</th>
-<th>Supported Delivery Parameters</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>GCP PubSub</td>
-<td>none</td>
-</tr>
-<tr>
-<td>In-Memory</td>
-<td><code>deadLetterSink</code>, <code>retry</code>, <code>backoffPolicy</code>, <code>backoffDelay</code></td>
-</tr>
-<tr>
-<td>Kafka</td>
-<td><code>deadLetterSink</code>, <code>retry</code>, <code>backoffPolicy</code>, <code>backoffDelay</code></td>
-</tr>
-<tr>
-<td>Natss</td>
-<td>none</td>
-</tr>
-</tbody>
-</table>
-<h2 id="broker-support">Broker Support</h2>
-<p>The table below summarizes what delivery parameters are supported for each Broker implementation.</p>
-<table>
-<thead>
-<tr>
-<th>Broker Class</th>
-<th>Supported Delivery Parameters</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>googlecloud</td>
-<td><code>deadLetterSink</code> <sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>, <code>retry</code>, <code>backoffPolicy</code>, <code>backoffDelay</code> <sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup></td>
-</tr>
-<tr>
-<td>Kafka</td>
-<td><code>deadLetterSink</code>, <code>retry</code>, <code>backoffPolicy</code>, <code>backoffDelay</code></td>
-</tr>
-<tr>
-<td>MTChannelBasedBroker</td>
-<td>depends on the underlying channel</td>
-</tr>
-<tr>
-<td>RabbitMQBroker</td>
-<td><code>deadLetterSink</code>, <code>retry</code>, <code>backoffPolicy</code>, <code>backoffDelay</code></td>
-</tr>
-</tbody>
-</table>
-<section class="footnotes" role="doc-endnotes">
-<hr>
-<ol>
-<li id="fn:1" role="doc-endnote">
-<p>deadLetterSink must be a GCP Pub/Sub topic uri:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">deadLetterSink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">uri</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">pubsub://dead-letter-topic</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Please see the
-<a href="https://github.com/google/knative-gcp/blob/master/config/core/configmaps/br-delivery.yaml">config-br-delivery</a>
-ConfigMap for a complete example. <a href="#fnref:1" class="footnote-backref" role="doc-backlink">↩︎</a></p>
-</li>
-<li id="fn:2" role="doc-endnote">
-<p>The googlecloud broker only supports the <code>exponential</code> backoffPolicy. <a href="#fnref:2" class="footnote-backref" role="doc-backlink">↩︎</a></p>
-</li>
-</ol>
-</section>
-
-
-
-
-
- V0.22-Docs: Broker
- https://knative.dev/v0.22-docs/eventing/broker/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/broker/
-
-
-
- <p>Knative provides a multi-tenant, channel-based broker implementation that uses channels for event routing.</p>
-<p>Before you can use the Knative Channel-based Broker, you must install a channel provider, such as InMemoryChannel, Kafka or Nats.</p>
-<p><strong>NOTE:</strong> InMemoryChannel channels are for development use only and must not be used in a production deployment.</p>
-<p>For more information on which channels are available and how to install them,
-see the list of <a href="https://knative.dev/docs/eventing/channels/channels-crds/">available channels</a>.</p>
-<h2 id="how-it-works">How it works</h2>
-<!--TODO: Add a diagram that shows this-->
-<p>When an Event is sent to the Broker, all request metadata other than the CloudEvent data and context attributes is stripped away.
-Unless the information existed as a <code>CloudEvent</code> attribute, no information is retained about how this Event entered the Broker.</p>
-<p>Once an Event has entered the Broker, it can be forwarded to event Channels by using Triggers.
-This event delivery mechanism hides details of event routing from the event producer and event consumer.</p>
-<p>Triggers register a subscriber’s interest in a particular class of events, so that the subscriber’s event sink will receive events that match the Trigger’s filter.</p>
-<h2 id="default-broker-configuration">Default Broker configuration</h2>
-<p>Knative Eventing provides a <code>config-br-defaults</code> ConfigMap, which lives in the
-<code>knative-eventing</code> namespace, and provides default configuration settings to
-enable the creation of Brokers and Channels by using defaults.
-For more information, see the <a href="./config-br-defaults"><code>config-br-defaults</code></a> ConfigMap documentation.</p>
-<p>Create a Broker using the default settings:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create -f - <span style="color:#4e9a06"><<EOF
-</span><span style="color:#4e9a06">apiVersion: eventing.knative.dev/v1
-</span><span style="color:#4e9a06">kind: Broker
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: default
-</span><span style="color:#4e9a06"> namespace: default
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div><h2 id="configuring-broker-classes">Configuring broker classes</h2>
-<p>You can configure Knative Eventing so that when you create a broker, it uses a
-different type of broker than the default Knative channel-based broker. To
-configure a different broker type, or <em>class</em>, you must modify the
-<code>eventing.knative.dev/broker.class</code> annotation and <code>spec.config</code> for the Broker
-object. <code>MTChannelBasedBroker</code> is the broker class default.</p>
-<h3 id="procedure">Procedure</h3>
-<ol>
-<li>Modify the <code>eventing.knative.dev/broker.class</code> annotation. Replace
-<code>MTChannelBasedBroker</code> with the class type you want to use:</li>
-</ol>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Broker</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">annotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">eventing.knative.dev/broker.class</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MTChannelBasedBroker</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><ol>
-<li>Configure the <code>spec.config</code> with the details of the ConfigMap that defines
-the backing channel for the broker class:</li>
-</ol>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Broker</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">config-br-default-channel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>A full example combined into a fully specified resource could look like this:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Broker</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">annotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">eventing.knative.dev/broker.class</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MTChannelBasedBroker</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">config-br-default-channel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><h2 id="next-steps">Next steps</h2>
-<p>After you have created a Broker, you can complete the following tasks to finish setting up event delivery.</p>
-<h3 id="subscriber">Subscriber</h3>
-<p>Create a function to receive events. This document uses a Knative Service, but
-it could be anything that is
-<a href="https://github.com/knative/eventing/blob/main/docs/spec/interfaces.md">Callable</a>.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create -f - <span style="color:#4e9a06"><<EOF
-</span><span style="color:#4e9a06">apiVersion: serving.knative.dev/v1
-</span><span style="color:#4e9a06">kind: Service
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: my-service
-</span><span style="color:#4e9a06"> namespace: default
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> template:
-</span><span style="color:#4e9a06"> spec:
-</span><span style="color:#4e9a06"> containers:
-</span><span style="color:#4e9a06"> - # This corresponds to
-</span><span style="color:#4e9a06"> # https://github.com/knative/eventing-contrib/tree/main/cmd/event_display
-</span><span style="color:#4e9a06"> image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div><h3 id="trigger">Trigger</h3>
-<p>Create a <code>Trigger</code> that sends only events of a particular type to the subscriber
-created above (<code>my-service</code>). For this example, we use Ping Source, and it
-emits events types <code>dev.knative.sources.ping</code>.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create -f - <span style="color:#4e9a06"><<EOF
-</span><span style="color:#4e9a06">apiVersion: eventing.knative.dev/v1
-</span><span style="color:#4e9a06">kind: Trigger
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: my-service-trigger
-</span><span style="color:#4e9a06"> namespace: default
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> broker: default
-</span><span style="color:#4e9a06"> filter:
-</span><span style="color:#4e9a06"> attributes:
-</span><span style="color:#4e9a06"> type: dev.knative.sources.ping
-</span><span style="color:#4e9a06"> subscriber:
-</span><span style="color:#4e9a06"> ref:
-</span><span style="color:#4e9a06"> apiVersion: serving.knative.dev/v1
-</span><span style="color:#4e9a06"> kind: Service
-</span><span style="color:#4e9a06"> name: my-service
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div><h3 id="emitting-events-using-ping-source">Emitting Events using Ping Source</h3>
-<p>Knative Eventing comes with a <a href="../samples/ping-source/index.html">Ping Source</a> which
-emits an event on a configured schedule. For this we’ll configure it to emit
-events once a minute, saying, yes, you guessed it <code>Hello World!</code>.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create -f - <span style="color:#4e9a06"><<EOF
-</span><span style="color:#4e9a06">apiVersion: sources.knative.dev/v1beta2
-</span><span style="color:#4e9a06">kind: PingSource
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: test-ping-source
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> schedule: "*/1 * * * *"
-</span><span style="color:#4e9a06"> contentType: "application/json"
-</span><span style="color:#4e9a06"> data: '{"message": "Hello world!"}'
-</span><span style="color:#4e9a06"> sink:
-</span><span style="color:#4e9a06"> ref:
-</span><span style="color:#4e9a06"> # Deliver events to Broker.
-</span><span style="color:#4e9a06"> apiVersion: eventing.knative.dev/v1
-</span><span style="color:#4e9a06"> kind: Broker
-</span><span style="color:#4e9a06"> name: default
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div><p>The following example is more complex, and demonstrates the use of <code>deadLetterSink</code> configuration to send failed events to Knative Service called <code>dlq-service</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Broker</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">annotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">eventing.knative.dev/broker.class</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MTChannelBasedBroker</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># Configuration specific to this broker.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">config-br-default-channel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># Where to deliver Events that failed to be processed.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">delivery</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">deadLetterSink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">dlq-service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>See also: <a href="../event-delivery#configuring-broker-delivery">Delivery Parameters</a></p>
-
-
-
-
-
- V0.22-Docs: Sink
- https://knative.dev/v0.22-docs/eventing/sink/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/sink/
-
-
-
- <p>A sink is an Addressable resource that acts as a link
-between the Eventing mesh and an entity or system.</p>
-<p>We can connect any source to a sink, such as <code>PingSource</code> and <code>KafkaSink</code> objects:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sources.knative.dev/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">PingSource</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">test-ping-source</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">schedule</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"*/1 * * * *"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">jsonData</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">'{"message": "Hello world!"}'</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1alpha1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KafkaSink</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-kafka-sink</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>We can connect a <code>Trigger</code> object to a sink, so that we can filter events, before sending them to a sink:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Trigger</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-service-trigger</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">broker</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">filter</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">attributes</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">dev.knative.foo.bar</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">myextension</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-extension-value</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">subscriber</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1alpha1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KafkaSink</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-kafka-sink</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><h2 id="knative-sinks">Knative Sinks</h2>
-<table>
-<thead>
-<tr>
-<th>Name</th>
-<th>Maintainer</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td><a href="./kafka-sink">KafkaSink</a></td>
-<td>Knative</td>
-<td>Send events to a Kafka topic</td>
-</tr>
-<tr>
-<td><a href="https://github.com/knative-sandbox/eventing-redis/tree/main/sink">RedisSink</a></td>
-<td>Knative</td>
-<td>Send events to a Redis Stream</td>
-</tr>
-</tbody>
-</table>
-
-
-
-
-
- V0.22-Docs: Triggers
- https://knative.dev/v0.22-docs/eventing/triggers/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/triggers/
-
-
-
- <p>A Trigger represents a desire to subscribe to events from a specific Broker.</p>
-<p>The <code>subscriber</code> value must be a <a href="https://pkg.go.dev/knative.dev/pkg/apis/duck/v1#Destination">Destination</a>.</p>
-<p>Simple example which will receive all the events from the given (<code>default</code>) broker and
-deliver them to Knative Serving service <code>my-service</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create -f - <span style="color:#4e9a06"><<EOF
-</span><span style="color:#4e9a06">apiVersion: eventing.knative.dev/v1
-</span><span style="color:#4e9a06">kind: Trigger
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: my-service-trigger
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> broker: default
-</span><span style="color:#4e9a06"> subscriber:
-</span><span style="color:#4e9a06"> ref:
-</span><span style="color:#4e9a06"> apiVersion: serving.knative.dev/v1
-</span><span style="color:#4e9a06"> kind: Service
-</span><span style="color:#4e9a06"> name: my-service
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div><p>Simple example which will receive all the events from the given (<code>default</code>) broker and
-deliver them to the custom path <code>/my-custom-path</code> for the Kubernetes service <code>my-service</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create -f - <span style="color:#4e9a06"><<EOF
-</span><span style="color:#4e9a06">apiVersion: eventing.knative.dev/v1
-</span><span style="color:#4e9a06">kind: Trigger
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: my-service-trigger
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> broker: default
-</span><span style="color:#4e9a06"> subscriber:
-</span><span style="color:#4e9a06"> ref:
-</span><span style="color:#4e9a06"> apiVersion: v1
-</span><span style="color:#4e9a06"> kind: Service
-</span><span style="color:#4e9a06"> name: my-service
-</span><span style="color:#4e9a06"> uri: /my-custom-path
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div><h3 id="trigger-filtering">Trigger Filtering</h3>
-<p>Exact match filtering on any number of CloudEvents attributes as well as
-extensions are supported. If your filter sets multiple attributes, an event must
-have all of the attributes for the Trigger to filter it. Note that we only
-support exact matching on string values.</p>
-<p>Example:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create -f - <span style="color:#4e9a06"><<EOF
-</span><span style="color:#4e9a06">apiVersion: eventing.knative.dev/v1
-</span><span style="color:#4e9a06">kind: Trigger
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: my-service-trigger
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> broker: default
-</span><span style="color:#4e9a06"> filter:
-</span><span style="color:#4e9a06"> attributes:
-</span><span style="color:#4e9a06"> type: dev.knative.foo.bar
-</span><span style="color:#4e9a06"> myextension: my-extension-value
-</span><span style="color:#4e9a06"> subscriber:
-</span><span style="color:#4e9a06"> ref:
-</span><span style="color:#4e9a06"> apiVersion: serving.knative.dev/v1
-</span><span style="color:#4e9a06"> kind: Service
-</span><span style="color:#4e9a06"> name: my-service
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div><p>The example above filters events from the <code>default</code> Broker that are of type
-<code>dev.knative.foo.bar</code> AND have the extension <code>myextension</code> with the value
-<code>my-extension-value</code>.</p>
-
-
-
-
-
- V0.22-Docs: Debugging Knative Eventing
- https://knative.dev/v0.22-docs/eventing/debugging/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/debugging/
-
-
-
- <p>This is an evolving document on how to debug a non-working Knative Eventing
-setup.</p>
-<h2 id="audience">Audience</h2>
-<p>This document is intended for people that are familiar with the object model of
-<a href="../index.html">Knative Eventing</a>. You don’t need to be an expert, but do need to
-know roughly how things fit together.</p>
-<h2 id="prerequisites">Prerequisites</h2>
-<ol>
-<li>Setup <a href="../index.html">Knative Eventing and an Eventing-contrib resource</a>.</li>
-</ol>
-<h2 id="example">Example</h2>
-<p>This guide uses an example consisting of an event source that sends events to a
-function.</p>
-<p><img src="ExampleModel.png" alt="src -> chan -> sub -> svc -> fn"></p>
-<p>See <a href="example.yaml">example.yaml</a> for the entire YAML. For any commands in this
-guide to work, you must apply <a href="example.yaml">example.yaml</a>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply --filename example.yaml
-</code></pre></div><h2 id="triggering-events">Triggering Events</h2>
-<p>Knative events will occur whenever a Kubernetes
-<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#event-v1-core"><code>Event</code></a>
-occurs in the <code>knative-debug</code> namespace. We can cause this to occur with the
-following commands:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-debug run to-be-deleted --image<span style="color:#ce5c00;font-weight:bold">=</span>image-that-doesnt-exist --restart<span style="color:#ce5c00;font-weight:bold">=</span>Never
-<span style="color:#8f5902;font-style:italic"># 5 seconds is arbitrary. We want K8s to notice that the Pod needs to be scheduled and generate at least one event.</span>
-sleep <span style="color:#0000cf;font-weight:bold">5</span>
-kubectl --namespace knative-debug delete pod to-be-deleted
-</code></pre></div><p>Then we can see the Kubernetes <code>Event</code>s (note that these are not Knative
-events!):</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-debug get events
-</code></pre></div><p>This should produce output along the lines of:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">LAST SEEN FIRST SEEN COUNT NAME KIND SUBOBJECT TYPE REASON SOURCE MESSAGE
-20s 20s <span style="color:#0000cf;font-weight:bold">1</span> to-be-deleted.157aadb9f376fc4e Pod Normal Scheduled default-scheduler Successfully assigned knative-debug/to-be-deleted to gke-kn24-default-pool-c12ac83b-pjf2
-</code></pre></div><h2 id="where-are-my-events">Where are my events?</h2>
-<p>You’ve applied <a href="example.yaml">example.yaml</a> and you are inspecting <code>fn</code>’s logs:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-debug logs -l <span style="color:#000">app</span><span style="color:#ce5c00;font-weight:bold">=</span>fn -c user-container
-</code></pre></div><p>But you don’t see any events arrive. Where is the problem?</p>
-<h3 id="control-plane">Control Plane</h3>
-<p>We will first check the control plane, to ensure everything should be working
-properly.</p>
-<h4 id="resources">Resources</h4>
-<p>The first thing to check are all the created resources, do their statuses
-contain <code>ready</code> true?</p>
-<p>We will attempt to determine why from the most basic pieces out:</p>
-<ol>
-<li><code>fn</code> - The <code>Deployment</code> has no dependencies inside Knative.</li>
-<li><code>svc</code> - The <code>Service</code> has no dependencies inside Knative.</li>
-<li><code>chan</code> - The <code>Channel</code> depends on its backing <code>channel implementation</code> and
-somewhat depends on <code>sub</code>.</li>
-<li><code>src</code> - The <code>Source</code> depends on <code>chan</code>.</li>
-<li><code>sub</code> - The <code>Subscription</code> depends on both <code>chan</code> and <code>svc</code>.</li>
-</ol>
-<h5 id="fn"><code>fn</code></h5>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-debug get deployment fn -o <span style="color:#000">jsonpath</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">'{.status.availableReplicas}'</span>
-</code></pre></div><p>We want to see <code>1</code>. If you don’t, then you need to debug the <code>Deployment</code>. Is
-there anything obviously wrong mentioned in the <code>status</code>?</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-debug get deployment fn --output yaml
-</code></pre></div><p>If it is not obvious what is wrong, then you need to debug the <code>Deployment</code>,
-which is out of scope of this document.</p>
-<p>Verify that the <code>Pod</code> is <code>Ready</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-debug get pod -l <span style="color:#000">app</span><span style="color:#ce5c00;font-weight:bold">=</span>fn -o <span style="color:#000">jsonpath</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">'{.items[*].status.conditions[?(@.type == "Ready")].status}'</span>
-</code></pre></div><p>This should return <code>True</code>. If it doesn’t, then try to debug the <code>Deployment</code>
-using the
-<a href="https://kubernetes.io/docs/tasks/debug-application-cluster/debug-application-introspection/">Kubernetes Application Debugging</a>
-guide.</p>
-<h5 id="svc"><code>svc</code></h5>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-debug get service svc
-</code></pre></div><p>We just want to ensure this exists and has the correct name. If it doesn’t
-exist, then you probably need to re-apply <a href="example.yaml">example.yaml</a>.</p>
-<p>Verify it points at the expected pod.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#000">svcLabels</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#204a87;font-weight:bold">$(</span>kubectl --namespace knative-debug get service svc -o go-template<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">'{{range $k, $v := .spec.selector}}{{ $k }}={{ $v }},{{ end }}'</span> <span style="color:#000;font-weight:bold">|</span> sed <span style="color:#4e9a06">'s/.$//'</span> <span style="color:#204a87;font-weight:bold">)</span>
-kubectl --namespace knative-debug get pods -l <span style="color:#000">$svcLabels</span>
-</code></pre></div><p>This should return a single Pod, which if you inspect is the one generated by
-<code>fn</code>.</p>
-<h5 id="chan"><code>chan</code></h5>
-<p><code>chan</code> uses the
-[<code>in-memory-channel</code>]( <a href="https://github.com/knative/eventing/tree/%7B%7B">https://github.com/knative/eventing/tree/{{</a>< branch >}}/config/channels/in-memory-channel).
-This is a very basic channel and has few
-failure modes that will be exhibited in <code>chan</code>’s <code>status</code>.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-debug get channel.messaging.knative.dev chan -o <span style="color:#000">jsonpath</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">'{.status.conditions[?(@.type == "Ready")].status}'</span>
-</code></pre></div><p>This should return <code>True</code>. If it doesn’t, get the full resource:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-debug get channel.messaging.knative.dev chan --output yaml
-</code></pre></div><p>If <code>status</code> is completely missing, it implies that something is wrong with the
-<code>in-memory-channel</code> controller. See <a href="#channel-controller">Channel Controller</a>.</p>
-<p>Next verify that <code>chan</code> is addressable:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-debug get channel.messaging.knative.dev chan -o <span style="color:#000">jsonpath</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">'{.status.address.hostname}'</span>
-</code></pre></div><p>This should return a URI, likely ending in ‘.cluster.local’. If it doesn’t, then
-it implies that something went wrong during reconciliation. See
-<a href="#channel-controller">Channel Controller</a>.</p>
-<p>We will verify that the two resources that the <code>chan</code> creates exist and are
-<code>Ready</code>.</p>
-<h6 id="service"><code>Service</code></h6>
-<p><code>chan</code> creates a K8s <code>Service</code>.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-debug get service -l messaging.knative.dev/role<span style="color:#ce5c00;font-weight:bold">=</span>in-memory-channel
-</code></pre></div><p>It’s spec is completely unimportant, as Istio will ignore it. It just needs to
-exist so that <code>src</code> can send events to it. If it doesn’t exist, it implies that
-something went wrong during <code>chan</code> reconciliation. See
-<a href="#channel-controller">Channel Controller</a>.</p>
-<h5 id="src"><code>src</code></h5>
-<p><code>src</code> is a <a href="../sources/apiserversource"><code>ApiServerSource</code></a>.</p>
-<p>First we will verify that <code>src</code> is writing to <code>chan</code>.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-debug get apiserversource src -o <span style="color:#000">jsonpath</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">'{.spec.sink}'</span>
-</code></pre></div><p>Which should return
-<code>map[apiVersion:messaging.knative.dev/v1 kind:Channel name:chan]</code>. If it
-doesn’t, then <code>src</code> was setup incorrectly and its <code>spec</code> needs to be fixed.
-Fixing should be as simple as updating its <code>spec</code> to have the correct <code>sink</code>
-(see <a href="example.yaml">example.yaml</a>).</p>
-<p>Now that we know <code>src</code> is sending to <code>chan</code>, let’s verify that it is <code>Ready</code>.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-debug get apiserversource src -o <span style="color:#000">jsonpath</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">'{.status.conditions[?(.type == "Ready")].status}'</span>
-</code></pre></div><h4 id="sub"><code>sub</code></h4>
-<p><code>sub</code> is a <code>Subscription</code> from <code>chan</code> to <code>fn</code>.</p>
-<p>Verify that <code>sub</code> is <code>Ready</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-debug get subscription sub -o <span style="color:#000">jsonpath</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">'{.status.conditions[?(.type == "Ready")].status}'</span>
-</code></pre></div><p>This should return <code>True</code>. If it doesn’t then, look at all the status entries.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-debug get subscription sub --output yaml
-</code></pre></div><h4 id="controllers">Controllers</h4>
-<p>Each of the resources has a Controller that is watching it. As of today, they
-tend to do a poor job of writing failure status messages and events, so we need
-to look at the Controller’s logs.</p>
-<h5 id="deployment-controller">Deployment Controller</h5>
-<p>The Kubernetes Deployment Controller, controlling <code>fn</code>, is out of scope for this
-document.</p>
-<h5 id="service-controller">Service Controller</h5>
-<p>The Kubernetes Service Controller, controlling <code>svc</code>, is out of scope for this
-document.</p>
-<h5 id="channel-controller">Channel Controller</h5>
-<p>There is not a single <code>Channel</code> Controller. Instead, there is one
-Controller for each Channel CRD. <code>chan</code> uses the
-<code>InMemoryChannel</code> <code>Channel CRD</code>, whose Controller is:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-eventing get pod -l messaging.knative.dev/channel<span style="color:#ce5c00;font-weight:bold">=</span>in-memory-channel,messaging.knative.dev/role<span style="color:#ce5c00;font-weight:bold">=</span>controller --output yaml
-</code></pre></div><p>See its logs with:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-eventing logs -l messaging.knative.dev/channel<span style="color:#ce5c00;font-weight:bold">=</span>in-memory-channel,messaging.knative.dev/role<span style="color:#ce5c00;font-weight:bold">=</span>controller
-</code></pre></div><p>Pay particular attention to any lines that have a logging level of <code>warning</code> or
-<code>error</code>.</p>
-<h5 id="source-controller">Source Controller</h5>
-<p>Each Source will have its own Controller. <code>src</code> is a <code>ApiServerSource</code>, so
-its Controller is:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-eventing get pod -l <span style="color:#000">app</span><span style="color:#ce5c00;font-weight:bold">=</span>sources-controller
-</code></pre></div><p>This is actually a single binary that runs multiple Source Controllers,
-importantly including <a href="#apiserversource-controller">ApiServerSource Controller</a>.</p>
-<h6 id="apiserversource-controller">ApiServerSource Controller</h6>
-<p>The <code>ApiServerSource</code> Controller is run in the same binary as some other Source
-Controllers from Eventing. It is:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-debug get pod -l eventing.knative.dev/sourceName<span style="color:#ce5c00;font-weight:bold">=</span>src,eventing.knative.dev/source<span style="color:#ce5c00;font-weight:bold">=</span>apiserver-source-controller
-</code></pre></div><p>View its logs with:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-debug logs -l eventing.knative.dev/sourceName<span style="color:#ce5c00;font-weight:bold">=</span>src,eventing.knative.dev/source<span style="color:#ce5c00;font-weight:bold">=</span>apiserver-source-controller
-</code></pre></div><p>Pay particular attention to any lines that have a logging level of <code>warning</code> or
-<code>error</code>.</p>
-<h5 id="subscription-controller">Subscription Controller</h5>
-<p>The <code>Subscription</code> Controller controls <code>sub</code>. It attempts to resolve the
-addresses that a <code>Channel</code> should send events to, and once resolved, inject
-those into the <code>Channel</code>’s <code>spec.subscribable</code>.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-eventing get pod -l <span style="color:#000">app</span><span style="color:#ce5c00;font-weight:bold">=</span>eventing-controller
-</code></pre></div><p>View its logs with:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-eventing logs -l <span style="color:#000">app</span><span style="color:#ce5c00;font-weight:bold">=</span>eventing-controller
-</code></pre></div><p>Pay particular attention to any lines that have a logging level of <code>warning</code> or
-<code>error</code>.</p>
-<h3 id="data-plane">Data Plane</h3>
-<p>The entire <a href="#control-plane">Control Plane</a> looks healthy, but we’re still not
-getting any events. Now we need to investigate the data plane.</p>
-<p>The Knative event takes the following path:</p>
-<ol>
-<li>
-<p>Event is generated by <code>src</code>.</p>
-<ul>
-<li>In this case, it is caused by having a Kubernetes <code>Event</code> trigger it, but
-as far as Knative is concerned, the <code>Source</code> is generating the event denovo
-(from nothing).</li>
-</ul>
-</li>
-<li>
-<p><code>src</code> is POSTing the event to <code>chan</code>’s address,
-<code>http://chan-kn-channel.knative-debug.svc.cluster.local</code>.</p>
-</li>
-<li>
-<p>The Channel Dispatcher receives the request and introspects the Host header
-to determine which <code>Channel</code> it corresponds to. It sees that it corresponds
-to <code>knative-debug/chan</code> so forwards the request to the subscribers defined in
-<code>sub</code>, in particular <code>svc</code>, which is backed by <code>fn</code>.</p>
-</li>
-<li>
-<p><code>fn</code> receives the request and logs it.</p>
-</li>
-</ol>
-<p>We will investigate components in the order in which events should travel.</p>
-<h4 id="channel-dispatcher">Channel Dispatcher</h4>
-<p>The Channel Dispatcher is the component that receives POSTs pushing events into
-<code>Channel</code>s and then POSTs to subscribers of those <code>Channel</code>s when an event is
-received. For the <code>in-memory-channel</code> used in this example, there is a single
-binary that handles both the receiving and dispatching sides for all
-<code>in-memory-channel</code> <code>Channel</code>s.</p>
-<p>First we will inspect the Dispatcher’s logs to see if it is anything obvious:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-eventing logs -l messaging.knative.dev/channel<span style="color:#ce5c00;font-weight:bold">=</span>in-memory-channel,messaging.knative.dev/role<span style="color:#ce5c00;font-weight:bold">=</span>dispatcher -c dispatcher
-</code></pre></div><p>Ideally we will see lines like:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#ce5c00;font-weight:bold">{</span><span style="color:#4e9a06">"level"</span>:<span style="color:#4e9a06">"info"</span>,<span style="color:#4e9a06">"ts"</span>:<span style="color:#4e9a06">"2019-08-16T13:50:55.424Z"</span>,<span style="color:#4e9a06">"logger"</span>:<span style="color:#4e9a06">"inmemorychannel-dispatcher.in-memory-channel-dispatcher"</span>,<span style="color:#4e9a06">"caller"</span>:<span style="color:#4e9a06">"provisioners/message_receiver.go:147"</span>,<span style="color:#4e9a06">"msg"</span>:<span style="color:#4e9a06">"Request mapped to channel: knative-debug/chan-kn-channel"</span>,<span style="color:#4e9a06">"knative.dev/controller"</span>:<span style="color:#4e9a06">"in-memory-channel-dispatcher"</span><span style="color:#ce5c00;font-weight:bold">}</span>
-<span style="color:#ce5c00;font-weight:bold">{</span><span style="color:#4e9a06">"level"</span>:<span style="color:#4e9a06">"info"</span>,<span style="color:#4e9a06">"ts"</span>:<span style="color:#4e9a06">"2019-08-16T13:50:55.425Z"</span>,<span style="color:#4e9a06">"logger"</span>:<span style="color:#4e9a06">"inmemorychannel-dispatcher.in-memory-channel-dispatcher"</span>,<span style="color:#4e9a06">"caller"</span>:<span style="color:#4e9a06">"provisioners/message_dispatcher.go:112"</span>,<span style="color:#4e9a06">"msg"</span>:<span style="color:#4e9a06">"Dispatching message to http://svc.knative-debug.svc.cluster.local/"</span>,<span style="color:#4e9a06">"knative.dev/controller"</span>:<span style="color:#4e9a06">"in-memory-channel-dispatcher"</span><span style="color:#ce5c00;font-weight:bold">}</span>
-<span style="color:#ce5c00;font-weight:bold">{</span><span style="color:#4e9a06">"level"</span>:<span style="color:#4e9a06">"info"</span>,<span style="color:#4e9a06">"ts"</span>:<span style="color:#4e9a06">"2019-08-16T13:50:55.981Z"</span>,<span style="color:#4e9a06">"logger"</span>:<span style="color:#4e9a06">"inmemorychannel-dispatcher.in-memory-channel-dispatcher"</span>,<span style="color:#4e9a06">"caller"</span>:<span style="color:#4e9a06">"provisioners/message_receiver.go:140"</span>,<span style="color:#4e9a06">"msg"</span>:<span style="color:#4e9a06">"Received request for chan-kn-channel.knative-debug.svc.cluster.local"</span>,<span style="color:#4e9a06">"knative.dev/controller"</span>:<span style="color:#4e9a06">"in-memory-channel-dispatcher"</span><span style="color:#ce5c00;font-weight:bold">}</span>
-</code></pre></div><p>Which shows that the request is being received and then sent to <code>svc</code>, which is
-returning a 2XX response code (likely 200, 202, or 204).</p>
-<p>However if we see something like:</p>
-<!--
- NOTE: This error has been produced by settings spec.ports[0].port to 8081
- kubectl patch -n knative-debug svc svc -p '{"spec":{"ports": [{"port": 8081, "targetPort":8080}]}}' --type='merge'
--->
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#ce5c00;font-weight:bold">{</span><span style="color:#4e9a06">"level"</span>:<span style="color:#4e9a06">"info"</span>,<span style="color:#4e9a06">"ts"</span>:<span style="color:#4e9a06">"2019-08-16T16:10:16.859Z"</span>,<span style="color:#4e9a06">"logger"</span>:<span style="color:#4e9a06">"inmemorychannel-dispatcher.in-memory-channel-dispatcher"</span>,<span style="color:#4e9a06">"caller"</span>:<span style="color:#4e9a06">"provisioners/message_receiver.go:140"</span>,<span style="color:#4e9a06">"msg"</span>:<span style="color:#4e9a06">"Received request for chan-kn-channel.knative-debug.svc.cluster.local"</span>,<span style="color:#4e9a06">"knative.dev/controller"</span>:<span style="color:#4e9a06">"in-memory-channel-dispatcher"</span><span style="color:#ce5c00;font-weight:bold">}</span>
-<span style="color:#ce5c00;font-weight:bold">{</span><span style="color:#4e9a06">"level"</span>:<span style="color:#4e9a06">"info"</span>,<span style="color:#4e9a06">"ts"</span>:<span style="color:#4e9a06">"2019-08-16T16:10:16.859Z"</span>,<span style="color:#4e9a06">"logger"</span>:<span style="color:#4e9a06">"inmemorychannel-dispatcher.in-memory-channel-dispatcher"</span>,<span style="color:#4e9a06">"caller"</span>:<span style="color:#4e9a06">"provisioners/message_receiver.go:147"</span>,<span style="color:#4e9a06">"msg"</span>:<span style="color:#4e9a06">"Request mapped to channel: knative-debug/chan-kn-channel"</span>,<span style="color:#4e9a06">"knative.dev/controller"</span>:<span style="color:#4e9a06">"in-memory-channel-dispatcher"</span><span style="color:#ce5c00;font-weight:bold">}</span>
-<span style="color:#ce5c00;font-weight:bold">{</span><span style="color:#4e9a06">"level"</span>:<span style="color:#4e9a06">"info"</span>,<span style="color:#4e9a06">"ts"</span>:<span style="color:#4e9a06">"2019-08-16T16:10:16.859Z"</span>,<span style="color:#4e9a06">"logger"</span>:<span style="color:#4e9a06">"inmemorychannel-dispatcher.in-memory-channel-dispatcher"</span>,<span style="color:#4e9a06">"caller"</span>:<span style="color:#4e9a06">"provisioners/message_dispatcher.go:112"</span>,<span style="color:#4e9a06">"msg"</span>:<span style="color:#4e9a06">"Dispatching message to http://svc.knative-debug.svc.cluster.local/"</span>,<span style="color:#4e9a06">"knative.dev/controller"</span>:<span style="color:#4e9a06">"in-memory-channel-dispatcher"</span><span style="color:#ce5c00;font-weight:bold">}</span>
-<span style="color:#ce5c00;font-weight:bold">{</span><span style="color:#4e9a06">"level"</span>:<span style="color:#4e9a06">"error"</span>,<span style="color:#4e9a06">"ts"</span>:<span style="color:#4e9a06">"2019-08-16T16:10:38.169Z"</span>,<span style="color:#4e9a06">"logger"</span>:<span style="color:#4e9a06">"inmemorychannel-dispatcher.in-memory-channel-dispatcher"</span>,<span style="color:#4e9a06">"caller"</span>:<span style="color:#4e9a06">"fanout/fanout_handler.go:121"</span>,<span style="color:#4e9a06">"msg"</span>:<span style="color:#4e9a06">"Fanout had an error"</span>,<span style="color:#4e9a06">"knative.dev/controller"</span>:<span style="color:#4e9a06">"in-memory-channel-dispatcher"</span>,<span style="color:#4e9a06">"error"</span>:<span style="color:#4e9a06">"Unable to complete request Post http://svc.knative-debug.svc.cluster.local/: dial tcp 10.4.44.156:80: i/o timeout"</span>,<span style="color:#4e9a06">"stacktrace"</span>:<span style="color:#4e9a06">"knative.dev/eventing/pkg/provisioners/fanout.(*Handler).dispatch\n\t/Users/xxxxxx/go/src/knative.dev/eventing/pkg/provisioners/fanout/fanout_handler.go:121\nknative.dev/eventing/pkg/provisioners/fanout.createReceiverFunction.func1.1\n\t/Users/i512777/go/src/knative.dev/eventing/pkg/provisioners/fanout/fanout_handler.go:95"</span><span style="color:#ce5c00;font-weight:bold">}</span>
-</code></pre></div><p>Then we know there was a problem posting to
-<code>http://svc.knative-debug.svc.cluster.local/</code>.</p>
-<p>TODO Finish this section. Especially after the Channel Dispatcher emits K8s
-events about failures.</p>
-<h4 id="fn-1"><code>fn</code></h4>
-<p>TODO Fill in this section.</p>
-<h1 id="todo-finish-the-guide">TODO Finish the guide.</h1>
-
-
-
-
-
- V0.22-Docs: Accessing CloudEvent traces
- https://knative.dev/v0.22-docs/eventing/accessing-traces/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/accessing-traces/
-
-
-
- <p>Depending on the request tracing tool that you have installed on your Knative
-Eventing cluster, see the corresponding section for details about how to
-visualize and trace your requests.</p>
-<h2 id="before-you-begin">Before you begin</h2>
-<p>You must have a Knative cluster running with the Eventing component installed. <a href="../../install/index.html">Learn more</a></p>
-<h2 id="configuring-tracing">Configuring tracing</h2>
-<p>With the exception of importers, the Knative Eventing tracing is configured through the
-<code>config-tracing</code> ConfigMap in the <code>knative-eventing</code> namespace.</p>
-<p>Most importers do <em>not</em> use the ConfigMap and instead, use a static 1% sampling rate.</p>
-<p>You can use the <code>config-tracing</code> ConfigMap to configure the following Eventing components:</p>
-<ul>
-<li>Brokers</li>
-<li>Triggers</li>
-<li>InMemoryChannel</li>
-<li>ApiServerSource</li>
-<li>PingSource</li>
-<li>GitlabSource</li>
-<li>KafkaSource</li>
-<li>PrometheusSource</li>
-</ul>
-<p><strong>Example:</strong></p>
-<p>The following example <code>config-tracing</code> ConfigMap samples 10% of all CloudEvents:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">config-tracing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">enable</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"true"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">zipkin-endpoint</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"http://zipkin.istio-system.svc.cluster.local:9411/api/v2/spans"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sample-rate</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"0.1"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><h3 id="configuration-options">Configuration options</h3>
-<p>You can configure your <code>config-tracing</code> with following options:</p>
-<ul>
-<li>
-<p><code>backend</code>: Valid values are <code>zipkin</code>, <code>stackdriver</code>, or <code>none</code>. The default is <code>none</code>.</p>
-</li>
-<li>
-<p><code>zipkin-endpoint</code>: Specifies the URL to the zipkin collector where you want to send the traces.
-Must be set if backend is set to <code>zipkin</code>.</p>
-</li>
-<li>
-<p><code>stackdriver-project-id</code>: Specifies the GCP project ID into which the Stackdriver traces are written.
-You must specify the <code>backend</code> as <code>stackdriver</code>. If <code>backend</code>is unspecified, the GCP project ID is read
-from GCP metadata when running on GCP.</p>
-</li>
-<li>
-<p><code>sample-rate</code>: Specifies the sampling rate. Valid values are decimals from <code>0</code> to <code>1</code>
-(interpreted as a float64), which indicate the probability that any given request is sampled.
-An example value is <code>0.5</code>, which gives each request a 50% sampling probablity.</p>
-</li>
-<li>
-<p><code>debug</code>: Enables debugging. Valid values are <code>true</code> or <code>false</code>. Defaults to <code>false</code> when not specified.
-Set to <code>true</code> to enable debug mode, which forces the <code>sample-rate</code> to <code>1.0</code> and sends all spans to
-the server.</p>
-</li>
-</ul>
-<h3 id="viewing-your-config-tracing-configmap">Viewing your <code>config-tracing</code> ConfigMap</h3>
-<p>To view your current configuration:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n knative-eventing get configmap config-tracing -oyaml
-</code></pre></div><h3 id="editing-and-deploying-your-config-tracing-configmap">Editing and deploying your <code>config-tracing</code> ConfigMap</h3>
-<p>To edit and then immediately deploy changes to your ConfigMap, run the following command:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n knative-eventing edit configmap config-tracing
-</code></pre></div><h2 id="accessing-traces-in-eventing">Accessing traces in Eventing</h2>
-<p>To access the traces, you use either the Zipkin or Jaeger tool. Details about using these tools to access
-traces are provided in the Knative Serving observability section:</p>
-<ul>
-<li><a href="../../serving/accessing-traces#zipkin">Zipkin</a></li>
-<li><a href="../../serving/accessing-traces#jaeger">Jaeger</a></li>
-</ul>
-<h3 id="example">Example</h3>
-<p>The following demonstrates how to trace requests in Knative Eventing with Zipkin, using the
-<a href="https://github.com/knative/eventing/blob/main/test/conformance/broker_tracing_test.go"><code>TestBrokerTracing</code></a>
-End-to-End test.</p>
-<p>For this example, assume the following details:</p>
-<ul>
-<li>Everything happens in the <code>includes-incoming-trace-id-2qszn</code> namespace.</li>
-<li>The Broker is named <code>br</code>.</li>
-<li>There are two Triggers that are associated with the Broker:
-<ul>
-<li><code>transformer</code> - Filters to only allow events whose type is <code>transformer</code>.
-Sends the event to the Kubernetes Service <code>transformer</code>, which will reply with an
-identical event, except the replied event’s type will be <code>logger</code>.</li>
-<li><code>logger</code> - Filters to only allow events whose type is <code>logger</code>. Sends the event to
-the Kubernetes Service <code>logger</code>.</li>
-</ul>
-</li>
-<li>An event is sent to the Broker with the type <code>transformer</code>, by the Pod named <code>sender</code>.</li>
-</ul>
-<p>Given the above, the expected path and behavior of an event is as follows:</p>
-<ol>
-<li><code>sender</code> Pod sends the request to the Broker.</li>
-<li>Go to the Broker’s ingress Pod.</li>
-<li>Go to the <code>imc-dispatcher</code> Channel (imc stands for InMemoryChannel).</li>
-<li>Go to both Triggers.
-<ol>
-<li>Go to the Broker’s filter Pod for the Trigger <code>logger</code>. The Trigger’s filter ignores this event.</li>
-<li>Go to the Broker’s filter Pod for the Trigger <code>transformer</code>. The filter does pass, so it goes to the Kubernetes Service pointed at, also named <code>transformer</code>.
-<ol>
-<li><code>transformer</code> Pod replies with the modified event.</li>
-<li>Go to an InMemory dispatcher.</li>
-<li>Go to the Broker’s ingress Pod.</li>
-<li>Go to the InMemory dispatcher.</li>
-<li>Go to both Triggers.
-<ol>
-<li>Go to the Broker’s filter Pod for the Trigger <code>transformer</code>. The Trigger’s filter ignores the event.</li>
-<li>Go to the Broker’s filter Pod for the Trigger <code>logger</code>. The filter passes.
-<ol>
-<li>Go to the <code>logger</code> Pod. There is no reply.</li>
-</ol>
-</li>
-</ol>
-</li>
-</ol>
-</li>
-</ol>
-</li>
-</ol>
-<p>This is a screenshot of the trace view in Zipkin. All the red letters have been added to the screenshot and correspond to the expectations earlier in this section:</p>
-<p><img src="../images/AnnotatedTrace.png" alt="Annotated Trace"></p>
-<p>This is the same screenshot without the annotations.</p>
-<p><img src="../images/RawTrace.png" alt="Raw Trace"></p>
-<p>If you are interested, here is the <a href="../data/ee46c4c6be1df717b3b82f55b531912f.json">raw JSON</a> of the trace.</p>
-
-
-
-
-
- V0.22-Docs: Knative Eventing code samples
- https://knative.dev/v0.22-docs/eventing/samples/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/
-
-
-
- <p>Use the following code samples to help you understand the various use cases for
-Knative Eventing and Event Sources.
-<a href="../index.html">Learn more about Knative Eventing and Eventing Sources</a>.</p>
-<p><a href="../../samples"><strong>See all Knative code samples</strong></a></p>
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/samples/cloud-audit-logs-source/index.html b/archived/v0.22-docs/eventing/samples/cloud-audit-logs-source/index.html
deleted file mode 100644
index 9814ef739..000000000
--- a/archived/v0.22-docs/eventing/samples/cloud-audit-logs-source/index.html
+++ /dev/null
@@ -1,2257 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-CloudAuditLogsSource | Knative
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- CloudAuditLogsSource | Knative
-
-
-
-
-
-
-
-
-
Black lives matter.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
ContainerSource will start a container image which will generate events under
-certain situations and send messages to a sink URI. It also can be an easy way
-to support your own event sources in Knative. This guide shows how to configure
-ContainerSource as an event source for functions and summarizes guidelines for
-creating your own event source as a ContainerSource.
Create a ContainerSource using the heartbeats image
-
In order to run the heartbeats container as an event source, you have to create
-a concrete ContainerSource with specific arguments and environment settings. Be
-sure to replace heartbeats_image_uri with a valid uri for your heartbeats
-image in your image repo in heartbeats-source.yaml
-file. Note that arguments and environment variables are set and will be passed
-to the container.
In order to create a new event source using ContainerSource, you will create a
-container image at first, and then create a ContainerSource with the image uri
-and specify the values of parameters.
-
Develop, build and publish a container image
-
The container image can be developed with any language, build and publish with
-any tools you like. Here are some basic guidelines:
-
-
The container image must have a main method to start with.
-
The main method will accept parameters from arguments and environment
-variables.
-
Two environments variables will be injected by the ContainerSource controller,
-K_SINK and K_CE_OVERRIDES, resolved from spec.sink and spec.ceOverrides respectively.
-
The event messages shall be sent to the sink URI specified in K_SINK. The message can be any
-format.
-CloudEvents
-format is recommended.
-
-
heartbeats
-event source is a sample for your reference.
-
Create the ContainerSource using this container image
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/samples/container-source/service.yaml b/archived/v0.22-docs/eventing/samples/container-source/service.yaml
deleted file mode 100644
index daa0002e2..000000000
--- a/archived/v0.22-docs/eventing/samples/container-source/service.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright 2019 The Knative Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-apiVersion: serving.knative.dev/v1
-kind: Service
-metadata:
- name: event-display
-spec:
- template:
- spec:
- containers:
- - image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display
diff --git a/archived/v0.22-docs/eventing/samples/github-source/github-source.yaml b/archived/v0.22-docs/eventing/samples/github-source/github-source.yaml
deleted file mode 100644
index 4059b97b4..000000000
--- a/archived/v0.22-docs/eventing/samples/github-source/github-source.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-apiVersion: sources.knative.dev/v1alpha1
-kind: GitHubSource
-metadata:
- name: githubsourcesample
-spec:
- eventTypes:
- - pull_request
- ownerAndRepository: /
- accessToken:
- secretKeyRef:
- name: githubsecret
- key: accessToken
- secretToken:
- secretKeyRef:
- name: githubsecret
- key: secretToken
- sink:
- ref:
- apiVersion: serving.knative.dev/v1
- kind: Service
- name: github-message-dumper
-# To use GitHub Enterprise you would need to add an entry for your githubAPIURL similar to the example below
-# githubAPIURL: "https://github.mycompany.com/api/v3/"
diff --git a/archived/v0.22-docs/eventing/samples/github-source/githubsecret.yaml b/archived/v0.22-docs/eventing/samples/github-source/githubsecret.yaml
deleted file mode 100644
index 9d733e430..000000000
--- a/archived/v0.22-docs/eventing/samples/github-source/githubsecret.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-apiVersion: v1
-kind: Secret
-metadata:
- name: githubsecret
-type: Opaque
-stringData:
- accessToken:
- secretToken:
diff --git a/archived/v0.22-docs/eventing/samples/github-source/index.html b/archived/v0.22-docs/eventing/samples/github-source/index.html
deleted file mode 100644
index 7a1be56d6..000000000
--- a/archived/v0.22-docs/eventing/samples/github-source/index.html
+++ /dev/null
@@ -1,2386 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-GitHub source | Knative
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- GitHub source | Knative
-
-
-
-
-
-
-
-
-
Black lives matter.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
To verify the GitHub source is working, create a simple Knative
-Service that dumps incoming messages to its log. The service.yaml file
-defines this basic Service.
Create a personal access token
-for GitHub that the GitHub source can use to register webhooks with
-the GitHub API. Also decide on a secret token that your code will use
-to authenticate the incoming webhooks from GitHub (secretToken).
-
The token can be named anything you find convenient. The Source
-requires repo:public_repo and admin:repo_hook, to let it fire
-events from your public repositories and to create webhooks for those
-repositories. Copy and save this token; GitHub will force you to
-generate it again if misplaced.
-
Here’s an example for a token named “GitHubSource Sample” with the
-recommended scopes:
-
-
Update githubsecret.yaml with those values. If your generated access
-token is 'personal_access_token_value' and you choose your secretToken
-as 'asdfasfdsaf', you’d modify githubsecret.yaml like so:
In order to receive GitHub events, you have to create a concrete Event
-Source for a specific namespace. Be sure to replace the
-ownerAndRepository value with a valid GitHub public repository owned
-by your GitHub user.
-
If using GitHub enterprise you will need to add an additional githubAPIURL
-field to the spec specifying your GitHub enterprise API endpoint, see
-here
Verify the GitHub webhook was created by looking at the list of
-webhooks under the Settings tab in your GitHub repository. A hook
-should be listed that points to your Knative cluster with a green
-check mark to the left of the hook URL, as shown below.
-
-
Create Events
-
Create a pull request in your GitHub repository. We will verify
-that the GitHub events were sent into the Knative eventing system
-by looking at our message dumper function logs.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
GitLab Event source lives in the knative/eventing-contrib. Head to the releases page, find the latest release with gitlab.yaml
-artifact and replace the <RELEASE> with version tag:
kubectl -n knative-sources get pods --selector control-plane=gitlab-controller-manager
-
With the controller running you can now move on to a user persona and setup a
-GitLab webhook as well as a function that will consume GitLab events.
-
Using the GitLab Event Source
-
You are now ready to use the Event Source and trigger functions based on GitLab
-projects events.
-
We will:
-
-
Create a Knative service which will receive the events. To keep things simple
-this service will simply dump the events to stdout, this is the so-called:
-event_display
-
Create a GitLab access token and a random secret token used to secure the
-webhooks
-
Create the event source by posting a GitLab source object manifest to
-Kubernetes
-
-
Create a Knative Service
-
The event-display.yaml file shown below defines the basic service which will
-receive events from the GitLab source.
Create a
-personal access token
-which the GitLab source will use to register webhooks with the GitLab API.
-The token must have an “api” access scope in order to create repository
-webhooks. Also decide on a secret token that your source will use to
-authenticate the incoming webhooks from GitLab.
-
-
-
Update a secret values in secret.yaml defined below:
-
accessToken is the personal access token created in step 1 and
-secretToken is any token of your choosing.
In order to receive GitLab events, you have to create a concrete Event Source
-for a specific namespace. Replace the projectUrl value in the
-gitlabsource.yaml file with your GitLab project URL, for example
-https://gitlab.com/knative-examples/functions.
Verify that GitLab webhook was created by looking at the list of webhooks under
-Settings » Integrations in your GitLab project. A hook should be listed
-that points to your Knative cluster.
-
Create a push event and check the logs of the Pod backing the
-gitlab-event-display knative service. You will see the event:
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
A simple web app written in Go that you can use to test knative eventing. It
-shows how to consume a CloudEvent in Knative
-eventing, and optionally how to respond back with another CloudEvent in the http
-response, using the
-Go SDK for CloudEvents
Follow the steps below to create the sample code and then deploy the app to your
-cluster. You can also download a working copy of the sample, by running the
-following commands:
Docker installed and running on your local machine,
-and a Docker Hub account configured (we’ll use it for a container registry).
-
-
Recreating the sample code
-
-
-
Create a new file named helloworld.go and paste the following code. This
-code creates a basic web server which listens on port 8080:
-
import(
- "context"
- "log"
-
- cloudevents"github.com/cloudevents/sdk-go/v2"
- "github.com/google/uuid"
- )
-
- funcreceive(ctxcontext.Context,eventcloudevents.Event)(*cloudevents.Event,cloudevents.Result){
- // Here is where your code to process the event will go.
-// In this example we will log the event msg
-log.Printf("Event received. \n%s\n",event)
- data:=&HelloWorld{}
- iferr:=event.DataAs(data);err!=nil{
- log.Printf("Error while extracting cloudevent Data: %s\n",err.Error())
- returnnil,cloudevents.NewHTTPResult(400,"failed to convert data: %s",err)
- }
- log.Printf("Hello World Message from received event %q",data.Msg)
-
- // Respond with another event (optional)
-// This is optional and is intended to show how to respond back with another event after processing.
-// The response will go back into the knative eventing system just like any other event
-newEvent:=cloudevents.NewEvent()
- newEvent.SetID(uuid.New().String())
- newEvent.SetSource("knative/eventing/samples/hello-world")
- newEvent.SetType("dev.knative.samples.hifromknative")
- iferr:=newEvent.SetData(cloudevents.ApplicationJSON,HiFromKnative{Msg:"Hi from helloworld-go app!"});err!=nil{
- returnnil,cloudevents.NewHTTPResult(500,"failed to set response data: %s",err)
- }
- log.Printf("Responding with event\n%s\n",newEvent)
- return&newEvent,nil
- }
-
- funcmain(){
- log.Print("Hello world sample started.")
- c,err:=cloudevents.NewDefaultClient()
- iferr!=nil{
- log.Fatalf("failed to create client, %v",err)
- }
- log.Fatal(c.StartReceiver(context.Background(),receive))
- }
-
-
-
Create a new file named eventschemas.go and paste the following code. This
-defines the data schema of the CloudEvents.
-
packagemain
-
- // HelloWorld defines the Data of CloudEvent with type=dev.knative.samples.helloworld
-typeHelloWorldstruct{
- // Msg holds the message from the event
-Msgstring`json:"msg,omitempty,string"`
- }
-
- // HiFromKnative defines the Data of CloudEvent with type=dev.knative.samples.hifromknative
-typeHiFromKnativestruct{
- // Msg holds the message from the event
-Msgstring`json:"msg,omitempty,string"`
- }
-
-
-
In your project directory, create a file named Dockerfile and copy the code
-block below into it. For detailed instructions on dockerizing a Go app, see
-Deploying Go servers with Docker.
-
# Use the official Golang image to create a build artifact.
-# This is based on Debian and sets the GOPATH to /go.
-# https://hub.docker.com/_/golang
- FROM golang:1.14 as builder
-
-# Copy local code to the container image.
- WORKDIR /app
-
-# Retrieve application dependencies using go modules.
-# Allows container builds to reuse downloaded dependencies.
- COPY go.* ./
- RUN go mod download
-
-# Copy local code to the container image.
- COPY . ./
-
-# Build the binary.
-# -mod=readonly ensures immutable go.mod and go.sum in container builds.
- RUN CGO_ENABLED=0GOOS=linux go build -mod=readonly -v -o helloworld
-
-# Use a Docker multi-stage build to create a lean production image.
-# https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds
- FROM alpine:3
- RUN apk add --no-cache ca-certificates
-
-# Copy the binary to the production image from the builder stage.
- COPY --from=builder /app/helloworld /helloworld
-
-# Run the web service on container startup.
- CMD ["/helloworld"]
-
-
-
Create a new file, sample-app.yaml and copy the following service
-definition into the file. Make sure to replace {username} with your Docker
-Hub username.
-
# Namespace for sample application
-apiVersion:v1
-kind:Namespace
-metadata:
-name:knative-samples
----
-# A default broker
-apiVersion:eventing.knative.dev/v1
-kind:Broker
-metadata:
-name:default
-namespace:knative-samples
-spec:{}
----
-# Helloworld-go app deploment
-apiVersion:apps/v1
-kind:Deployment
-metadata:
-name:helloworld-go
-namespace:knative-samples
-spec:
-replicas:1
-selector:
-matchLabels:&labels
-app:helloworld-go
-template:
-metadata:
-labels:*labels
-spec:
-containers:
-- name:helloworld-go
-image:docker.io/{username}/helloworld-go
-
----
-# Service that exposes helloworld-go app.
-# This will be the subscriber for the Trigger
-kind:Service
-apiVersion:v1
-metadata:
-name:helloworld-go
-namespace:knative-samples
-spec:
-selector:
-app:helloworld-go
-ports:
-- protocol:TCP
-port:80
-targetPort:8080
----
-# Knative Eventing Trigger to trigger the helloworld-go service
-apiVersion:eventing.knative.dev/v1
-kind:Trigger
-metadata:
-name:helloworld-go
-namespace:knative-samples
-spec:
-broker:default
-filter:
-attributes:
-type:dev.knative.samples.helloworld
-source:dev.knative.samples/helloworldsource
-subscriber:
-ref:
-apiVersion:v1
-kind:Service
-name:helloworld-go
-
go mod init github.com/knative/docs/docs/serving/samples/hello-world/helloworld-go
-
-
-
Building and deploying the sample
-
Once you have recreated the sample code files (or used the files in the sample
-folder) you’re ready to build and deploy the sample app.
-
-
-
Use Docker to build the sample code into a container. To build and push with
-Docker Hub, run these commands replacing {username} with your Docker Hub
-username:
-
# Build the container on your local machine
-docker build -t {username}/helloworld-go .
-
-# Push the container to docker registry
-docker push {username}/helloworld-go
-
-
-
After the build has completed and the container is pushed to docker hub, you
-can deploy the sample application into your cluster. Ensure that the
-container image value in sample-app.yaml matches the container you built in
-the previous step. Apply the configuration using kubectl:
-
kubectl apply --filename sample-app.yaml
-
-
-
Above command created a namespace knative-samples and create a default
-Broker it. Verify using the following command:
-
kubectl get broker --namespace knative-samples
-
Note: you can also use injection based on labels with the
-Eventing sugar controller.
-For how to install the Eventing sugar controller, see
-Install optional Eventing extensions.
-
-
-
It deployed the helloworld-go app as a K8s Deployment and created a K8s
-service names helloworld-go. Verify using the following command.
-
kubectl --namespace knative-samples get deployments helloworld-go
-
-kubectl --namespace knative-samples get svc helloworld-go
-
-
-
It created a Knative Eventing Trigger to route certain events to the
-helloworld-go application. Make sure that Ready=true
-
kubectl --namespace knative-samples get trigger helloworld-go
-
-
-
-
-
Send and verify CloudEvents
-
Once you have deployed the application and verified that the namespace, sample
-application and trigger are ready, let’s send a CloudEvent.
-
Send CloudEvent to the Broker
-
We can send an http request directly to the Broker
-with correct CloudEvent headers set.
-
-
-
Deploy a curl pod and SSH into it
-
kubectl --namespace knative-samples run curl --image=radial/busyboxplus:curl -it
-
-
-
Get the Broker URL
-
kubectl --namespace knative-samples get broker default
-
-
-
Run the following in the SSH terminal. Please replace the URL with the URL of
-the default broker.
-
curl -v "http://broker-ingress.knative-eventing.svc.cluster.local/knative-samples/default"\
- -X POST \
- -H "Ce-Id: 536808d3-88be-4077-9d7a-a3f162705f79"\
- -H "Ce-Specversion: 1.0"\
- -H "Ce-Type: dev.knative.samples.helloworld"\
- -H "Ce-Source: dev.knative.samples/helloworldsource"\
- -H "Content-Type: application/json"\
- -d '{"msg":"Hello World from the curl pod."}'
-
-exit
-
-
-
Verify that event is received by helloworld-go app
-
Helloworld-go app logs the context and the msg of the above event, and replies
-back with another event.
Event received.
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: dev.knative.samples.helloworld
- source: dev.knative.samples/helloworldsource
- id: 536808d3-88be-4077-9d7a-a3f162705f79
- time: 2019-10-04T22:35:26.05871736Z
- datacontenttype: application/json
-Extensions,
- knativearrivaltime: 2019-10-04T22:35:26Z
- knativehistory: default-kn2-trigger-kn-channel.knative-samples.svc.cluster.local
- traceparent: 00-971d4644229653483d38c46e92a959c7-92c66312e4bb39be-00
-Data,
- {"msg":"Hello World from the curl pod."}
-
-Hello World Message "Hello World from the curl pod."
-Responded with event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: dev.knative.samples.hifromknative
- source: knative/eventing/samples/hello-world
- id: 37458d77-01f5-411e-a243-a459bbf79682
- datacontenttype: application/json
-Data,
- {"msg":"Hi from Knative!"}
-
-
Play around with the CloudEvent attributes in the curl command and the
-trigger specification to understand how
-Triggers work.
-
-
-
Verify reply from helloworld-go app
-
helloworld-go app replies back with an event of
-type= dev.knative.samples.hifromknative, and
-source=knative/eventing/samples/hello-world. This event enters the eventing
-mesh via the Broker and can be delivered to other services using a Trigger
-
-
-
Deploy a pod that receives any CloudEvent and logs the event to its output.
Note: You could use the above approach to test your applications too.
-
Removing the sample app deployment
-
To remove the sample app from your cluster, delete the service record:
-
kubectl delete --filename sample-app.yaml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
A simple web app written in Python that you can use to test knative eventing. It shows how to consume a CloudEvent in Knative eventing, and optionally how to respond back with another CloudEvent in the http response, by adding the Cloud Eventing headers outlined in the Cloud Events standard definition.
Follow the steps below to create the sample code and then deploy the app to your
-cluster. You can also download a working copy of the sample, by running the
-following commands:
-
# Clone the relevant branch version such as "release-0.13"
-git clone -b "{{< branch >}}" https://github.com/knative/docs knative-docs
-cd knative-docs/docs/eventing/samples/helloworld/helloworld-python
-
Add a requirements.txt file containing the following contents:
-
Flask==1.1.1
-
-
-
In your project directory, create a file named Dockerfile and copy the code
-block below into it. For detailed instructions on dockerizing a Go app, see
-Deploying Go servers with Docker.
Create a new file, sample-app.yaml and copy the following service definition
-into the file. Make sure to replace {username} with your Docker Hub
-username.
-
# Namespace for sample application with eventing enabled
-apiVersion:v1
-kind:Namespace
-metadata:
-name:knative-samples
-labels:
-eventing.knative.dev/injection:enabled
----
-# Helloworld-python app deploment
-apiVersion:apps/v1
-kind:Deployment
-metadata:
-name:helloworld-python
-namespace:knative-samples
-spec:
-replicas:1
-selector:
-matchLabels:&labels
-app:helloworld-python
-template:
-metadata:
-labels:*labels
-spec:
-containers:
-- name:helloworld-python
-image:docker.io/{username}/helloworld-python
-imagePullPolicy:IfNotPresent
----
-# Service that exposes helloworld-python app.
-# This will be the subscriber for the Trigger
-kind:Service
-apiVersion:v1
-metadata:
-name:helloworld-python
-namespace:knative-samples
-spec:
-selector:
-app:helloworld-python
-ports:
-- protocol:TCP
-port:80
-targetPort:8080
----
-# Knative Eventing Trigger to trigger the helloworld-python service
-apiVersion:eventing.knative.dev/v1
-kind:Trigger
-metadata:
-name:helloworld-python
-namespace:knative-samples
-spec:
-broker:default
-filter:
-attributes:
-type:dev.knative.samples.helloworld
-source:dev.knative.samples/helloworldsource
-subscriber:
-ref:
-apiVersion:v1
-kind:Service
-name:helloworld-python
-
-
-
Building and deploying the sample
-
Once you have recreated the sample code files (or used the files in the sample
-folder) you’re ready to build and deploy the sample app.
-
-
-
Use Docker to build the sample code into a container. To build and push with
-Docker Hub, run these commands replacing {username} with your Docker Hub
-username:
-
# Build the container on your local machine
-docker build -t {username}/helloworld-python .
-
-# Push the container to docker registry
-docker push {username}/helloworld-python
-
-
-
After the build has completed and the container is pushed to Docker Hub, you
-can deploy the sample application into your cluster. Ensure that the container image value
-in sample-app.yaml matches the container you built in the previous step. Apply
-the configuration using kubectl:
-
kubectl apply --filename sample-app.yaml
-
-
Above command created a namespace knative-samples and labelled it with knative-eventing-injection=enabled, to enable eventing in the namespace. Verify using the following command:
-
kubectl get ns knative-samples --show-labels
-
-
It deployed the helloworld-python app as a K8s Deployment and created a K8s service names helloworld-python. Verify using the following command.
-
kubectl --namespace knative-samples get deployments helloworld-python
-kubectl --namespace knative-samples get svc helloworld-python
-
-
It created a Knative Eventing Trigger to route certain events to the helloworld-python application. Make sure that Ready=true
-
kubectl --namespace knative-samples get trigger helloworld-python
-
-
-
-
-
Send and verify CloudEvents
-
After you have deployed the application, and have verified that the namespace, sample application and trigger are ready, you can send a CloudEvent.
-
Send CloudEvent to the Broker
-
You can send an HTTP request directly to the Knative broker if the correct CloudEvent headers are set.
-
-
Deploy a curl pod and SSH into it
-
kubectl --namespace knative-samples run curl --image=radial/busyboxplus:curl -it
-
-
Run the following in the SSH terminal
-
curl -v "default-broker.knative-samples.svc.cluster.local"\
--X POST \
--H "Ce-Id: 536808d3-88be-4077-9d7a-a3f162705f79"\
--H "Ce-specversion: 0.3"\
--H "Ce-Type: dev.knative.samples.helloworld"\
--H "Ce-Source: dev.knative.samples/helloworldsource"\
--H "Content-Type: application/json"\
--d '{"msg":"Hello World from the curl pod."}'
-
-exit
-
-
-
Verify that event is received by helloworld-python app
-
Helloworld-python app logs the context and the msg of the above event, and replies back with another event.
Try the CloudEvent attributes in the curl command and the trigger specification to understand how triggers work.
-
Verify reply from helloworld-python app
-
The helloworld-python app replies with an event type type= dev.knative.samples.hifromknative, and source source=knative/eventing/samples/hello-world. The event enters the eventing mesh through the broker, and can be delivered to event sinks using a trigger
-
-
-
Deploy a pod that receives any CloudEvent and logs the event to its output.
-
kubectl --namespace knative-samples apply --filename - << END
-# event-display app deploment
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: event-display
- namespace: knative-samples
-spec:
- replicas: 1
- selector:
- matchLabels: &labels
- app: event-display
- template:
- metadata:
- labels: *labels
- spec:
- containers:
- - name: helloworld-python
- image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display
----
-# Service that exposes event-display app.
-# This will be the subscriber for the Trigger
-kind: Service
-apiVersion: v1
-metadata:
- name: event-display
- namespace: knative-samples
-spec:
- selector:
- app: event-display
- ports:
- - protocol: TCP
- port: 80
- targetPort: 8080
-END
-
-
-
Create a trigger to deliver the event to the above service
Note: You could use the above approach to test your applications too.
-
Removing the sample app deployment
-
To remove the sample app from your cluster, delete the service record:
-
kubectl delete --filename sample-app.yaml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Following examples include a simple web app written in the language of your choice that you can
-use to test knative eventing. It shows how to consume a CloudEvent
-in Knative eventing, and optionally how to respond back with another CloudEvent in the HTTP response.
If you decide to deploy the app as a Knative Serving Service then you will have to install
-Knative Serving.
-
-
-
Docker installed and running on your local machine,
-and a Docker Hub account configured (we’ll use it for a container registry).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/samples/helloworld/index.xml b/archived/v0.22-docs/eventing/samples/helloworld/index.xml
deleted file mode 100644
index 51d6f6de9..000000000
--- a/archived/v0.22-docs/eventing/samples/helloworld/index.xml
+++ /dev/null
@@ -1,765 +0,0 @@
-
-
- Knative – Knative Eventing - Hello World app
- https://knative.dev/v0.22-docs/eventing/samples/helloworld/
- Recent content in Knative Eventing - Hello World app on Knative
- Hugo -- gohugo.io
-
-
-
-
-
-
-
-
-
-
- V0.22-Docs: Hello World - Golang
- https://knative.dev/v0.22-docs/eventing/samples/helloworld/helloworld-go/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/helloworld/helloworld-go/
-
-
-
- <p>A simple web app written in Go that you can use to test knative eventing. It
-shows how to consume a <a href="https://cloudevents.io/">CloudEvent</a> in Knative
-eventing, and optionally how to respond back with another CloudEvent in the http
-response, using the
-<a href="https://github.com/cloudevents/sdk-go">Go SDK for CloudEvents</a></p>
-<p>We will deploy the app as a
-<a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/">Kubernetes Deployment</a>
-along with a
-<a href="https://kubernetes.io/docs/concepts/services-networking/service/">Kubernetes Service</a>.
-However, you can also deploy the app as a
-<a href="../../../../serving/index.html">Knative Serving Service</a>.</p>
-<p>Follow the steps below to create the sample code and then deploy the app to your
-cluster. You can also download a working copy of the sample, by running the
-following commands:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">git clone -b <span style="color:#4e9a06">"{{< branch >}}"</span> https://github.com/knative/docs knative-docs
-<span style="color:#204a87">cd</span> knative-docs/docs/eventing/samples/helloworld/helloworld-go
-</code></pre></div><h2 id="before-you-begin">Before you begin</h2>
-<ul>
-<li>A Kubernetes cluster with
-<a href="../../../getting-started#installing-knative-eventing">Knative Eventing</a>
-installed.</li>
-<li><a href="https://www.docker.com">Docker</a> installed and running on your local machine,
-and a Docker Hub account configured (we’ll use it for a container registry).</li>
-</ul>
-<h2 id="recreating-the-sample-code">Recreating the sample code</h2>
-<ol>
-<li>
-<p>Create a new file named <code>helloworld.go</code> and paste the following code. This
-code creates a basic web server which listens on port 8080:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"> <span style="color:#204a87;font-weight:bold">import</span> <span style="color:#000;font-weight:bold">(</span>
- <span style="color:#4e9a06">"context"</span>
- <span style="color:#4e9a06">"log"</span>
-
- <span style="color:#000">cloudevents</span> <span style="color:#4e9a06">"github.com/cloudevents/sdk-go/v2"</span>
- <span style="color:#4e9a06">"github.com/google/uuid"</span>
- <span style="color:#000;font-weight:bold">)</span>
-
- <span style="color:#204a87;font-weight:bold">func</span> <span style="color:#000">receive</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">ctx</span> <span style="color:#000">context</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Context</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">event</span> <span style="color:#000">cloudevents</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Event</span><span style="color:#000;font-weight:bold">)</span> <span style="color:#000;font-weight:bold">(</span><span style="color:#ce5c00;font-weight:bold">*</span><span style="color:#000">cloudevents</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Event</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">cloudevents</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Result</span><span style="color:#000;font-weight:bold">)</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#8f5902;font-style:italic">// Here is where your code to process the event will go.
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#8f5902;font-style:italic">// In this example we will log the event msg
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000">log</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Printf</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"Event received. \n%s\n"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">event</span><span style="color:#000;font-weight:bold">)</span>
- <span style="color:#000">data</span> <span style="color:#ce5c00;font-weight:bold">:=</span> <span style="color:#ce5c00;font-weight:bold">&</span><span style="color:#000">HelloWorld</span><span style="color:#000;font-weight:bold">{}</span>
- <span style="color:#204a87;font-weight:bold">if</span> <span style="color:#000">err</span> <span style="color:#ce5c00;font-weight:bold">:=</span> <span style="color:#000">event</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">DataAs</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">data</span><span style="color:#000;font-weight:bold">);</span> <span style="color:#000">err</span> <span style="color:#ce5c00;font-weight:bold">!=</span> <span style="color:#204a87;font-weight:bold">nil</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">log</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Printf</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"Error while extracting cloudevent Data: %s\n"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">err</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Error</span><span style="color:#000;font-weight:bold">())</span>
- <span style="color:#204a87;font-weight:bold">return</span> <span style="color:#204a87;font-weight:bold">nil</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">cloudevents</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">NewHTTPResult</span><span style="color:#000;font-weight:bold">(</span><span style="color:#0000cf;font-weight:bold">400</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#4e9a06">"failed to convert data: %s"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">err</span><span style="color:#000;font-weight:bold">)</span>
- <span style="color:#000;font-weight:bold">}</span>
- <span style="color:#000">log</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Printf</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"Hello World Message from received event %q"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">data</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Msg</span><span style="color:#000;font-weight:bold">)</span>
-
- <span style="color:#8f5902;font-style:italic">// Respond with another event (optional)
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#8f5902;font-style:italic">// This is optional and is intended to show how to respond back with another event after processing.
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#8f5902;font-style:italic">// The response will go back into the knative eventing system just like any other event
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000">newEvent</span> <span style="color:#ce5c00;font-weight:bold">:=</span> <span style="color:#000">cloudevents</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">NewEvent</span><span style="color:#000;font-weight:bold">()</span>
- <span style="color:#000">newEvent</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">SetID</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">uuid</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">New</span><span style="color:#000;font-weight:bold">().</span><span style="color:#000">String</span><span style="color:#000;font-weight:bold">())</span>
- <span style="color:#000">newEvent</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">SetSource</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"knative/eventing/samples/hello-world"</span><span style="color:#000;font-weight:bold">)</span>
- <span style="color:#000">newEvent</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">SetType</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"dev.knative.samples.hifromknative"</span><span style="color:#000;font-weight:bold">)</span>
- <span style="color:#204a87;font-weight:bold">if</span> <span style="color:#000">err</span> <span style="color:#ce5c00;font-weight:bold">:=</span> <span style="color:#000">newEvent</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">SetData</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">cloudevents</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">ApplicationJSON</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">HiFromKnative</span><span style="color:#000;font-weight:bold">{</span><span style="color:#000">Msg</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">"Hi from helloworld-go app!"</span><span style="color:#000;font-weight:bold">});</span> <span style="color:#000">err</span> <span style="color:#ce5c00;font-weight:bold">!=</span> <span style="color:#204a87;font-weight:bold">nil</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#204a87;font-weight:bold">return</span> <span style="color:#204a87;font-weight:bold">nil</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">cloudevents</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">NewHTTPResult</span><span style="color:#000;font-weight:bold">(</span><span style="color:#0000cf;font-weight:bold">500</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#4e9a06">"failed to set response data: %s"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">err</span><span style="color:#000;font-weight:bold">)</span>
- <span style="color:#000;font-weight:bold">}</span>
- <span style="color:#000">log</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Printf</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"Responding with event\n%s\n"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">newEvent</span><span style="color:#000;font-weight:bold">)</span>
- <span style="color:#204a87;font-weight:bold">return</span> <span style="color:#ce5c00;font-weight:bold">&</span><span style="color:#000">newEvent</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#204a87;font-weight:bold">nil</span>
- <span style="color:#000;font-weight:bold">}</span>
-
- <span style="color:#204a87;font-weight:bold">func</span> <span style="color:#000">main</span><span style="color:#000;font-weight:bold">()</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">log</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Print</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"Hello world sample started."</span><span style="color:#000;font-weight:bold">)</span>
- <span style="color:#000">c</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">err</span> <span style="color:#ce5c00;font-weight:bold">:=</span> <span style="color:#000">cloudevents</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">NewDefaultClient</span><span style="color:#000;font-weight:bold">()</span>
- <span style="color:#204a87;font-weight:bold">if</span> <span style="color:#000">err</span> <span style="color:#ce5c00;font-weight:bold">!=</span> <span style="color:#204a87;font-weight:bold">nil</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">log</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Fatalf</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"failed to create client, %v"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">err</span><span style="color:#000;font-weight:bold">)</span>
- <span style="color:#000;font-weight:bold">}</span>
- <span style="color:#000">log</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Fatal</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">c</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">StartReceiver</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">context</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Background</span><span style="color:#000;font-weight:bold">(),</span> <span style="color:#000">receive</span><span style="color:#000;font-weight:bold">))</span>
- <span style="color:#000;font-weight:bold">}</span>
-</code></pre></div></li>
-<li>
-<p>Create a new file named <code>eventschemas.go</code> and paste the following code. This
-defines the data schema of the CloudEvents.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"> <span style="color:#204a87;font-weight:bold">package</span> <span style="color:#000">main</span>
-
- <span style="color:#8f5902;font-style:italic">// HelloWorld defines the Data of CloudEvent with type=dev.knative.samples.helloworld
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#204a87;font-weight:bold">type</span> <span style="color:#000">HelloWorld</span> <span style="color:#204a87;font-weight:bold">struct</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#8f5902;font-style:italic">// Msg holds the message from the event
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000">Msg</span> <span style="color:#204a87;font-weight:bold">string</span> <span style="color:#4e9a06">`json:"msg,omitempty,string"`</span>
- <span style="color:#000;font-weight:bold">}</span>
-
- <span style="color:#8f5902;font-style:italic">// HiFromKnative defines the Data of CloudEvent with type=dev.knative.samples.hifromknative
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#204a87;font-weight:bold">type</span> <span style="color:#000">HiFromKnative</span> <span style="color:#204a87;font-weight:bold">struct</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#8f5902;font-style:italic">// Msg holds the message from the event
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000">Msg</span> <span style="color:#204a87;font-weight:bold">string</span> <span style="color:#4e9a06">`json:"msg,omitempty,string"`</span>
- <span style="color:#000;font-weight:bold">}</span>
-</code></pre></div></li>
-<li>
-<p>In your project directory, create a file named <code>Dockerfile</code> and copy the code
-block below into it. For detailed instructions on dockerizing a Go app, see
-<a href="https://blog.golang.org/docker">Deploying Go servers with Docker</a>.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-docker" data-lang="docker"> <span style="color:#8f5902;font-style:italic"># Use the official Golang image to create a build artifact.</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span> <span style="color:#8f5902;font-style:italic"># This is based on Debian and sets the GOPATH to /go.</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span> <span style="color:#8f5902;font-style:italic"># https://hub.docker.com/_/golang</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span> FROM golang:1.14 as builder<span style="color:#a40000">
-</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span> <span style="color:#8f5902;font-style:italic"># Copy local code to the container image.</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span> WORKDIR /app<span style="color:#a40000">
-</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span> <span style="color:#8f5902;font-style:italic"># Retrieve application dependencies using go modules.</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span> <span style="color:#8f5902;font-style:italic"># Allows container builds to reuse downloaded dependencies.</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span> COPY go.* ./<span style="color:#a40000">
-</span><span style="color:#a40000"></span> RUN go mod download<span style="color:#a40000">
-</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span> <span style="color:#8f5902;font-style:italic"># Copy local code to the container image.</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span> COPY . ./<span style="color:#a40000">
-</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span> <span style="color:#8f5902;font-style:italic"># Build the binary.</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span> <span style="color:#8f5902;font-style:italic"># -mod=readonly ensures immutable go.mod and go.sum in container builds.</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span> RUN <span style="color:#000">CGO_ENABLED</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#0000cf;font-weight:bold">0</span> <span style="color:#000">GOOS</span><span style="color:#ce5c00;font-weight:bold">=</span>linux go build -mod<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#204a87">readonly</span> -v -o helloworld<span style="color:#a40000">
-</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span> <span style="color:#8f5902;font-style:italic"># Use a Docker multi-stage build to create a lean production image.</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span> <span style="color:#8f5902;font-style:italic"># https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span> FROM alpine:3<span style="color:#a40000">
-</span><span style="color:#a40000"></span> RUN apk add --no-cache ca-certificates<span style="color:#a40000">
-</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span> <span style="color:#8f5902;font-style:italic"># Copy the binary to the production image from the builder stage.</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span> COPY --from<span style="color:#ce5c00;font-weight:bold">=</span>builder /app/helloworld /helloworld<span style="color:#a40000">
-</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span> <span style="color:#8f5902;font-style:italic"># Run the web service on container startup.</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span> CMD <span style="color:#ce5c00;font-weight:bold">[</span><span style="color:#4e9a06">"/helloworld"</span><span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#a40000">
-</span></code></pre></div></li>
-<li>
-<p>Create a new file, <code>sample-app.yaml</code> and copy the following service
-definition into the file. Make sure to replace <code>{username}</code> with your Docker
-Hub username.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># Namespace for sample application</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Namespace</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-samples</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># A default broker</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Broker</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-samples</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{}<span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># Helloworld-go app deploment</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">helloworld-go</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-samples</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">replicas</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">selector</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">matchLabels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic">&labels</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">helloworld-go</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic">*labels</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">helloworld-go</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">docker.io/{username}/helloworld-go</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># Service that exposes helloworld-go app.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># This will be the subscriber for the Trigger</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">helloworld-go</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-samples</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">selector</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">helloworld-go</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ports</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">protocol</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">TCP</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">port</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">80</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">targetPort</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">8080</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># Knative Eventing Trigger to trigger the helloworld-go service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Trigger</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">helloworld-go</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-samples</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">broker</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">filter</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">attributes</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">dev.knative.samples.helloworld</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">source</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">dev.knative.samples/helloworldsource</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">subscriber</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">helloworld-go</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>
-<p>Use the go tool to create a
-<a href="https://github.com/golang/go/wiki/Modules#gomod"><code>go.mod</code></a> manifest.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">go mod init github.com/knative/docs/docs/serving/samples/hello-world/helloworld-go
-</code></pre></div></li>
-</ol>
-<h2 id="building-and-deploying-the-sample">Building and deploying the sample</h2>
-<p>Once you have recreated the sample code files (or used the files in the sample
-folder) you’re ready to build and deploy the sample app.</p>
-<ol>
-<li>
-<p>Use Docker to build the sample code into a container. To build and push with
-Docker Hub, run these commands replacing <code>{username}</code> with your Docker Hub
-username:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#8f5902;font-style:italic"># Build the container on your local machine</span>
-docker build -t <span style="color:#ce5c00;font-weight:bold">{</span>username<span style="color:#ce5c00;font-weight:bold">}</span>/helloworld-go .
-
-<span style="color:#8f5902;font-style:italic"># Push the container to docker registry</span>
-docker push <span style="color:#ce5c00;font-weight:bold">{</span>username<span style="color:#ce5c00;font-weight:bold">}</span>/helloworld-go
-</code></pre></div></li>
-<li>
-<p>After the build has completed and the container is pushed to docker hub, you
-can deploy the sample application into your cluster. Ensure that the
-container image value in <code>sample-app.yaml</code> matches the container you built in
-the previous step. Apply the configuration using <code>kubectl</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply --filename sample-app.yaml
-</code></pre></div><ol>
-<li>
-<p>Above command created a namespace <code>knative-samples</code> and create a default
-Broker it. Verify using the following command:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl get broker --namespace knative-samples
-</code></pre></div><p><strong>Note:</strong> you can also use injection based on labels with the
-Eventing sugar controller.
-For how to install the Eventing sugar controller, see
-<a href="../../../../install/install-extensions#install-optional-eventing-extensions">Install optional Eventing extensions</a>.</p>
-</li>
-<li>
-<p>It deployed the helloworld-go app as a K8s Deployment and created a K8s
-service names helloworld-go. Verify using the following command.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-samples get deployments helloworld-go
-
-kubectl --namespace knative-samples get svc helloworld-go
-</code></pre></div></li>
-<li>
-<p>It created a Knative Eventing Trigger to route certain events to the
-helloworld-go application. Make sure that Ready=true</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-samples get trigger helloworld-go
-</code></pre></div></li>
-</ol>
-</li>
-</ol>
-<h2 id="send-and-verify-cloudevents">Send and verify CloudEvents</h2>
-<p>Once you have deployed the application and verified that the namespace, sample
-application and trigger are ready, let’s send a CloudEvent.</p>
-<h3 id="send-cloudevent-to-the-broker">Send CloudEvent to the Broker</h3>
-<p>We can send an http request directly to the <a href="../../../broker/README.md">Broker</a>
-with correct CloudEvent headers set.</p>
-<ol>
-<li>
-<p>Deploy a curl pod and SSH into it</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-samples run curl --image<span style="color:#ce5c00;font-weight:bold">=</span>radial/busyboxplus:curl -it
-</code></pre></div></li>
-<li>
-<p>Get the Broker URL</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-samples get broker default
-</code></pre></div></li>
-<li>
-<p>Run the following in the SSH terminal. Please replace the URL with the URL of
-the default broker.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">curl -v <span style="color:#4e9a06">"http://broker-ingress.knative-eventing.svc.cluster.local/knative-samples/default"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -X POST <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -H <span style="color:#4e9a06">"Ce-Id: 536808d3-88be-4077-9d7a-a3f162705f79"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -H <span style="color:#4e9a06">"Ce-Specversion: 1.0"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -H <span style="color:#4e9a06">"Ce-Type: dev.knative.samples.helloworld"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -H <span style="color:#4e9a06">"Ce-Source: dev.knative.samples/helloworldsource"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -H <span style="color:#4e9a06">"Content-Type: application/json"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -d <span style="color:#4e9a06">'{"msg":"Hello World from the curl pod."}'</span>
-
-<span style="color:#204a87">exit</span>
-</code></pre></div></li>
-</ol>
-<h3 id="verify-that-event-is-received-by-helloworld-go-app">Verify that event is received by helloworld-go app</h3>
-<p>Helloworld-go app logs the context and the msg of the above event, and replies
-back with another event.</p>
-<ol>
-<li>
-<p>Display helloworld-go app logs</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-samples logs -l <span style="color:#000">app</span><span style="color:#ce5c00;font-weight:bold">=</span>helloworld-go --tail<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#0000cf;font-weight:bold">50</span>
-</code></pre></div><p>You should see something similar to:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">Event received.
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: dev.knative.samples.helloworld
- source: dev.knative.samples/helloworldsource
- id: 536808d3-88be-4077-9d7a-a3f162705f79
- time: 2019-10-04T22:35:26.05871736Z
- datacontenttype: application/json
-Extensions,
- knativearrivaltime: 2019-10-04T22:35:26Z
- knativehistory: default-kn2-trigger-kn-channel.knative-samples.svc.cluster.local
- traceparent: 00-971d4644229653483d38c46e92a959c7-92c66312e4bb39be-00
-Data,
- <span style="color:#ce5c00;font-weight:bold">{</span><span style="color:#4e9a06">"msg"</span>:<span style="color:#4e9a06">"Hello World from the curl pod."</span><span style="color:#ce5c00;font-weight:bold">}</span>
-
-Hello World Message <span style="color:#4e9a06">"Hello World from the curl pod."</span>
-Responded with event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: dev.knative.samples.hifromknative
- source: knative/eventing/samples/hello-world
- id: 37458d77-01f5-411e-a243-a459bbf79682
- datacontenttype: application/json
-Data,
- <span style="color:#ce5c00;font-weight:bold">{</span><span style="color:#4e9a06">"msg"</span>:<span style="color:#4e9a06">"Hi from Knative!"</span><span style="color:#ce5c00;font-weight:bold">}</span>
-
-</code></pre></div><p>Play around with the CloudEvent attributes in the curl command and the
-trigger specification to understand how
-<a href="../../../broker/index.html#trigger">Triggers work</a>.</p>
-</li>
-</ol>
-<h2 id="verify-reply-from-helloworld-go-app">Verify reply from helloworld-go app</h2>
-<p><code>helloworld-go</code> app replies back with an event of
-<code>type= dev.knative.samples.hifromknative</code>, and
-<code>source=knative/eventing/samples/hello-world</code>. This event enters the eventing
-mesh via the Broker and can be delivered to other services using a Trigger</p>
-<ol>
-<li>
-<p>Deploy a pod that receives any CloudEvent and logs the event to its output.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-samples apply --filename - <span style="color:#4e9a06"><< END
-</span><span style="color:#4e9a06"># event-display app deploment
-</span><span style="color:#4e9a06">apiVersion: apps/v1
-</span><span style="color:#4e9a06">kind: Deployment
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06"> namespace: knative-samples
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> replicas: 1
-</span><span style="color:#4e9a06"> selector:
-</span><span style="color:#4e9a06"> matchLabels: &labels
-</span><span style="color:#4e9a06"> app: event-display
-</span><span style="color:#4e9a06"> template:
-</span><span style="color:#4e9a06"> metadata:
-</span><span style="color:#4e9a06"> labels: *labels
-</span><span style="color:#4e9a06"> spec:
-</span><span style="color:#4e9a06"> containers:
-</span><span style="color:#4e9a06"> - name: helloworld-go
-</span><span style="color:#4e9a06"> # Source code: https://github.com/knative/eventing-contrib/tree/main/cmd/event_display
-</span><span style="color:#4e9a06"> image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display
-</span><span style="color:#4e9a06">---
-</span><span style="color:#4e9a06"># Service that exposes event-display app.
-</span><span style="color:#4e9a06"># This will be the subscriber for the Trigger
-</span><span style="color:#4e9a06">kind: Service
-</span><span style="color:#4e9a06">apiVersion: v1
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06"> namespace: knative-samples
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> selector:
-</span><span style="color:#4e9a06"> app: event-display
-</span><span style="color:#4e9a06"> ports:
-</span><span style="color:#4e9a06"> - protocol: TCP
-</span><span style="color:#4e9a06"> port: 80
-</span><span style="color:#4e9a06"> targetPort: 8080
-</span><span style="color:#4e9a06">END</span>
-</code></pre></div></li>
-<li>
-<p>Create a trigger to deliver the event to the above service</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-samples apply --filename - <span style="color:#4e9a06"><< END
-</span><span style="color:#4e9a06">apiVersion: eventing.knative.dev/v1
-</span><span style="color:#4e9a06">kind: Trigger
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06"> namespace: knative-samples
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> broker: default
-</span><span style="color:#4e9a06"> filter:
-</span><span style="color:#4e9a06"> attributes:
-</span><span style="color:#4e9a06"> type: dev.knative.samples.hifromknative
-</span><span style="color:#4e9a06"> source: knative/eventing/samples/hello-world
-</span><span style="color:#4e9a06"> subscriber:
-</span><span style="color:#4e9a06"> ref:
-</span><span style="color:#4e9a06"> apiVersion: v1
-</span><span style="color:#4e9a06"> kind: Service
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06">END</span>
-</code></pre></div></li>
-<li>
-<p><a href="###Send-CloudEvent-to-the-Broker">Send a CloudEvent to the Broker</a></p>
-</li>
-<li>
-<p>Check the logs of event-display service</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-samples logs -l <span style="color:#000">app</span><span style="color:#ce5c00;font-weight:bold">=</span>event-display --tail<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#0000cf;font-weight:bold">50</span>
-</code></pre></div><p>You should see something similar to:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"> cloudevents.Event
- Validation: valid
- Context Attributes,
- specversion: 1.0
- type: dev.knative.samples.hifromknative
- source: knative/eventing/samples/hello-world
- id: 8a7384b9-8bbe-4634-bf0f-ead07e450b2a
- time: 2019-10-04T22:53:39.844943931Z
- datacontenttype: application/json
- Extensions,
- knativearrivaltime: 2019-10-04T22:53:39Z
- knativehistory: default-kn2-ingress-kn-channel.knative-samples.svc.cluster.local
- traceparent: 00-4b01db030b9ea04bb150b77c8fa86509-2740816590a7604f-00
- Data,
- <span style="color:#ce5c00;font-weight:bold">{</span>
- <span style="color:#4e9a06">"msg"</span>: <span style="color:#4e9a06">"Hi from helloworld-go app!"</span>
- <span style="color:#ce5c00;font-weight:bold">}</span>
-</code></pre></div></li>
-</ol>
-<p><strong>Note: You could use the above approach to test your applications too.</strong></p>
-<h2 id="removing-the-sample-app-deployment">Removing the sample app deployment</h2>
-<p>To remove the sample app from your cluster, delete the service record:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl delete --filename sample-app.yaml
-</code></pre></div>
-
-
-
-
- V0.22-Docs: Hello World - Python
- https://knative.dev/v0.22-docs/eventing/samples/helloworld/helloworld-python/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/helloworld/helloworld-python/
-
-
-
- <p>A simple web app written in Python that you can use to test knative eventing. It shows how to consume a <a href="https://cloudevents.io/">CloudEvent</a> in Knative eventing, and optionally how to respond back with another CloudEvent in the http response, by adding the Cloud Eventing headers outlined in the Cloud Events standard definition.</p>
-<p>We will deploy the app as a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/">Kubernetes Deployment</a> along with a <a href="https://kubernetes.io/docs/concepts/services-networking/service/">Kubernetes Service</a>.
-However, you can also deploy the app as a <a href="../../../../serving/index.html">Knative Serving Service</a>.</p>
-<p>Follow the steps below to create the sample code and then deploy the app to your
-cluster. You can also download a working copy of the sample, by running the
-following commands:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#8f5902;font-style:italic"># Clone the relevant branch version such as "release-0.13"</span>
-git clone -b <span style="color:#4e9a06">"{{< branch >}}"</span> https://github.com/knative/docs knative-docs
-<span style="color:#204a87">cd</span> knative-docs/docs/eventing/samples/helloworld/helloworld-python
-</code></pre></div><h2 id="before-you-begin">Before you begin</h2>
-<ul>
-<li>A Kubernetes cluster with <a href="../../../getting-started#installing-knative-eventing">Knative Eventing</a> installed.</li>
-<li><a href="https://www.docker.com">Docker</a> installed and running on your local machine,
-and a Docker Hub account configured (we’ll use it for a container registry).</li>
-</ul>
-<h2 id="recreating-the-sample-code">Recreating the sample code</h2>
-<ol>
-<li>
-<p>Create a new file named <code>helloworld.py</code> and paste the following code. This
-code creates a basic web server which listens on port 8080:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-python" data-lang="python"><span style="color:#204a87;font-weight:bold">from</span> <span style="color:#000">flask</span> <span style="color:#204a87;font-weight:bold">import</span> <span style="color:#000">Flask</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">request</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">make_response</span>
-<span style="color:#204a87;font-weight:bold">import</span> <span style="color:#000">uuid</span>
-
-<span style="color:#000">app</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">Flask</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">__name__</span><span style="color:#000;font-weight:bold">)</span>
-
-<span style="color:#5c35cc;font-weight:bold">@app.route</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">'/'</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">methods</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000;font-weight:bold">[</span><span style="color:#4e9a06">'POST'</span><span style="color:#000;font-weight:bold">])</span>
-<span style="color:#204a87;font-weight:bold">def</span> <span style="color:#000">hello_world</span><span style="color:#000;font-weight:bold">():</span>
- <span style="color:#000">app</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#000">logger</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#000">warning</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">request</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#000">data</span><span style="color:#000;font-weight:bold">)</span>
- <span style="color:#8f5902;font-style:italic"># Respond with another event (optional)</span>
- <span style="color:#000">response</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">make_response</span><span style="color:#000;font-weight:bold">({</span>
- <span style="color:#4e9a06">"msg"</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">"Hi from helloworld-python app!"</span>
- <span style="color:#000;font-weight:bold">})</span>
- <span style="color:#000">response</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#000">headers</span><span style="color:#000;font-weight:bold">[</span><span style="color:#4e9a06">"Ce-Id"</span><span style="color:#000;font-weight:bold">]</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#204a87">str</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">uuid</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#000">uuid4</span><span style="color:#000;font-weight:bold">())</span>
- <span style="color:#000">response</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#000">headers</span><span style="color:#000;font-weight:bold">[</span><span style="color:#4e9a06">"Ce-specversion"</span><span style="color:#000;font-weight:bold">]</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">"0.3"</span>
- <span style="color:#000">response</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#000">headers</span><span style="color:#000;font-weight:bold">[</span><span style="color:#4e9a06">"Ce-Source"</span><span style="color:#000;font-weight:bold">]</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">"knative/eventing/samples/hello-world"</span>
- <span style="color:#000">response</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#000">headers</span><span style="color:#000;font-weight:bold">[</span><span style="color:#4e9a06">"Ce-Type"</span><span style="color:#000;font-weight:bold">]</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">"dev.knative.samples.hifromknative"</span>
- <span style="color:#204a87;font-weight:bold">return</span> <span style="color:#000">response</span>
-
-<span style="color:#204a87;font-weight:bold">if</span> <span style="color:#000">__name__</span> <span style="color:#ce5c00;font-weight:bold">==</span> <span style="color:#4e9a06">'__main__'</span><span style="color:#000;font-weight:bold">:</span>
- <span style="color:#000">app</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#000">run</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">debug</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#3465a4">True</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">host</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">'0.0.0.0'</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">port</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#0000cf;font-weight:bold">8080</span><span style="color:#000;font-weight:bold">)</span>
-
-
-</code></pre></div></li>
-<li>
-<p>Add a requirements.txt file containing the following contents:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash"><span style="color:#000">Flask</span><span style="color:#ce5c00;font-weight:bold">==</span>1.1.1
-</code></pre></div></li>
-<li>
-<p>In your project directory, create a file named <code>Dockerfile</code> and copy the code
-block below into it. For detailed instructions on dockerizing a Go app, see
-<a href="https://blog.golang.org/docker">Deploying Go servers with Docker</a>.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-docker" data-lang="docker"><span style="color:#204a87;font-weight:bold">FROM</span><span style="color:#4e9a06"> python:alpine3.7</span><span style="color:#a40000">
-</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span><span style="color:#204a87;font-weight:bold">COPY</span> . /app<span style="color:#a40000">
-</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span><span style="color:#204a87;font-weight:bold">WORKDIR</span><span style="color:#4e9a06"> /app</span><span style="color:#a40000">
-</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span><span style="color:#204a87;font-weight:bold">RUN</span> pip install -r requirements.txt<span style="color:#a40000">
-</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span><span style="color:#204a87;font-weight:bold">EXPOSE</span><span style="color:#4e9a06"> 8080</span><span style="color:#a40000">
-</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span><span style="color:#204a87;font-weight:bold">ENTRYPOINT</span> <span style="color:#000;font-weight:bold">[</span> <span style="color:#4e9a06">"python"</span> <span style="color:#000;font-weight:bold">]</span><span style="color:#a40000">
-</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span><span style="color:#204a87;font-weight:bold">CMD</span> <span style="color:#000;font-weight:bold">[</span> <span style="color:#4e9a06">"helloworld.py"</span> <span style="color:#000;font-weight:bold">]</span><span style="color:#a40000">
-</span><span style="color:#a40000">
-</span></code></pre></div></li>
-<li>
-<p>Create a new file, <code>sample-app.yaml</code> and copy the following service definition
-into the file. Make sure to replace <code>{username}</code> with your Docker Hub
-username.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#8f5902;font-style:italic"># Namespace for sample application with eventing enabled</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Namespace</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-samples</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">eventing.knative.dev/injection</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">enabled</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># Helloworld-python app deploment</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">helloworld-python</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-samples</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">replicas</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">selector</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">matchLabels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic">&labels</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">helloworld-python</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic">*labels</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">helloworld-python</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">docker.io/{username}/helloworld-python</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">imagePullPolicy</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">IfNotPresent</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># Service that exposes helloworld-python app.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># This will be the subscriber for the Trigger</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">helloworld-python</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-samples</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">selector</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">helloworld-python</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ports</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">protocol</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">TCP</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">port</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">80</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">targetPort</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">8080</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># Knative Eventing Trigger to trigger the helloworld-python service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Trigger</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">helloworld-python</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-samples</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">broker</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">filter</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">attributes</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">dev.knative.samples.helloworld</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">source</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">dev.knative.samples/helloworldsource</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">subscriber</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">helloworld-python</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-</ol>
-<h2 id="building-and-deploying-the-sample">Building and deploying the sample</h2>
-<p>Once you have recreated the sample code files (or used the files in the sample
-folder) you’re ready to build and deploy the sample app.</p>
-<ol>
-<li>
-<p>Use Docker to build the sample code into a container. To build and push with
-Docker Hub, run these commands replacing <code>{username}</code> with your Docker Hub
-username:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#8f5902;font-style:italic"># Build the container on your local machine</span>
-docker build -t <span style="color:#ce5c00;font-weight:bold">{</span>username<span style="color:#ce5c00;font-weight:bold">}</span>/helloworld-python .
-
-<span style="color:#8f5902;font-style:italic"># Push the container to docker registry</span>
-docker push <span style="color:#ce5c00;font-weight:bold">{</span>username<span style="color:#ce5c00;font-weight:bold">}</span>/helloworld-python
-</code></pre></div></li>
-<li>
-<p>After the build has completed and the container is pushed to Docker Hub, you
-can deploy the sample application into your cluster. Ensure that the container image value
-in <code>sample-app.yaml</code> matches the container you built in the previous step. Apply
-the configuration using <code>kubectl</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply --filename sample-app.yaml
-</code></pre></div><ol>
-<li>Above command created a namespace <code>knative-samples</code> and labelled it with <code>knative-eventing-injection=enabled</code>, to enable eventing in the namespace. Verify using the following command:
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl get ns knative-samples --show-labels
-</code></pre></div></li>
-<li>It deployed the helloworld-python app as a K8s Deployment and created a K8s service names helloworld-python. Verify using the following command.
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-samples get deployments helloworld-python
-kubectl --namespace knative-samples get svc helloworld-python
-</code></pre></div></li>
-<li>It created a Knative Eventing Trigger to route certain events to the helloworld-python application. Make sure that Ready=true
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-samples get trigger helloworld-python
-</code></pre></div></li>
-</ol>
-</li>
-</ol>
-<h2 id="send-and-verify-cloudevents">Send and verify CloudEvents</h2>
-<p>After you have deployed the application, and have verified that the namespace, sample application and trigger are ready, you can send a CloudEvent.</p>
-<h3 id="send-cloudevent-to-the-broker">Send CloudEvent to the Broker</h3>
-<p>You can send an HTTP request directly to the Knative <a href="../../../broker-trigger">broker</a> if the correct CloudEvent headers are set.</p>
-<ol>
-<li>Deploy a curl pod and SSH into it
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-samples run curl --image<span style="color:#ce5c00;font-weight:bold">=</span>radial/busyboxplus:curl -it
-</code></pre></div></li>
-<li>Run the following in the SSH terminal
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">curl -v <span style="color:#4e9a06">"default-broker.knative-samples.svc.cluster.local"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span>-X POST <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span>-H <span style="color:#4e9a06">"Ce-Id: 536808d3-88be-4077-9d7a-a3f162705f79"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span>-H <span style="color:#4e9a06">"Ce-specversion: 0.3"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span>-H <span style="color:#4e9a06">"Ce-Type: dev.knative.samples.helloworld"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span>-H <span style="color:#4e9a06">"Ce-Source: dev.knative.samples/helloworldsource"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span>-H <span style="color:#4e9a06">"Content-Type: application/json"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span>-d <span style="color:#4e9a06">'{"msg":"Hello World from the curl pod."}'</span>
-
-<span style="color:#204a87">exit</span>
-</code></pre></div></li>
-</ol>
-<h3 id="verify-that-event-is-received-by-helloworld-python-app">Verify that event is received by helloworld-python app</h3>
-<p>Helloworld-python app logs the context and the msg of the above event, and replies back with another event.</p>
-<ol>
-<li>Display helloworld-python app logs
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-samples logs -l <span style="color:#000">app</span><span style="color:#ce5c00;font-weight:bold">=</span>helloworld-python --tail<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#0000cf;font-weight:bold">50</span>
-</code></pre></div><p>You should see something similar to:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">Event received. Context: Context Attributes,
- specversion: 0.3
- type: dev.knative.samples.helloworld
- source: dev.knative.samples/helloworldsource
- id: 536808d3-88be-4077-9d7a-a3f162705f79
- time: 2019-10-04T22:35:26.05871736Z
- datacontenttype: application/json
-Extensions,
- knativearrivaltime: 2019-10-04T22:35:26Z
- knativehistory: default-kn2-trigger-kn-channel.knative-samples.svc.cluster.local
- traceparent: 00-971d4644229653483d38c46e92a959c7-92c66312e4bb39be-00
-
-Hello World Message <span style="color:#4e9a06">"Hello World from the curl pod."</span>
-Responded with event Validation: valid
-Context Attributes,
- specversion: 0.2
- type: dev.knative.samples.hifromknative
- source: knative/eventing/samples/hello-world
- id: 37458d77-01f5-411e-a243-a459bbf79682
-Data,
- <span style="color:#ce5c00;font-weight:bold">{</span><span style="color:#4e9a06">"msg"</span>:<span style="color:#4e9a06">"Hi from Knative!"</span><span style="color:#ce5c00;font-weight:bold">}</span>
-
-</code></pre></div></li>
-</ol>
-<p>Try the CloudEvent attributes in the curl command and the trigger specification to understand how <a href="../../../broker-trigger#trigger">triggers</a> work.</p>
-<h2 id="verify-reply-from-helloworld-python-app">Verify reply from helloworld-python app</h2>
-<p>The <code>helloworld-python</code> app replies with an event type <code>type= dev.knative.samples.hifromknative</code>, and source <code>source=knative/eventing/samples/hello-world</code>. The event enters the eventing mesh through the broker, and can be delivered to event sinks using a trigger</p>
-<ol>
-<li>
-<p>Deploy a pod that receives any CloudEvent and logs the event to its output.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-samples apply --filename - <span style="color:#4e9a06"><< END
-</span><span style="color:#4e9a06"># event-display app deploment
-</span><span style="color:#4e9a06">apiVersion: apps/v1
-</span><span style="color:#4e9a06">kind: Deployment
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06"> namespace: knative-samples
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> replicas: 1
-</span><span style="color:#4e9a06"> selector:
-</span><span style="color:#4e9a06"> matchLabels: &labels
-</span><span style="color:#4e9a06"> app: event-display
-</span><span style="color:#4e9a06"> template:
-</span><span style="color:#4e9a06"> metadata:
-</span><span style="color:#4e9a06"> labels: *labels
-</span><span style="color:#4e9a06"> spec:
-</span><span style="color:#4e9a06"> containers:
-</span><span style="color:#4e9a06"> - name: helloworld-python
-</span><span style="color:#4e9a06"> image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display
-</span><span style="color:#4e9a06">---
-</span><span style="color:#4e9a06"># Service that exposes event-display app.
-</span><span style="color:#4e9a06"># This will be the subscriber for the Trigger
-</span><span style="color:#4e9a06">kind: Service
-</span><span style="color:#4e9a06">apiVersion: v1
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06"> namespace: knative-samples
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> selector:
-</span><span style="color:#4e9a06"> app: event-display
-</span><span style="color:#4e9a06"> ports:
-</span><span style="color:#4e9a06"> - protocol: TCP
-</span><span style="color:#4e9a06"> port: 80
-</span><span style="color:#4e9a06"> targetPort: 8080
-</span><span style="color:#4e9a06">END</span>
-</code></pre></div></li>
-<li>
-<p>Create a trigger to deliver the event to the above service</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-samples apply --filename - <span style="color:#4e9a06"><< END
-</span><span style="color:#4e9a06">apiVersion: eventing.knative.dev/v1
-</span><span style="color:#4e9a06">kind: Trigger
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06"> namespace: knative-samples
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> broker: default
-</span><span style="color:#4e9a06"> filter:
-</span><span style="color:#4e9a06"> attributes:
-</span><span style="color:#4e9a06"> type: dev.knative.samples.hifromknative
-</span><span style="color:#4e9a06"> source: knative/eventing/samples/hello-world
-</span><span style="color:#4e9a06"> subscriber:
-</span><span style="color:#4e9a06"> ref:
-</span><span style="color:#4e9a06"> apiVersion: v1
-</span><span style="color:#4e9a06"> kind: Service
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06">END</span>
-</code></pre></div></li>
-<li>
-<p><a href="###Send-CloudEvent-to-the-Broker">Send a CloudEvent to the Broker</a></p>
-</li>
-<li>
-<p>Check the logs of event-display service</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-samples logs -l <span style="color:#000">app</span><span style="color:#ce5c00;font-weight:bold">=</span>event-display --tail<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#0000cf;font-weight:bold">50</span>
-</code></pre></div><p>You should see something similar to:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"> cloudevents.Event
- Validation: valid
- Context Attributes,
- specversion: 0.3
- type: dev.knative.samples.hifromknative
- source: knative/eventing/samples/hello-world
- id: 8a7384b9-8bbe-4634-bf0f-ead07e450b2a
- time: 2019-10-04T22:53:39.844943931Z
- datacontenttype: application/json
- Extensions,
- knativearrivaltime: 2019-10-04T22:53:39Z
- knativehistory: default-kn2-ingress-kn-channel.knative-samples.svc.cluster.local
- traceparent: 00-4b01db030b9ea04bb150b77c8fa86509-2740816590a7604f-00
- Data,
- <span style="color:#ce5c00;font-weight:bold">{</span>
- <span style="color:#4e9a06">"msg"</span>: <span style="color:#4e9a06">"Hi from helloworld- app!"</span>
- <span style="color:#ce5c00;font-weight:bold">}</span>
-</code></pre></div></li>
-</ol>
-<p><strong>Note: You could use the above approach to test your applications too.</strong></p>
-<h2 id="removing-the-sample-app-deployment">Removing the sample app deployment</h2>
-<p>To remove the sample app from your cluster, delete the service record:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl delete --filename sample-app.yaml
-</code></pre></div>
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/samples/index.html b/archived/v0.22-docs/eventing/samples/index.html
deleted file mode 100644
index 4751cb6f7..000000000
--- a/archived/v0.22-docs/eventing/samples/index.html
+++ /dev/null
@@ -1,2446 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Knative Eventing code samples | Knative
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Knative Eventing code samples | Knative
-
-
-
-
-
-
-
-
-
Black lives matter.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/samples/index.xml b/archived/v0.22-docs/eventing/samples/index.xml
deleted file mode 100644
index 5a60d8ea0..000000000
--- a/archived/v0.22-docs/eventing/samples/index.xml
+++ /dev/null
@@ -1,1495 +0,0 @@
-
-
- Knative – Knative Eventing code samples
- https://knative.dev/v0.22-docs/eventing/samples/
- Recent content in Knative Eventing code samples on Knative
- Hugo -- gohugo.io
-
-
-
-
-
-
-
-
-
-
- V0.22-Docs: Apache Kafka examples
- https://knative.dev/v0.22-docs/eventing/samples/kafka/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/kafka/
-
-
-
- <p>The following examples will help you understand how to use the different Apache
-Kafka components for Knative.</p>
-<h2 id="prerequisites">Prerequisites</h2>
-<p>All examples require:</p>
-<ul>
-<li>A Kubernetes cluster with
-<ul>
-<li>Knative Eventing v0.9+</li>
-<li>Knative Serving v0.9+</li>
-</ul>
-</li>
-<li>An Apache Kafka cluster</li>
-</ul>
-<h3 id="setting-up-apache-kafka">Setting up Apache Kafka</h3>
-<p>If you want to run the Apache Kafka cluster on Kubernetes, the simplest option
-is to install it by using <a href="https://strimzi.io">Strimzi</a>.</p>
-<ol>
-<li>Create a namespace for your Apache Kafka installation, like <code>kafka</code>:
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create namespace kafka
-</code></pre></div></li>
-<li>Install the Strimzi operator, like:
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">curl -L <span style="color:#4e9a06">"https://github.com/strimzi/strimzi-kafka-operator/releases/download/0.16.2/strimzi-cluster-operator-0.16.2.yaml"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> <span style="color:#000;font-weight:bold">|</span> sed <span style="color:#4e9a06">'s/namespace: .*/namespace: kafka/'</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> <span style="color:#000;font-weight:bold">|</span> kubectl -n kafka apply -f -
-</code></pre></div></li>
-<li>Describe the size of your Apache Kafka installation in <code>kafka.yaml</code>, like:
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka.strimzi.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Kafka</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-cluster</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kafka</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">version</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">2.4.0</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">replicas</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">listeners</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">plain</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{}<span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">tls</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{}<span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">offsets.topic.replication.factor</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">transaction.state.log.replication.factor</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">transaction.state.log.min.isr</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">log.message.format.version</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"2.4"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">storage</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ephemeral</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">zookeeper</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">replicas</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">3</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">storage</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ephemeral</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">entityOperator</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">topicOperator</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{}<span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">userOperator</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span>{}<span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>Deploy the Apache Kafka cluster
-<pre><code>$ kubectl apply -n kafka -f kafka.yaml
-</code></pre></li>
-</ol>
-<p>This will install a small, non-production, cluster of Apache Kafka. To verify
-your installation, check if the pods for Strimzi are all up, in the <code>kafka</code>
-namespace:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">$ kubectl get pods -n kafka
-NAME READY STATUS RESTARTS AGE
-my-cluster-entity-operator-65995cf856-ld2zp 3/3 Running <span style="color:#0000cf;font-weight:bold">0</span> 102s
-my-cluster-kafka-0 2/2 Running <span style="color:#0000cf;font-weight:bold">0</span> 2m8s
-my-cluster-zookeeper-0 2/2 Running <span style="color:#0000cf;font-weight:bold">0</span> 2m39s
-my-cluster-zookeeper-1 2/2 Running <span style="color:#0000cf;font-weight:bold">0</span> 2m49s
-my-cluster-zookeeper-2 2/2 Running <span style="color:#0000cf;font-weight:bold">0</span> 2m59s
-strimzi-cluster-operator-77555d4b69-sbrt4 1/1 Running <span style="color:#0000cf;font-weight:bold">0</span> 3m14s
-</code></pre></div><blockquote>
-<p>NOTE: For production ready installs check <a href="https://strimzi.io">Strimzi</a>.</p>
-</blockquote>
-<h3 id="installation-script">Installation script</h3>
-<p>If you want to install the latest version of Strimzi, in just one step, we have
-a <a href="./kafka_setup.sh">script</a> for your convenience, which does exactly the same
-steps that are listed above:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">$ ./kafka_setup.sh
-</code></pre></div><h2 id="examples-of-apache-kafka-and-knative">Examples of Apache Kafka and Knative</h2>
-<p>A number of different examples, showing the <code>KafkaSource</code>, <code>KafkaChannel</code> and
-<code>KafkaBinding</code> can be found here:</p>
-<ul>
-<li><a href="./source/index.html"><code>KafkaSource</code> to <code>Service</code></a></li>
-<li><a href="./channel/index.html"><code>KafkaChannel</code> and Broker</a></li>
-<li><a href="./binding/index.html"><code>KafkaBinding</code></a></li>
-</ul>
-
-
-
-
-
- V0.22-Docs: Container Source Example
- https://knative.dev/v0.22-docs/eventing/samples/container-source/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/container-source/
-
-
-
- <p>ContainerSource will start a container image which will generate events under
-certain situations and send messages to a sink URI. It also can be an easy way
-to support your own event sources in Knative. This guide shows how to configure
-ContainerSource as an event source for functions and summarizes guidelines for
-creating your own event source as a ContainerSource.</p>
-<h2 id="create-a-heartbeats-containersource">Create a heartbeats ContainerSource</h2>
-<h3 id="prerequisites">Prerequisites</h3>
-<ol>
-<li>Setup <a href="../../../serving">Knative Serving</a>.</li>
-<li>Setup <a href="../../../eventing">Knative Eventing and Sources</a>.</li>
-</ol>
-<h3 id="prepare-the-heartbeats-image">Prepare the heartbeats image</h3>
-<p>Knative <a href="https://github.com/knative/eventing-contrib">event-sources</a> has a
-sample of heartbeats event source. You could clone the source code by</p>
-<pre><code>git clone -b "{{< branch >}}" https://github.com/knative/eventing-contrib.git
-</code></pre><p>And then build a heartbeats image and publish to your image repo with</p>
-<pre><code>ko publish knative.dev/eventing-contrib/cmd/heartbeats
-</code></pre><p><strong>Note</strong>: <code>ko publish</code> requires:</p>
-<ul>
-<li><a href="https://github.com/knative/serving/blob/main/DEVELOPMENT.md#environment-setup"><code>KO_DOCKER_REPO</code></a>
-to be set. (e.g. <code>gcr.io/[gcloud-project]</code> or <code>docker.io/<username></code>)</li>
-<li>you to be authenticated with your <code>KO_DOCKER_REPO</code></li>
-<li><a href="https://docs.docker.com/install/"><code>docker</code></a> to be installed</li>
-</ul>
-<h3 id="create-a-knative-service">Create a Knative Service</h3>
-<p>In order to verify <code>ContainerSource</code> is working, we will create a Event Display
-Service that dumps incoming messages to its log.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Use following command to create the service from <code>service.yaml</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply --filename service.yaml
-</code></pre></div><p>The status of the created service can be seen using:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl get ksvc
-
-NAME URL LATESTCREATED LATESTREADY READY REASON
-event-display http://event-display.default.1.2.3.4.xip.io event-display-gqjbw event-display-gqjbw True
-</code></pre></div><h3 id="create-a-containersource-using-the-heartbeats-image">Create a ContainerSource using the heartbeats image</h3>
-<p>In order to run the heartbeats container as an event source, you have to create
-a concrete ContainerSource with specific arguments and environment settings. Be
-sure to replace <code>heartbeats_image_uri</code> with a valid uri for your heartbeats
-image in your image repo in <a href="./heartbeats-source.yaml">heartbeats-source.yaml</a>
-file. Note that arguments and environment variables are set and will be passed
-to the container.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sources.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ContainerSource</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">test-heartbeats</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000"><heartbeats_image_uri></span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">heartbeats</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">args</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- --<span style="color:#000">period=1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">env</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">POD_NAME</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"mypod"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">POD_NAMESPACE</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"event-test"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Use the following command to create the event source from
-<code>heartbeats-source.yaml</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply --filename heartbeats-source.yaml
-</code></pre></div><h3 id="verify">Verify</h3>
-<p>We will verify that the message was sent to the Knative eventing system by
-looking at event-display service logs.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl logs -l serving.knative.dev/service<span style="color:#ce5c00;font-weight:bold">=</span>event-display -c user-container --since<span style="color:#ce5c00;font-weight:bold">=</span>10m
-</code></pre></div><p>You should see log lines showing the request headers and body of the event
-message sent by the heartbeats source to the display function:</p>
-<pre><code>☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: dev.knative.eventing.samples.heartbeat
- source: https://knative.dev/eventing-contrib/cmd/heartbeats/#event-test/mypod
- id: 2b72d7bf-c38f-4a98-a433-608fbcdd2596
- time: 2019-10-18T15:23:20.809775386Z
- contenttype: application/json
-Extensions,
- beats: true
- heart: yes
- the: 42
-Data,
- {
- "id": 2,
- "label": ""
- }
-</code></pre><h2 id="create-a-new-event-source-using-containersource">Create a new event source using ContainerSource</h2>
-<p>In order to create a new event source using ContainerSource, you will create a
-container image at first, and then create a ContainerSource with the image uri
-and specify the values of parameters.</p>
-<h3 id="develop-build-and-publish-a-container-image">Develop, build and publish a container image</h3>
-<p>The container image can be developed with any language, build and publish with
-any tools you like. Here are some basic guidelines:</p>
-<ul>
-<li>The container image must have a <code>main</code> method to start with.</li>
-<li>The <code>main</code> method will accept parameters from arguments and environment
-variables.</li>
-<li>Two environments variables will be injected by the <code>ContainerSource</code> controller,
-<code>K_SINK</code> and <code>K_CE_OVERRIDES</code>, resolved from <code>spec.sink</code> and <code>spec.ceOverrides</code> respectively.</li>
-<li>The event messages shall be sent to the sink URI specified in <code>K_SINK</code>. The message can be any
-format.
-<a href="https://github.com/cloudevents/spec/blob/master/spec.md#design-goals">CloudEvents</a>
-format is recommended.</li>
-</ul>
-<p><a href="https://github.com/knative/eventing-contrib/blob/main/cmd/heartbeats/main.go">heartbeats</a>
-event source is a sample for your reference.</p>
-<h3 id="create-the-containersource-using-this-container-image">Create the ContainerSource using this container image</h3>
-<p>When the container image is ready, a YAML file will be used to create a concrete
-<code>ContainerSource</code>. Use <a href="./heartbeats-source.yaml">heartbeats-source.yaml</a> as a
-sample for reference. <a href="../../../eventing#containersource">Learn more about the ContainerSource
-specification</a>.</p>
-
-
-
-
-
- V0.22-Docs: Knative Eventing - Hello World app
- https://knative.dev/v0.22-docs/eventing/samples/helloworld/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/helloworld/
-
-
-
- <p>Following examples include a simple web app written in the language of your choice that you can
-use to test knative eventing. It shows how to consume a <a href="https://cloudevents.io/">CloudEvent</a>
-in Knative eventing, and optionally how to respond back with another CloudEvent in the HTTP response.</p>
-<p>We will deploy the app as a
-<a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/">Kubernetes Deployment</a>
-along with a
-<a href="https://kubernetes.io/docs/concepts/services-networking/service/">Kubernetes Service</a>.
-However, you can also deploy the app as a <a href="../../../serving/index.html">Knative Serving Service</a></p>
-<h2 id="prerequisites">Prerequisites</h2>
-<ul>
-<li>A Kubernetes cluster with <a href="../../getting-started#installing-knative-eventing">Knative Eventing</a>
-installed.
-<ul>
-<li>If you decide to deploy the app as a Knative Serving Service then you will have to install
-<a href="../../../install/index.html">Knative Serving</a>.</li>
-</ul>
-</li>
-<li><a href="https://www.docker.com">Docker</a> installed and running on your local machine,
-and a Docker Hub account configured (we’ll use it for a container registry).</li>
-</ul>
-
-
-
-
-
- V0.22-Docs: Parallel Example
- https://knative.dev/v0.22-docs/eventing/samples/parallel/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/parallel/
-
-
-
- <p>The following examples will help you understand how to use Parallel to describe
-various flows.</p>
-<h2 id="prerequisites">Prerequisites</h2>
-<p>All examples require:</p>
-<ul>
-<li>A Kubernetes cluster with
-<ul>
-<li>Knative Eventing</li>
-<li>Knative Serving</li>
-</ul>
-</li>
-</ul>
-<p>All examples are using the
-<a href="../../channels/default-channels">default channel template</a>.</p>
-<h2 id="examples">Examples</h2>
-<p>For each of these examples below, we’ll use
-<a href="../ping-source/index.html"><code>PingSource</code></a> as the source of events.</p>
-<p>We also use simple
-<a href="https://github.com/lionelvillard/knative-functions">functions</a> to perform
-trivial filtering, transformation and routing of the incoming events.</p>
-<p>The examples are:</p>
-<ul>
-<li><a href="./multiple-branches/index.html">Parallel with multiple branches and global reply</a></li>
-<li><a href="./mutual-exclusivity/index.html">Parallel with mutually exclusive cases</a></li>
-</ul>
-
-
-
-
-
- V0.22-Docs: PingSource example
- https://knative.dev/v0.22-docs/eventing/samples/ping-source/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/ping-source/
-
-
-
- <p>This example shows how to configure PingSource as an event source targeting
-a Knative Service.</p>
-<h2 id="before-you-begin">Before you begin</h2>
-<ol>
-<li>Set up <a href="../../../serving">Knative Serving</a>.</li>
-<li>Set up <a href="../../../eventing">Knative Eventing</a>.</li>
-</ol>
-<h2 id="create-a-knative-service">Create a Knative Service</h2>
-<p>To verify that <code>PingSource</code> is working, create a simple Knative
-Service that dumps incoming messages to its log.</p>
-
-
-
-
-
-<ul class="nav nav-tabs" id="create-service" role="tablist">
-
-
-
-
-
-
- <li class="nav-item active">
- <a class="nav-link active" id="create-service-0-tab" data-toggle="tab" href="#create-service-0" role="tab" aria-controls="create-service-0" aria-selected="true">YAML</a>
- </li>
-
-
-
-
- <li class="nav-item ">
- <a class="nav-link " id="create-service-1-tab" data-toggle="tab" href="#create-service-1" role="tab" aria-controls="create-service-1" aria-selected="true">kn</a>
- </li>
-
-</ul>
-
-<div class="tab-content" >
-
-
-
-
-
-
- <div class="tab-pane fade show active" id="create-service-0" role="tabpanel" aria-labelledby="create-service-0-tab">
-
- <p>Use following command to create the service from STDIN:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">cat <span style="color:#4e9a06"><<EOF | kubectl create -f -
-</span><span style="color:#4e9a06">apiVersion: serving.knative.dev/v1
-</span><span style="color:#4e9a06">kind: Service
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> template:
-</span><span style="color:#4e9a06"> spec:
-</span><span style="color:#4e9a06"> containers:
-</span><span style="color:#4e9a06"> - image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div>
-
- </div>
-
-
-
-
- <div class="tab-pane fade " id="create-service-1" role="tabpanel" aria-labelledby="create-service-1-tab">
-
- <p>Use following command to create the service using the kn cli:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kn service create event-display --image gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display
-</code></pre></div>
-
- </div>
-
-</div>
-
-<h2 id="create-a-pingsource">Create a PingSource</h2>
-<p>For each set of ping events that you want to request, create an Event
-Source in the same namespace as the destination.</p>
-
-
-
-
-
-<ul class="nav nav-tabs" id="create-source" role="tablist">
-
-
-
-
-
-
- <li class="nav-item active">
- <a class="nav-link active" id="create-source-0-tab" data-toggle="tab" href="#create-source-0" role="tab" aria-controls="create-source-0" aria-selected="true">YAML</a>
- </li>
-
-
-
-
- <li class="nav-item ">
- <a class="nav-link " id="create-source-1-tab" data-toggle="tab" href="#create-source-1" role="tab" aria-controls="create-source-1" aria-selected="true">kn</a>
- </li>
-
-</ul>
-
-<div class="tab-content" >
-
-
-
-
-
-
- <div class="tab-pane fade show active" id="create-source-0" role="tabpanel" aria-labelledby="create-source-0-tab">
-
- <p>Use following command to create the event source from STDIN:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">cat <span style="color:#4e9a06"><<EOF | kubectl create -f -
-</span><span style="color:#4e9a06">apiVersion: sources.knative.dev/v1beta2
-</span><span style="color:#4e9a06">kind: PingSource
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: test-ping-source
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> schedule: "*/2 * * * *"
-</span><span style="color:#4e9a06"> contentType: "application/json"
-</span><span style="color:#4e9a06"> data: '{"message": "Hello world!"}'
-</span><span style="color:#4e9a06"> sink:
-</span><span style="color:#4e9a06"> ref:
-</span><span style="color:#4e9a06"> apiVersion: serving.knative.dev/v1
-</span><span style="color:#4e9a06"> kind: Service
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div>
-
- </div>
-
-
-
-
- <div class="tab-pane fade " id="create-source-1" role="tabpanel" aria-labelledby="create-source-1-tab">
-
- <p>Use following command to create the event source from the <code>ping-source.yaml</code> file:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kn <span style="color:#204a87">source</span> ping create test-ping-source <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --schedule <span style="color:#4e9a06">"*/2 * * * *"</span> --data <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> <span style="color:#4e9a06">'{ "message": "Hello world!" }'</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --sink ksvc:event-display
-</code></pre></div>
-
- </div>
-
-</div>
-
-<h2 id="optional-create-a-pingsource-with-binary-data">(Optional) Create a PingSource with binary data</h2>
-<p>Sometimes you may want to send binary data, which cannot be directly serialized in yaml, to downstream. This can be achieved by using <code>dataBase64</code> as the payload. As the name suggests, <code>dataBase64</code> should carry data that is base64 encoded.</p>
-<p>Please note that <code>data</code> and <code>dataBase64</code> cannot co-exist.</p>
-<p>Use the following command to create the event source with binary data from STDIN:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">cat <span style="color:#4e9a06"><<EOF | kubectl create -f -
-</span><span style="color:#4e9a06">apiVersion: sources.knative.dev/v1beta2
-</span><span style="color:#4e9a06">kind: PingSource
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: test-ping-source-binary
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> schedule: "*/2 * * * *"
-</span><span style="color:#4e9a06"> contentType: "text/plain"
-</span><span style="color:#4e9a06"> dataBase64: "ZGF0YQ=="
-</span><span style="color:#4e9a06"> sink:
-</span><span style="color:#4e9a06"> ref:
-</span><span style="color:#4e9a06"> apiVersion: serving.knative.dev/v1
-</span><span style="color:#4e9a06"> kind: Service
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div><h2 id="verify">Verify</h2>
-<p>Verify that the message was sent to the Knative eventing system by
-looking at message dumper logs.</p>
-
-
-
-
-
-<ul class="nav nav-tabs" id="view-event" role="tablist">
-
-
-
-
-
-
- <li class="nav-item active">
- <a class="nav-link active" id="view-event-0-tab" data-toggle="tab" href="#view-event-0" role="tab" aria-controls="view-event-0" aria-selected="true">kubectl</a>
- </li>
-
-
-
-
- <li class="nav-item ">
- <a class="nav-link " id="view-event-1-tab" data-toggle="tab" href="#view-event-1" role="tab" aria-controls="view-event-1" aria-selected="true">kail</a>
- </li>
-
-</ul>
-
-<div class="tab-content" >
-
-
-
-
-
-
- <div class="tab-pane fade show active" id="view-event-0" role="tabpanel" aria-labelledby="view-event-0-tab">
-
- <p>Use following command to view the logs of the event-display service:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl logs -l serving.knative.dev/service<span style="color:#ce5c00;font-weight:bold">=</span>event-display -c user-container --since<span style="color:#ce5c00;font-weight:bold">=</span>10m
-</code></pre></div>
-
- </div>
-
-
-
-
- <div class="tab-pane fade " id="view-event-1" role="tabpanel" aria-labelledby="view-event-1-tab">
-
- <p>You can also use <a href="https://github.com/boz/kail"><code>kail</code></a> instead of <code>kubectl logs</code>
-to tail the logs of the subscriber.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kail -l serving.knative.dev/service<span style="color:#ce5c00;font-weight:bold">=</span>event-display -c user-container --since<span style="color:#ce5c00;font-weight:bold">=</span>10m
-</code></pre></div>
-
- </div>
-
-</div>
-
-<p>You should see log lines showing the request headers and body from the source:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: dev.knative.sources.ping
- source: /apis/v1/namespaces/default/pingsources/test-ping-source
- id: d8e761eb-30c7-49a3-a421-cd5895239f2d
- time: 2019-12-04T14:24:00.000702251Z
- datacontenttype: application/json
-Data,
- <span style="color:#ce5c00;font-weight:bold">{</span>
- <span style="color:#4e9a06">"message"</span>: <span style="color:#4e9a06">"Hello world!"</span>
- <span style="color:#ce5c00;font-weight:bold">}</span>
-</code></pre></div><p>If you created a PingSource with binary data, you should also see the following:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: dev.knative.sources.ping
- source: /apis/v1/namespaces/default/pingsources/test-ping-source-binary
- id: a195be33-ff65-49af-9045-0e0711d05e94
- time: 2020-11-17T19:48:00.48334181Z
- datacontenttype: text/plain
-Data,
- <span style="color:#000">ZGF0YQ</span><span style="color:#ce5c00;font-weight:bold">==</span>
-</code></pre></div><h2 id="cleanup">Cleanup</h2>
-<p>You can delete the PingSource instance by entering the following command:</p>
-
-
-
-
-
-<ul class="nav nav-tabs" id="delete-source" role="tablist">
-
-
-
-
-
-
- <li class="nav-item active">
- <a class="nav-link active" id="delete-source-0-tab" data-toggle="tab" href="#delete-source-0" role="tab" aria-controls="delete-source-0" aria-selected="true">kubectl</a>
- </li>
-
-
-
-
- <li class="nav-item ">
- <a class="nav-link " id="delete-source-1-tab" data-toggle="tab" href="#delete-source-1" role="tab" aria-controls="delete-source-1" aria-selected="true">kn</a>
- </li>
-
-</ul>
-
-<div class="tab-content" >
-
-
-
-
-
-
- <div class="tab-pane fade show active" id="delete-source-0" role="tabpanel" aria-labelledby="delete-source-0-tab">
-
- <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl delete pingsources.sources.knative.dev test-ping-source
-kubectl delete pingsources.sources.knative.dev test-ping-source-binary
-</code></pre></div>
-
- </div>
-
-
-
-
- <div class="tab-pane fade " id="delete-source-1" role="tabpanel" aria-labelledby="delete-source-1-tab">
-
- <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kn <span style="color:#204a87">source</span> ping delete test-ping-source
-kn <span style="color:#204a87">source</span> ping delete test-ping-source-binary
-</code></pre></div>
-
- </div>
-
-</div>
-
-<p>Similarly, you can delete the Service instance via:</p>
-
-
-
-
-
-<ul class="nav nav-tabs" id="delete-service" role="tablist">
-
-
-
-
-
-
- <li class="nav-item active">
- <a class="nav-link active" id="delete-service-0-tab" data-toggle="tab" href="#delete-service-0" role="tab" aria-controls="delete-service-0" aria-selected="true">kubectl</a>
- </li>
-
-
-
-
- <li class="nav-item ">
- <a class="nav-link " id="delete-service-1-tab" data-toggle="tab" href="#delete-service-1" role="tab" aria-controls="delete-service-1" aria-selected="true">kn</a>
- </li>
-
-</ul>
-
-<div class="tab-content" >
-
-
-
-
-
-
- <div class="tab-pane fade show active" id="delete-service-0" role="tabpanel" aria-labelledby="delete-service-0-tab">
-
- <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl delete service.serving.knative.dev event-display
-</code></pre></div>
-
- </div>
-
-
-
-
- <div class="tab-pane fade " id="delete-service-1" role="tabpanel" aria-labelledby="delete-service-1-tab">
-
- <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kn service delete event-display
-</code></pre></div>
-
- </div>
-
-</div>
-
-
-
-
-
-
- V0.22-Docs: Sequence Example
- https://knative.dev/v0.22-docs/eventing/samples/sequence/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/sequence/
-
-
-
-
-
-
-
-
- V0.22-Docs: CloudAuditLogsSource
- https://knative.dev/v0.22-docs/eventing/samples/cloud-audit-logs-source/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/cloud-audit-logs-source/
-
-
-
- <p>Please refer to the <a href="https://github.com/google/knative-gcp/blob/master/docs/examples/cloudauditlogssource/README.md">example</a> in knative-gcp.</p>
-
-
-
-
-
- V0.22-Docs: CloudPubSubSource
- https://knative.dev/v0.22-docs/eventing/samples/cloud-pubsub-source/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/cloud-pubsub-source/
-
-
-
- <p>Please refer to the <a href="https://github.com/google/knative-gcp/blob/master/docs/examples/cloudpubsubsource/README.md">example</a> in knative-gcp.</p>
-
-
-
-
-
- V0.22-Docs: CloudSchedulerSource
- https://knative.dev/v0.22-docs/eventing/samples/cloud-scheduler-source/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/cloud-scheduler-source/
-
-
-
- <p>Please refer to the <a href="https://github.com/google/knative-gcp/blob/master/docs/examples/cloudschedulersource/README.md">example</a> in knative-gcp.</p>
-
-
-
-
-
- V0.22-Docs: CloudStorageSource
- https://knative.dev/v0.22-docs/eventing/samples/cloud-storage-source/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/cloud-storage-source/
-
-
-
- <p>Please refer to the <a href="https://github.com/google/knative-gcp/blob/master/docs/examples/cloudstoragesource/README.md">example</a> in knative-gcp.</p>
-
-
-
-
-
- V0.22-Docs: GitHub source
- https://knative.dev/v0.22-docs/eventing/samples/github-source/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/github-source/
-
-
-
- <p>GitHub Source example shows how to wire GitHub events for consumption
-by a Knative Service.</p>
-<h2 id="before-you-begin">Before you begin</h2>
-<ol>
-<li>Set up <a href="../../../serving">Knative Serving</a>.</li>
-<li>Ensure Knative Serving is <a href="../../../serving/using-a-custom-domain">configured with a domain
-name</a>
-that allows GitHub to call into the cluster.</li>
-<li>If you’re using GKE, you’ll also want to <a href="../../../serving/gke-assigning-static-ip-address">assign a static IP address</a>.</li>
-<li>Set up <a href="../../../eventing">Knative Eventing</a> with the GitHub source.</li>
-</ol>
-<h3 id="create-a-knative-service">Create a Knative Service</h3>
-<p>To verify the GitHub source is working, create a simple Knative
-Service that dumps incoming messages to its log. The <code>service.yaml</code> file
-defines this basic Service.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">github-message-dumper</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Enter the following command to create the service from <code>service.yaml</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace default apply --filename service.yaml
-</code></pre></div><h3 id="create-github-tokens">Create GitHub Tokens</h3>
-<p>Create a <a href="https://github.com/settings/tokens">personal access token</a>
-for GitHub that the GitHub source can use to register webhooks with
-the GitHub API. Also decide on a secret token that your code will use
-to authenticate the incoming webhooks from GitHub (<em>secretToken</em>).</p>
-<p>The token can be named anything you find convenient. The Source
-requires <code>repo:public_repo</code> and <code>admin:repo_hook</code>, to let it fire
-events from your public repositories and to create webhooks for those
-repositories. Copy and save this token; GitHub will force you to
-generate it again if misplaced.</p>
-<p>Here’s an example for a token named “GitHubSource Sample” with the
-recommended scopes:</p>
-<p><img src="personal_access_token.png" alt="GitHub UI" title="GitHub personal access token screenshot"></p>
-<p>Update <code>githubsecret.yaml</code> with those values. If your generated access
-token is <code>'personal_access_token_value'</code> and you choose your <em>secretToken</em>
-as <code>'asdfasfdsaf'</code>, you’d modify <code>githubsecret.yaml</code> like so:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Secret</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">githubsecret</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Opaque</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">stringData</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">accessToken</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">personal_access_token_value</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">secretToken</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">asdfasfdsaf</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Hint: you can makeup a random <em>secretToken</em> with:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">head -c <span style="color:#0000cf;font-weight:bold">8</span> /dev/urandom <span style="color:#000;font-weight:bold">|</span> base64
-</code></pre></div><p>Then, apply the githubsecret using <code>kubectl</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace default apply --filename githubsecret.yaml
-</code></pre></div><h3 id="create-event-source-for-github-events">Create Event Source for GitHub Events</h3>
-<p>In order to receive GitHub events, you have to create a concrete Event
-Source for a specific namespace. Be sure to replace the
-<code>ownerAndRepository</code> value with a valid GitHub public repository owned
-by your GitHub user.</p>
-<p>If using GitHub enterprise you will need to add an additional githubAPIURL
-field to the spec specifying your GitHub enterprise API endpoint, see
-<a href="../../index.html#githubsource">here</a></p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sources.knative.dev/v1alpha1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">GitHubSource</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">githubsourcesample</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">eventTypes</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">pull_request</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ownerAndRepository</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000"><YOUR USER>/<YOUR REPO></span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">accessToken</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">secretKeyRef</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">githubsecret</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">key</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">accessToken</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">secretToken</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">secretKeyRef</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">githubsecret</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">key</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">secretToken</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">github-message-dumper</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Then, apply that yaml using <code>kubectl</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace default apply --filename github-source.yaml
-</code></pre></div><h3 id="verify">Verify</h3>
-<p>Verify the GitHub webhook was created by looking at the list of
-webhooks under the Settings tab in your GitHub repository. A hook
-should be listed that points to your Knative cluster with a green
-check mark to the left of the hook URL, as shown below.</p>
-<p><img src="webhook_created.png" alt="GitHub Webhook" title="GitHub webhook screenshot"></p>
-<h3 id="create-events">Create Events</h3>
-<p>Create a pull request in your GitHub repository. We will verify
-that the GitHub events were sent into the Knative eventing system
-by looking at our message dumper function logs.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace default get pods
-kubectl --namespace default logs github-event-display-XXXX user-container
-</code></pre></div><p>You should log lines similar to:</p>
-<pre><code>2018/11/08 18:25:34 Message Dumper received a message: POST / HTTP/1.1
-Host: github-event-display.knative-demo.svc.cluster.local
-Accept-Encoding: gzip
-Ce-Cloudeventsversion: 0.1
-Ce-Eventid: a8d4cf20-e383-11e8-8069-46e3c8ad2b4d
-Ce-Eventtime: 2018-11-08T18:25:32.819548012Z
-Ce-Eventtype: dev.knative.source.github.pull_request
-Ce-Source: https://github.com/someuser/somerepo/pull/1
-Content-Length: 21060
-Content-Type: application/json
-User-Agent: Go-http-client/1.1
-X-B3-Parentspanid: b2e514c3dbe94c03
-X-B3-Sampled: 1
-X-B3-Spanid: c85e346d89c8be4e
-X-B3-Traceid: abf6292d458fb8e7
-X-Envoy-Expected-Rq-Timeout-Ms: 60000
-X-Envoy-Internal: true
-X-Forwarded-For: 127.0.0.1, 127.0.0.1
-X-Forwarded-Proto: http
-X-Request-Id: 8a2201af-5075-9447-b593-ec3a243aff52
-
-{"action":"opened","number":1,"pull_request": ...}
-</code></pre><h3 id="cleanup">Cleanup</h3>
-<p>You can remove the Github webhook by deleting the Github source:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace default delete --filename github-source.yaml
-</code></pre></div><p>Similarly, you can remove the Service and Secret via:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace default delete --filename service.yaml
-kubectl --namespace default delete --filename githubsecret.yaml
-
-</code></pre></div>
-
-
-
-
- V0.22-Docs: GitLab source
- https://knative.dev/v0.22-docs/eventing/samples/gitlab-source/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/gitlab-source/
-
-
-
- <p>GitLab Source example shows how to wire GitLab events for consumption by a
-Knative Service.</p>
-<h2 id="gitlab-source-deployment">Gitlab source deployment</h2>
-<h3 id="prerequisites">Prerequisites</h3>
-<p>You will need:</p>
-<ol>
-<li>An internet-accessible Kubernetes cluster with Knative Serving installed.
-Follow the <a href="../../../install/index.html">installation instructions</a> if you
-need to create one.</li>
-<li>Ensure Knative Serving is
-<a href="../../../serving/using-a-custom-domain">configured with a domain name</a>
-that allows GitLab to call into the cluster.</li>
-<li>If you’re using GKE, you’ll also want to
-<a href="../../../serving/gke-assigning-static-ip-address">assign a static IP address</a>.</li>
-<li>Install <a href="../../../eventing">Knative Eventing</a>.</li>
-</ol>
-<h3 id="install-gitlab-event-source">Install GitLab Event Source</h3>
-<p>GitLab Event source lives in the <a href="https://github.com/knative/eventing-contrib">knative/eventing-contrib</a>. Head to the releases page, find the latest release with <code>gitlab.yaml</code>
-artifact and replace the <code><RELEASE></code> with version tag:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply -f https://github.com/knative/eventing-contrib/releases/download/<RELEASE>/gitlab.yaml
-</code></pre></div><p>Check that the manager is running:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n knative-sources get pods --selector control-plane<span style="color:#ce5c00;font-weight:bold">=</span>gitlab-controller-manager
-</code></pre></div><p>With the controller running you can now move on to a user persona and setup a
-GitLab webhook as well as a function that will consume GitLab events.</p>
-<h2 id="using-the-gitlab-event-source">Using the GitLab Event Source</h2>
-<p>You are now ready to use the Event Source and trigger functions based on GitLab
-projects events.</p>
-<p>We will:</p>
-<ul>
-<li>Create a Knative service which will receive the events. To keep things simple
-this service will simply dump the events to <code>stdout</code>, this is the so-called:
-<em>event_display</em></li>
-<li>Create a GitLab access token and a random secret token used to secure the
-webhooks</li>
-<li>Create the event source by posting a GitLab source object manifest to
-Kubernetes</li>
-</ul>
-<h3 id="create-a-knative-service">Create a Knative Service</h3>
-<p>The <code>event-display.yaml</code> file shown below defines the basic service which will
-receive events from the GitLab source.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gitlab-event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Create the service:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default apply -f event-display.yaml
-</code></pre></div><h3 id="create-gitlab-tokens">Create GitLab Tokens</h3>
-<ol>
-<li>
-<p>Create a
-<a href="https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html">personal access token</a>
-which the GitLab source will use to register webhooks with the GitLab API.
-The token must have an “api” access scope in order to create repository
-webhooks. Also decide on a secret token that your source will use to
-authenticate the incoming webhooks from GitLab.</p>
-</li>
-<li>
-<p>Update a secret values in <code>secret.yaml</code> defined below:</p>
-<p><code>accessToken</code> is the personal access token created in step 1 and
-<code>secretToken</code> is any token of your choosing.</p>
-<p>Hint: you can generate a random <em>secretToken</em> with:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">head -c <span style="color:#0000cf;font-weight:bold">8</span> /dev/urandom <span style="color:#000;font-weight:bold">|</span> base64
-</code></pre></div><p><code>secret.yaml</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Secret</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gitlabsecret</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Opaque</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">stringData</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">accessToken</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000"><personal_access_token_value></span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">secretToken</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000"><random_string></span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>
-<p>Create the secret using <code>kubectl</code>.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default apply -f secret.yaml
-</code></pre></div></li>
-</ol>
-<h3 id="create-event-source-for-gitlab-events">Create Event Source for GitLab Events</h3>
-<ol>
-<li>
-<p>In order to receive GitLab events, you have to create a concrete Event Source
-for a specific namespace. Replace the <code>projectUrl</code> value in the
-<code>gitlabsource.yaml</code> file with your GitLab project URL, for example
-<code>https://gitlab.com/knative-examples/functions</code>.</p>
-<p><code>gitlabsource.yaml</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sources.knative.dev/v1alpha1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">GitLabSource</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gitlabsource-sample</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">eventTypes</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">push_events</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">issues_events</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">projectUrl</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000"><project url></span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">accessToken</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">secretKeyRef</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gitlabsecret</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">key</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">accessToken</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">secretToken</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">secretKeyRef</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gitlabsecret</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">key</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">secretToken</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gitlab-event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>
-<p>Apply the yaml file using <code>kubectl</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default apply -f gitlabsource.yaml
-</code></pre></div></li>
-</ol>
-<h3 id="verify">Verify</h3>
-<p>Verify that GitLab webhook was created by looking at the list of webhooks under
-<strong>Settings » Integrations</strong> in your GitLab project. A hook should be listed
-that points to your Knative cluster.</p>
-<p>Create a push event and check the logs of the Pod backing the
-<code>gitlab-event-display</code> knative service. You will see the event:</p>
-<pre><code>☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 0.3
- type: dev.knative.sources.gitlabsource.Push Hook
- source: https://gitlab.com/<user>/<project>
- id: f83c080f-c2af-48ff-8d8b-fd5b21c5938e
- time: 2020-03-12T11:08:41.414572482Z
- datacontenttype: application/json
-Data,
- {
- <Event payload>
- }
-</code></pre><h3 id="cleanup">Cleanup</h3>
-<p>You can remove the GitLab webhook by deleting the GitLab source:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace default delete --filename gitlabsource.yaml
-</code></pre></div><p>Similarly, you can remove the Service and Secret via:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace default delete --filename event-display.yaml
-kubectl --namespace default delete --filename secret.yaml
-
-</code></pre></div>
-
-
-
-
- V0.22-Docs: Binding running services to an IoT core
- https://knative.dev/v0.22-docs/eventing/samples/iot-core/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/iot-core/
-
-
-
- <p>This sample shows how to bind a running service to an
-<a href="https://cloud.google.com/iot-core/">IoT core</a> using
-<a href="https://cloud.google.com/pubsub/">GCP PubSub</a> as the event source. With minor
-modifications, it can be used to bind a running service to anything that sends
-events via GCP PubSub.</p>
-<pre><code>Note: All commands are given relative to the root of this repository.
-</code></pre><h2 id="deployment-steps">Deployment Steps</h2>
-<h3 id="environment-variables">Environment Variables</h3>
-<p>To make the following commands easier, we are going to set the various variables
-here and use them later.</p>
-<h4 id="variables-you-must-change">Variables you must Change</h4>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#204a87">export</span> <span style="color:#000">IOTCORE_PROJECT</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">"s9-demo"</span>
-</code></pre></div><h4 id="variables-you-may-change">Variables you may Change</h4>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#204a87">export</span> <span style="color:#000">IOTCORE_REGISTRY</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">"iot-demo"</span>
-<span style="color:#204a87">export</span> <span style="color:#000">IOTCORE_DEVICE</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">"iot-demo-client"</span>
-<span style="color:#204a87">export</span> <span style="color:#000">IOTCORE_REGION</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">"us-central1"</span>
-<span style="color:#204a87">export</span> <span style="color:#000">IOTCORE_TOPIC_DATA</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">"iot-demo-pubsub-topic"</span>
-<span style="color:#204a87">export</span> <span style="color:#000">IOTCORE_TOPIC_DEVICE</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">"iot-demo-device-pubsub-topic"</span>
-</code></pre></div><h3 id="prerequisites">Prerequisites</h3>
-<h4 id="kubernetes">Kubernetes</h4>
-<ol>
-<li>Have a running Kubernetes cluster with <code>kubectl</code> pointing at it.</li>
-</ol>
-<h4 id="gcp">GCP</h4>
-<ol>
-<li>
-<p>Create a
-<a href="https://cloud.google.com/resource-manager/docs/creating-managing-projects">Google Cloud Project</a>.</p>
-</li>
-<li>
-<p>Have <a href="https://cloud.google.com/sdk/gcloud/">gcloud</a> installed and pointing
-at that project.</p>
-</li>
-<li>
-<p>Enable the <code>Cloud Pub/Sub API</code> on that project.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">gcloud services <span style="color:#204a87">enable</span> pubsub.googleapis.com
-</code></pre></div></li>
-<li>
-<p>Create the two GCP PubSub <code>topic</code>s.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">gcloud pubsub topics create <span style="color:#000">$IOTCORE_TOPIC_DATA</span>
-gcloud pubsub topics create <span style="color:#000">$IOTCORE_TOPIC_DEVICE</span>
-</code></pre></div></li>
-<li>
-<p>Setup <a href="../../../eventing">Knative Eventing</a>.</p>
-</li>
-</ol>
-<h4 id="gcp-pubsub-source">GCP PubSub Source</h4>
-<ol>
-<li>
-<p>Create a GCP
-<a href="https://console.cloud.google.com/iam-admin/serviceaccounts/project">Service Account</a>.</p>
-<ol>
-<li>
-<p>Determine the Service Account to use, or create a new one.</p>
-</li>
-<li>
-<p>Give that Service Account the ‘Pub/Sub Editor’ role on your GCP project.</p>
-</li>
-<li>
-<p>Download a new JSON private key for that Service Account.</p>
-</li>
-<li>
-<p>Create two secrets with the downloaded key (one for the Source, one for
-the Receive Adapter):</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace knative-sources create secret generic gcppubsub-source-key --from-file<span style="color:#ce5c00;font-weight:bold">=</span>key.json<span style="color:#ce5c00;font-weight:bold">=</span>PATH_TO_KEY_FILE.json
-kubectl --namespace default create secret generic google-cloud-key --from-file<span style="color:#ce5c00;font-weight:bold">=</span>key.json<span style="color:#ce5c00;font-weight:bold">=</span>PATH_TO_KEY_FILE.json
-</code></pre></div></li>
-</ol>
-</li>
-<li>
-<p>Deploy the <code>GcpPubSubSource</code> controller as part of eventing-source’s
-controller.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply --filename https://github.com/knative/eventing-contrib/releases/download/v0.8.2/gcppubsub.yaml
-</code></pre></div></li>
-</ol>
-<h3 id="deploying">Deploying</h3>
-<h4 id="broker">Broker</h4>
-<ol>
-<li>
-<p>Install the default <code>Broker</code>.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create -f - <span style="color:#4e9a06"><<EOF
-</span><span style="color:#4e9a06">apiVersion: eventing.knative.dev/v1
-</span><span style="color:#4e9a06">kind: Broker
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: default
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div></li>
-</ol>
-<h4 id="gcp-pubsub-source-1">GCP PubSub Source</h4>
-<ol>
-<li>
-<p>Deploy <code>gcp-pubsub-source.yaml</code>.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">sed -e <span style="color:#4e9a06">"s/PROJECT_ID/</span><span style="color:#000">$IOTCORE_PROJECT</span><span style="color:#4e9a06">/"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -e <span style="color:#4e9a06">"s/TOPIC_NAME/</span><span style="color:#000">$IOTCORE_TOPIC_DATA</span><span style="color:#4e9a06">/"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> docs/eventing/samples/iot-core/gcp-pubsub-source.yaml <span style="color:#000;font-weight:bold">|</span>
-kubectl apply --filename -
-</code></pre></div></li>
-</ol>
-<h4 id="trigger">Trigger</h4>
-<p>Even though the <code>Source</code> isn’t completely ready yet, we can setup the <code>Trigger</code>
-for all events coming out of it.</p>
-<ol>
-<li>
-<p>Deploy <code>trigger.yaml</code>.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply --filename docs/eventing/samples/iot-core/trigger.yaml
-</code></pre></div><ul>
-<li>This uses a very simple Knative Service to see that events are flowing.
-Feel free to replace it.</li>
-</ul>
-</li>
-</ol>
-<h4 id="iot-core">IoT Core</h4>
-<p>We now have everything setup on the Knative side. We will now setup the IoT
-Core.</p>
-<ol>
-<li>
-<p>Create a device registry:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">gcloud iot registries create <span style="color:#000">$IOTCORE_REGISTRY</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --project<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$IOTCORE_PROJECT</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --region<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$IOTCORE_REGION</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --event-notification-config<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">topic</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$IOTCORE_TOPIC_DATA</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --state-pubsub-topic<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$IOTCORE_TOPIC_DEVICE</span>
-</code></pre></div></li>
-<li>
-<p>Create the certificates.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">openssl req -x509 -nodes -newkey rsa:2048 <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -keyout device.key.pem <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -out device.crt.pem <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -days <span style="color:#0000cf;font-weight:bold">365</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -subj <span style="color:#4e9a06">"/CN=unused"</span>
-curl https://pki.google.com/roots.pem > ./root-ca.pem
-</code></pre></div></li>
-<li>
-<p>Register a device using the generated certificates.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">gcloud iot devices create <span style="color:#000">$IOTCORE_DEVICE</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --project<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$IOTCORE_PROJECT</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --region<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$IOTCORE_REGION</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --registry<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">$IOTCORE_REGISTRY</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --public-key <span style="color:#000">path</span><span style="color:#ce5c00;font-weight:bold">=</span>./device.crt.pem,type<span style="color:#ce5c00;font-weight:bold">=</span>rsa-x509-pem
-</code></pre></div></li>
-</ol>
-<h3 id="running">Running</h3>
-<p>We now have everything installed and ready to go. We will generate events and
-see them in the subscriber.</p>
-<ol>
-<li>
-<p>Run the following program to generate events:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">go run github.com/knative/docs/docs/eventing/samples/iot-core/generator <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -project <span style="color:#000">$IOTCORE_PROJECT</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -region <span style="color:#000">$IOTCORE_REGION</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -registry <span style="color:#000">$IOTCORE_REGISTRY</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -device <span style="color:#000">$IOTCORE_DEVICE</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -ca <span style="color:#4e9a06">"</span><span style="color:#000">$PWD</span><span style="color:#4e9a06">/root-ca.pem"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -key <span style="color:#4e9a06">"</span><span style="color:#000">$PWD</span><span style="color:#4e9a06">/device.key.pem"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -src <span style="color:#4e9a06">"iot-core demo"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -events <span style="color:#0000cf;font-weight:bold">10</span>
-</code></pre></div></li>
-<li>
-<p>Inspect the logs of the subscriber:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl logs --selector serving.knative.dev/service<span style="color:#ce5c00;font-weight:bold">=</span>event-display -c user-container
-</code></pre></div><p>You should see something along the similar to:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#ce5c00;font-weight:bold">{</span><span style="color:#4e9a06">"ID"</span>:<span style="color:#4e9a06">"481014114648052"</span>,<span style="color:#4e9a06">"Data"</span>:<span style="color:#4e9a06">"eyJzb3VyY2VfaWQiOiJpb3QtY29yZSBkZW1vIiwiZXZlbnRfaWQiOiJlaWQtMzI3MjJiMzItZWU5Mi00YzZlLWEzOTgtNDlmYjRkYWYyNGE1IiwiZXZlbnRfdHMiOjE1NTM3MTczOTYsIm1ldHJpYyI6MC4xMzY1MjI5OH0="</span>,<span style="color:#4e9a06">"Attributes"</span>:<span style="color:#ce5c00;font-weight:bold">{</span><span style="color:#4e9a06">"deviceId"</span>:<span style="color:#4e9a06">"iot-demo-client"</span>,<span style="color:#4e9a06">"deviceNumId"</span>:<span style="color:#4e9a06">"2754785852315736"</span>,<span style="color:#4e9a06">"deviceRegistryId"</span>:<span style="color:#4e9a06">"iot-demo"</span>,<span style="color:#4e9a06">"deviceRegistryLocation"</span>:<span style="color:#4e9a06">"us-central1"</span>,<span style="color:#4e9a06">"projectId"</span>:<span style="color:#4e9a06">"s9-demo"</span>,<span style="color:#4e9a06">"subFolder"</span>:<span style="color:#4e9a06">""</span><span style="color:#ce5c00;font-weight:bold">}</span>,<span style="color:#4e9a06">"PublishTime"</span>:<span style="color:#4e9a06">"2019-03-27T20:09:56.685Z"</span><span style="color:#ce5c00;font-weight:bold">}</span>
-</code></pre></div></li>
-</ol>
-<h3 id="cleanup">Cleanup</h3>
-<p>To cleanup the knative resources:</p>
-<ol>
-<li>
-<p>Remove the <code>GcpPubSubSource</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">sed -e <span style="color:#4e9a06">"s/PROJECT_ID/</span><span style="color:#000">$IOTCORE_PROJECT</span><span style="color:#4e9a06">/"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> -e <span style="color:#4e9a06">"s/TOPIC_NAME/</span><span style="color:#000">$IOTCORE_TOPIC_DATA</span><span style="color:#4e9a06">/"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> docs/eventing/samples/iot-core/gcp-pubsub-source.yaml <span style="color:#000;font-weight:bold">|</span>
-kubectl delete --filename -
-</code></pre></div></li>
-<li>
-<p>Remove the Trigger:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl delete --filename docs/eventing/samples/iot-core/trigger.yaml
-</code></pre></div></li>
-<li>
-<p>Remove the <code>GcpPubSubSource</code> controller:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl delete --filename https://github.com/knative/eventing-contrib/releases/download/v0.8.2/gcppubsub.yaml
-</code></pre></div></li>
-</ol>
-
-
-
-
-
- V0.22-Docs: Kubernetes event using the API Server Source
- https://knative.dev/v0.22-docs/eventing/samples/kubernetes-event-source/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/kubernetes-event-source/
-
-
-
- <p>This example shows how to wire
-<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#event-v1-core">Kubernetes cluster events</a>,
-using the API Server Source, for consumption by a function that has been
-implemented as a Knative Service.</p>
-<h2 id="before-you-begin">Before you begin</h2>
-<ol>
-<li>
-<p>You must have a Knative cluster running both the Serving and Eventing
-components. To learn how to install the required components, see
-<a href="../../../install">Installing Knative</a>.</p>
-</li>
-<li>
-<p>You can follow the steps below to create new files, or you clone a copy from
-the repo by running:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">git clone -b <span style="color:#4e9a06">"release-0.13"</span> https://github.com/knative/docs knative-docs
-<span style="color:#204a87">cd</span> knative-docs/docs/eventing/samples/kubernetes-event-source
-</code></pre></div></li>
-</ol>
-<h2 id="deployment-steps">Deployment Steps</h2>
-<h3 id="broker">Broker</h3>
-<p>These instructions assume the namespace <code>default</code>, which you can change to your
-preferred namespace. If you use a different namespace, you will need to modify
-all the YAML files deployed in this sample to point at that namespace.</p>
-<ol>
-<li>
-<p>Create the <code>default</code> Broker in your namespace:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create -f - <span style="color:#4e9a06"><<EOF
-</span><span style="color:#4e9a06">apiVersion: eventing.knative.dev/v1
-</span><span style="color:#4e9a06">kind: Broker
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: default
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div></li>
-</ol>
-<h3 id="service-account">Service Account</h3>
-<ol>
-<li>
-<p>Create a Service Account that the <code>ApiServerSource</code> runs as. The
-<code>ApiServerSource</code> watches for Kubernetes events and forwards them to the
-Knative Eventing Broker. Create a file named <code>serviceaccount.yaml</code> and copy
-the code block below into it.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ServiceAccount</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">events-sa</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">rbac.authorization.k8s.io/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ClusterRole</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-watcher</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">rules</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">apiGroups</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#4e9a06">""</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">resources</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">events</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">verbs</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">get</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">list</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">watch</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">rbac.authorization.k8s.io/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ClusterRoleBinding</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">k8s-ra-event-watcher</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">roleRef</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiGroup</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">rbac.authorization.k8s.io</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ClusterRole</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-watcher</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">subjects</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ServiceAccount</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">events-sa</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>If you want to re-use an existing Service Account with the appropriate
-permissions, you need to modify the <code>serviceaccount.yaml</code>.</p>
-</li>
-<li>
-<p>Enter the following command to create the service account from
-<code>serviceaccount.yaml</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply --filename serviceaccount.yaml
-</code></pre></div></li>
-</ol>
-<h3 id="create-event-source-for-kubernetes-events">Create Event Source for Kubernetes Events</h3>
-<ol>
-<li>
-<p>In order to receive events, you have to create a concrete Event Source for a
-specific namespace. Create a file named <code>k8s-events.yaml</code> and copy the code
-block below into it.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sources.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ApiServerSource</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">testevents</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">serviceAccountName</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">events-sa</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">mode</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Resource</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">resources</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Event</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Broker</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>If you want to consume events from a different namespace or use a different
-<code>Service Account</code>, you need to modify <code>k8s-events.yaml</code> accordingly.</p>
-</li>
-<li>
-<p>Enter the following command to create the event source:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply --filename k8s-events.yaml
-</code></pre></div></li>
-</ol>
-<h3 id="trigger">Trigger</h3>
-<p>In order to check the <code>ApiServerSource</code> is fully working, we will create a
-simple Knative Service that dumps incoming messages to its log and creates a
-<code>Trigger</code> from the <code>Broker</code> to that Knative Service.</p>
-<ol>
-<li>
-<p>Create a file named <code>trigger.yaml</code> and copy the code block below into it.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Trigger</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">testevents-trigger</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">broker</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">subscriber</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#8f5902;font-style:italic"># This is a very simple Knative Service that writes the input request to its log.</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#8f5902;font-style:italic"># This corresponds to</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># https://github.com/knative/eventing-contrib/tree/main/cmd/event_display/main.go</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>
-<p>If the deployed <code>ApiServerSource</code> is pointing at a <code>Broker</code> other than
-<code>default</code>, modify <code>trigger.yaml</code> by adding <code>spec.broker</code> with the <code>Broker</code>’s
-name.</p>
-</li>
-<li>
-<p>Deploy <code>trigger.yaml</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply --filename trigger.yaml
-</code></pre></div></li>
-</ol>
-<h3 id="create-events">Create Events</h3>
-<p>Create events by launching a pod in the default namespace. Create a <code>busybox</code>
-container and immediately delete it:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl run busybox --image<span style="color:#ce5c00;font-weight:bold">=</span>busybox --restart<span style="color:#ce5c00;font-weight:bold">=</span>Never -- ls
-kubectl delete pod busybox
-</code></pre></div><h3 id="verify">Verify</h3>
-<p>We will verify that the Kubernetes events were sent into the Knative eventing
-system by looking at our message dumper function logs. If you deployed the
-<a href="#trigger">Trigger</a>, continue using this section. If not, you will need to look
-downstream yourself:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl get pods
-kubectl logs -l serving.knative.dev/service<span style="color:#ce5c00;font-weight:bold">=</span>event-display -c user-container
-</code></pre></div><p>You should see log lines similar to:</p>
-<pre><code>☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: dev.knative.apiserver.resource.update
- source: https://10.96.0.1:443
- subject: /apis/v1/namespaces/default/events/testevents.15dd3050eb1e6f50
- id: e0447eb7-36b5-443b-9d37-faf4fe5c62f0
- time: 2020-07-28T16:35:14.172979816Z
- datacontenttype: application/json
-Extensions,
- kind: Event
- knativearrivaltime: 2020-07-28T16:35:14.173381505Z
- knativehistory: default-kne-trigger-kn-channel.default.svc.cluster.local
- name: busybox.1625f7cfa4cd12f8
- namespace: default
-Data,
- {
- "apiVersion": "v1",
- "count": 1,
- "eventTime": null,
- "firstTimestamp": "2020-07-28T16:35:14Z",
- "involvedObject": {
- "apiVersion": "v1",
- "fieldPath": "spec.containers{busybox}",
- "kind": "Pod",
- "name": "busybox",
- "namespace": "default",
- "resourceVersion": "28987493",
- "uid": "1efb342a-737b-11e9-a6c5-42010a8a00ed"
- },
- "kind": "Event",
- "lastTimestamp": "2020-07-28T16:35:14Z",
- "message": "Started container",
- "metadata": {
- "creationTimestamp": "2020-07-28T16:35:14Z",
- "name": "busybox.1625f7cfa4cd12f8",
- "namespace": "default",
- "resourceVersion": "506088",
- "selfLink": "/api/v1/namespaces/default/events/busybox.1625f7cfa4cd12f8",
- "uid": "7f841049-7979-48db-9cbc-93ed2346a1b5",
- },
- "reason": "Started",
- "reportingComponent": "",
- "reportingInstance": "",
- "source": {
- "component": "kubelet",
- "host": "gke-knative-auto-cluster-default-pool-23c23c4f-xdj0"
- },
- "type": "Normal"
- }
-</code></pre><h3 id="cleanup">Cleanup</h3>
-<p>You can remove the <code>ServiceAccount</code>, <code>ClusterRoles</code>, <code>ClusterRoleBinding</code>,
-<code>ApiServerSource</code>, <code>Service</code> and <code>Trigger</code> using:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl --namespace default delete --filename serviceaccount.yaml
-kubectl --namespace default delete --filename k8s-events.yaml
-kubectl --namespace default delete --filename trigger.yaml
-
-</code></pre></div>
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/samples/iot-core/gcp-pubsub-source.yaml b/archived/v0.22-docs/eventing/samples/iot-core/gcp-pubsub-source.yaml
deleted file mode 100644
index ed29e9190..000000000
--- a/archived/v0.22-docs/eventing/samples/iot-core/gcp-pubsub-source.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-# Replace the following before applying this file:
-# TOPIC_NAME: Replace with the GCP PubSub Topic name.
-# MY_GCP_PROJECT: Replace with the GCP Project's ID.
-
-apiVersion: sources.knative.dev/v1alpha1
-kind: GcpPubSubSource
-metadata:
- name: TOPIC_NAME-source
-spec:
- gcpCredsSecret:
- name: google-cloud-key
- key: key.json
- googleCloudProject: PROJECT_ID
- topic: TOPIC_NAME
- sink:
- apiVersion: eventing.knative.dev/v1
- kind: Broker
- name: default
diff --git a/archived/v0.22-docs/eventing/samples/iot-core/generator/main.go b/archived/v0.22-docs/eventing/samples/iot-core/generator/main.go
deleted file mode 100644
index d0cb64f2b..000000000
--- a/archived/v0.22-docs/eventing/samples/iot-core/generator/main.go
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
-Copyright 2018 The Knative Authors
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package main
-
-import (
- "crypto/tls"
- "crypto/x509"
- "encoding/json"
- "flag"
- "fmt"
- "io/ioutil"
- "log"
- "math/rand"
- "time"
-
- MQTT "github.com/eclipse/paho.mqtt.golang"
- jwt "github.com/form3tech-oss/jwt-go"
- uuid "github.com/google/uuid"
-)
-
-const (
- host = "mqtt.googleapis.com"
- port = "8883"
- idPrefix = "eid"
-)
-
-var (
- deviceID = flag.String("device", "", "Cloud IoT Core Device ID")
- projectID = flag.String("project", "", "GCP Project ID")
- registryID = flag.String("registry", "", "Cloud IoT Registry ID (short form)")
- region = flag.String("region", "us-central1", "GCP Region")
- numEvents = flag.Int("events", 10, "Number of events to sent")
- eventSrc = flag.String("src", "", "Event source")
- certsCA = flag.String("ca", "root-ca.pem", "Download https://pki.google.com/roots.pem")
- privateKey = flag.String("key", "", "Path to private key file")
-)
-
-func main() {
- flag.Parse()
-
- log.Println("Loading Google's roots...")
- certpool := x509.NewCertPool()
- pemCerts, err := ioutil.ReadFile(*certsCA)
- if err == nil {
- certpool.AppendCertsFromPEM(pemCerts)
- }
-
- config := &tls.Config{
- RootCAs: certpool,
- ClientAuth: tls.NoClientCert,
- ClientCAs: nil,
- InsecureSkipVerify: true,
- Certificates: []tls.Certificate{},
- MinVersion: tls.VersionTLS12,
- }
-
- clientID := fmt.Sprintf("projects/%v/locations/%v/registries/%v/devices/%v",
- *projectID,
- *region,
- *registryID,
- *deviceID,
- )
-
- log.Println("Creating MQTT client options...")
- opts := MQTT.NewClientOptions()
-
- broker := fmt.Sprintf("ssl://%v:%v", host, port)
- log.Printf("Broker '%v'", broker)
-
- opts.AddBroker(broker)
- opts.SetClientID(clientID).SetTLSConfig(config)
- opts.SetUsername("unused")
-
- token := jwt.New(jwt.SigningMethodRS256)
- token.Claims = jwt.StandardClaims{
- Audience: []string{*projectID},
- IssuedAt: time.Now().Unix(),
- ExpiresAt: time.Now().Add(24 * time.Hour).Unix(),
- }
-
- log.Println("Loading private key...")
- keyBytes, err := ioutil.ReadFile(*privateKey)
- if err != nil {
- log.Fatal(err)
- }
-
- log.Println("Parsing private key...")
- key, err := jwt.ParseRSAPrivateKeyFromPEM(keyBytes)
- if err != nil {
- log.Fatal(err)
- }
-
- log.Println("Signing token")
- tokenString, err := token.SignedString(key)
- if err != nil {
- log.Fatal(err)
- }
-
- log.Println("Setting password...")
- opts.SetPassword(tokenString)
-
- opts.SetDefaultPublishHandler(func(client MQTT.Client, msg MQTT.Message) {
- fmt.Printf("[handler] Topic: %v\n", msg.Topic())
- fmt.Printf("[handler] Payload: %v\n", msg.Payload())
- })
-
- log.Println("Connecting...")
- client := MQTT.NewClient(opts)
- if token := client.Connect(); token.Wait() && token.Error() != nil {
- log.Fatal(token.Error())
- }
-
- topic := fmt.Sprintf("/devices/%s/events", *deviceID)
- log.Println("Publishing messages...")
- for i := 0; i < *numEvents; i++ {
- data := makeEvent()
- log.Printf("Publishing to topic '%s': %v", topic, data)
- token := client.Publish(
- topic,
- 0,
- false,
- data)
- token.WaitTimeout(5 * time.Second)
- if token.Error() != nil {
- log.Printf("Error publishing: %s", token.Error())
- }
- }
-
- log.Println("Disconnecting...")
- client.Disconnect(250)
-
- log.Println("Done")
-}
-
-func makeEvent() string {
-
- s1 := rand.NewSource(time.Now().UnixNano())
- r1 := rand.New(s1)
-
- event := struct {
- SourceID string `json:"source_id"`
- EventID string `json:"event_id"`
- EventTs int64 `json:"event_ts"`
- Metric float32 `json:"metric"`
- }{
- SourceID: *eventSrc,
- EventID: fmt.Sprintf("%s-%s", idPrefix, uuid.New().String()),
- EventTs: time.Now().UTC().Unix(),
- Metric: r1.Float32(),
- }
-
- data, _ := json.Marshal(event)
-
- return string(data)
-
-}
diff --git a/archived/v0.22-docs/eventing/samples/iot-core/index.html b/archived/v0.22-docs/eventing/samples/iot-core/index.html
deleted file mode 100644
index a091e74cb..000000000
--- a/archived/v0.22-docs/eventing/samples/iot-core/index.html
+++ /dev/null
@@ -1,2442 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-Binding running services to an IoT core | Knative
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Binding running services to an IoT core | Knative
-
-
-
-
-
-
-
-
-
Black lives matter.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
This sample shows how to bind a running service to an
-IoT core using
-GCP PubSub as the event source. With minor
-modifications, it can be used to bind a running service to anything that sends
-events via GCP PubSub.
-
Note: All commands are given relative to the root of this repository.
-
Deployment Steps
-
Environment Variables
-
To make the following commands easier, we are going to set the various variables
-here and use them later.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/samples/iot-core/trigger.yaml b/archived/v0.22-docs/eventing/samples/iot-core/trigger.yaml
deleted file mode 100644
index 466c6741f..000000000
--- a/archived/v0.22-docs/eventing/samples/iot-core/trigger.yaml
+++ /dev/null
@@ -1,26 +0,0 @@
-apiVersion: eventing.knative.dev/v1
-kind: Trigger
-metadata:
- name: iot-demo
- namespace: default
-spec:
- broker: default
- subscriber:
- ref:
- apiVersion: serving.knative.dev/v1
- kind: Service
- name: event-display
-
----
-# This is a very simple Knative Service that writes the input request to its log.
-
-apiVersion: serving.knative.dev/v1
-kind: Service
-metadata:
- name: event-display
- namespace: default
-spec:
- template:
- spec:
- containers:
- image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display
diff --git a/archived/v0.22-docs/eventing/samples/kafka/binding/event-binding.yaml b/archived/v0.22-docs/eventing/samples/kafka/binding/event-binding.yaml
deleted file mode 100644
index 46fb257cd..000000000
--- a/archived/v0.22-docs/eventing/samples/kafka/binding/event-binding.yaml
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright 2020 The Knative Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Replace the following before applying this file:
-# KAFKA_CONSUMER_GROUP_NAME: Name of Kafka consumer group
-# KAFKA_BOOTSTRAP_SERVERS: Array of bootstrap servers
-# KAFKA_SASL_ENABLE: Truthy value to enable/disable SASL, disabled by default (optional)
-# KAFKA_SASL_USER_SECRET_NAME: Name of secret containing SASL user (optional)
-# KAFKA_SASL_USER_SECRET_KEY: Key within secret containing SASL user (optional)
-# KAFKA_SASL_PASSWORD_SECRET_NAME: Name of secret containing SASL password (optional)
-# KAFKA_SASL_PASSWORD_SECRET_KEY: Key within secret containing SASL password (optional)
-# KAFKA_TLS_ENABLE: Truthy to enable TLS, disabled by default (optional)
-# KAFKA_TLS_CERT_SECRET_NAME: Name of secret containing client cert to use when connecting with TLS (optional)
-# KAFKA_TLS_CERT_SECRET_KEY: Key within secret containing client cert to use when connecting with TLS (optional)
-# KAFKA_TLS_KEY_SECRET_NAME: Name of secret containing client key to use when connecting with TLS (optional)
-# KAFKA_TLS_KEY_SECRET_KEY: Key within secret containing client key to use when connecting with TLS (optional)
-# KAFKA_TLS_CA_CERT_SECRET_NAME: Name of secret containing server CA cert to use when connecting with TLS (optional)
-# KAFKA_TLS_CA_CERT_SECRET_KEY: Key within secret containing server CA cert to use when connecting with TLS (optional)
-
-apiVersion: sources.knative.dev/v1beta1
-kind: KafkaBinding
-metadata:
- name: kafka-binding
-spec:
- consumerGroup: KAFKA_CONSUMER_GROUP_NAME
- bootstrapServers:
- - KAFKA_BOOTSTRAP_SERVERS
- net:
- sasl:
- enable: KAFKA_SASL_ENABLE
- user:
- secretKeyRef:
- name: KAFKA_SASL_USER_SECRET_NAME
- key: KAFKA_SASL_USER_SECRET_KEY
- password:
- secretKeyRef:
- name: KAFKA_SASL_PASSWORD_SECRET_NAME
- key: KAFKA_SASL_PASSWORD_SECRET_KEY
- tls:
- enable: KAFKA_TLS_ENABLE
- cert:
- secretKeyRef:
- name: KAFKA_TLS_CERT_SECRET_NAME
- key: KAFKA_TLS_CERT_SECRET_KEY
- key:
- secretKeyRef:
- name: KAFKA_TLS_KEY_SECRET_NAME
- key: KAFKA_TLS_KEY_SECRET_KEY
- caCert:
- secretKeyRef:
- name: KAFKA_TLS_CA_CERT_SECRET_NAME
- key: KAFKA_TLS_CA_CERT_SECRET_KEY
diff --git a/archived/v0.22-docs/eventing/samples/kafka/binding/event-display.yaml b/archived/v0.22-docs/eventing/samples/kafka/binding/event-display.yaml
deleted file mode 100644
index 3a22f440e..000000000
--- a/archived/v0.22-docs/eventing/samples/kafka/binding/event-display.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright 2020 The Knative Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
- apiVersion: serving.knative.dev/v1
- kind: Service
- metadata:
- name: event-display
- spec:
- template:
- spec:
- containers:
- - image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display
diff --git a/archived/v0.22-docs/eventing/samples/kafka/binding/event-source.yaml b/archived/v0.22-docs/eventing/samples/kafka/binding/event-source.yaml
deleted file mode 100644
index 835275157..000000000
--- a/archived/v0.22-docs/eventing/samples/kafka/binding/event-source.yaml
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright 2020 The Knative Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Replace the following before applying this file:
-# KAFKA_CONSUMER_GROUP_NAME: Name of Kafka consumer group
-# KAFKA_BOOTSTRAP_SERVERS: Array of bootstrap servers
-# KAFKA_TOPICS: Array of topics
-# KAFKA_SASL_ENABLE: Truthy value to enable/disable SASL, disabled by default (optional)
-# KAFKA_SASL_USER_SECRET_NAME: Name of secret containing SASL user (optional)
-# KAFKA_SASL_USER_SECRET_KEY: Key within secret containing SASL user (optional)
-# KAFKA_SASL_PASSWORD_SECRET_NAME: Name of secret containing SASL password (optional)
-# KAFKA_SASL_PASSWORD_SECRET_KEY: Key within secret containing SASL password (optional)
-# KAFKA_TLS_ENABLE: Truthy to enable TLS, disabled by default (optional)
-# KAFKA_TLS_CERT_SECRET_NAME: Name of secret containing client cert to use when connecting with TLS (optional)
-# KAFKA_TLS_CERT_SECRET_KEY: Key within secret containing client cert to use when connecting with TLS (optional)
-# KAFKA_TLS_KEY_SECRET_NAME: Name of secret containing client key to use when connecting with TLS (optional)
-# KAFKA_TLS_KEY_SECRET_KEY: Key within secret containing client key to use when connecting with TLS (optional)
-# KAFKA_TLS_CA_CERT_SECRET_NAME: Name of secret containing server CA cert to use when connecting with TLS (optional)
-# KAFKA_TLS_CA_CERT_SECRET_KEY: Key within secret containing server CA cert to use when connecting with TLS (optional)
-
-apiVersion: sources.knative.dev/v1beta1
-kind: KafkaSource
-metadata:
- name: kafka-source
-spec:
- consumerGroup: KAFKA_CONSUMER_GROUP_NAME
- bootstrapServers:
- - KAFKA_BOOTSTRAP_SERVERS
- topics:
- - KAFKA_TOPICS
- net:
- sasl:
- enable: KAFKA_SASL_ENABLE
- user:
- secretKeyRef:
- name: KAFKA_SASL_USER_SECRET_NAME
- key: KAFKA_SASL_USER_SECRET_KEY
- password:
- secretKeyRef:
- name: KAFKA_SASL_PASSWORD_SECRET_NAME
- key: KAFKA_SASL_PASSWORD_SECRET_KEY
- tls:
- enable: KAFKA_TLS_ENABLE
- cert:
- secretKeyRef:
- name: KAFKA_TLS_CERT_SECRET_NAME
- key: KAFKA_TLS_CERT_SECRET_KEY
- key:
- secretKeyRef:
- name: KAFKA_TLS_KEY_SECRET_NAME
- key: KAFKA_TLS_KEY_SECRET_KEY
- caCert:
- secretKeyRef:
- name: KAFKA_TLS_CA_CERT_SECRET_NAME
- key: KAFKA_TLS_CA_CERT_SECRET_KEY
- resources:
- limits:
- cpu: 250m
- memory: 512Mi
- requests:
- cpu: 250m
- memory: 512Mi
- sink:
- ref:
- apiVersion: serving.knative.dev/v1
- kind: Service
- name: event-display
diff --git a/archived/v0.22-docs/eventing/samples/kafka/binding/index.html b/archived/v0.22-docs/eventing/samples/kafka/binding/index.html
deleted file mode 100644
index ae5c3ce20..000000000
--- a/archived/v0.22-docs/eventing/samples/kafka/binding/index.html
+++ /dev/null
@@ -1,2530 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-Apache Kafka Binding Example | Knative
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Apache Kafka Binding Example | Knative
-
-
-
-
-
-
-
-
-
Black lives matter.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
KafkaBinding is responsible for injecting Kafka bootstrap connection information
-into a Kubernetes resource that embed a PodSpec (as spec.template.spec). This
-enables easy bootstrapping of a Kafka client.
-
Create a Job that uses KafkaBinding
-
In the below example a Kubernetes Job will be using the KafkaBinding to produce
-messages on a Kafka Topic, which will be received by the Event Display service
-via Kafka Source
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Creating an Apache Kafka channel using the default channel configuration
-
Now that KafkaChannel is set as the default channel configuration, you can use
-the channels.messaging.knative.dev CRD to create a new Apache Kafka channel,
-using the generic Channel:
The Apache Kafka topic that is created by the channel implementation is prefixed
-with knative-messaging-kafka. This indicates it is an Apache Kafka channel
-from Knative. It contains the name of the namespace, default in this example,
-followed by the actual name of the channel.
-
Configuring the Knative broker for Apache Kafka channels
-
To setup a broker that will use the new default Kafka channels, you must create
-a new default broker, using the command:
Creating a service and trigger to use the Apache Kafka broker
-
To use the Apache Kafka based broker, let’s take a look at a simple demo. Use
-theApiServerSource to publish events to the broker as well as the Trigger
-API, which then routes events to a Knative Service.
-
-
-
Install ksvc, using the command:
-
kubectl apply -f 000-ksvc.yaml
-
-
-
Install a source that publishes to the default broker
-
kubectl apply -f 020-k8s-events.yaml
-
-
-
Create a trigger that routes the events to the ksvc:
-
kubectl apply -f 030-trigger.yaml
-
-
-
Verifying your Apache Kafka channel and broker
-
Now that your Eventing cluster is configured for Apache Kafka, you can verify
-your configuration with the following options.
-
Receive events via Knative
-
Now you can see the events in the log of the ksvc using the command:
In production environments it is common that the Apache Kafka cluster is secured using TLS or SASL. This section shows how to confiugure the KafkaChannel to work against a protected Apache Kafka cluster, with the two supported TLS and SASL authentication methods.
-
TLS authentication
-
To use TLS authentication you must create:
-
-
A CA certificate
-
A client certificate and key
-
-
NOTE: Kafka channels require these files to be in .pem format. If your files are in a different format, you must convert them to .pem.
-
-
Create the certificate files as secrets in your chosen namespace:
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
This will install a small, non-production, cluster of Apache Kafka. To verify
-your installation, check if the pods for Strimzi are all up, in the kafka
-namespace:
NOTE: For production ready installs check Strimzi.
-
-
Installation script
-
If you want to install the latest version of Strimzi, in just one step, we have
-a script for your convenience, which does exactly the same
-steps that are listed above:
-
$ ./kafka_setup.sh
-
Examples of Apache Kafka and Knative
-
A number of different examples, showing the KafkaSource, KafkaChannel and
-KafkaBinding can be found here:
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/samples/kafka/index.xml b/archived/v0.22-docs/eventing/samples/kafka/index.xml
deleted file mode 100644
index bb4987874..000000000
--- a/archived/v0.22-docs/eventing/samples/kafka/index.xml
+++ /dev/null
@@ -1,774 +0,0 @@
-
-
- Knative – Apache Kafka examples
- https://knative.dev/v0.22-docs/eventing/samples/kafka/
- Recent content in Apache Kafka examples on Knative
- Hugo -- gohugo.io
-
-
-
-
-
-
-
-
-
-
- V0.22-Docs: Apache Kafka Binding Example
- https://knative.dev/v0.22-docs/eventing/samples/kafka/binding/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/kafka/binding/
-
-
-
- <p>KafkaBinding is responsible for injecting Kafka bootstrap connection information
-into a Kubernetes resource that embed a PodSpec (as <code>spec.template.spec</code>). This
-enables easy bootstrapping of a Kafka client.</p>
-<h2 id="create-a-job-that-uses-kafkabinding">Create a Job that uses KafkaBinding</h2>
-<p>In the below example a Kubernetes Job will be using the KafkaBinding to produce
-messages on a Kafka Topic, which will be received by the Event Display service
-via Kafka Source</p>
-<h3 id="prerequisites">Prerequisites</h3>
-<ol>
-<li>You must ensure that you meet the
-<a href="../index.html">prerequisites listed in the Apache Kafka overview</a>.</li>
-<li>This feature is available from Knative Eventing 0.15+</li>
-</ol>
-<h3 id="creating-a-kafkasource-source-crd">Creating a <code>KafkaSource</code> source CRD</h3>
-<ol>
-<li>
-<p>Install the <code>KafkaSource</code> sub-component to your Knative cluster:</p>
-<pre><code>kubectl apply -f https://storage.googleapis.com/knative-releases/eventing-contrib/latest/kafka-source.yaml
-
-</code></pre></li>
-<li>
-<p>Check that the <code>kafka-controller-manager-0</code> pod is running.</p>
-<pre><code>kubectl get pods --namespace knative-sources
-NAME READY STATUS RESTARTS AGE
-kafka-controller-manager-0 1/1 Running 0 42m
-</code></pre></li>
-</ol>
-<h3 id="create-the-event-display-service">Create the Event Display service</h3>
-<ol>
-<li>
-<p>(Optional) Source code for Event Display service</p>
-<p>Get the source code of Event Display container image from
-<a href="https://github.com/knative/eventing-contrib/blob/main/cmd/event_display/main.go">here</a></p>
-</li>
-<li>
-<p>Deploy the Event Display Service via kubectl:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><pre><code>$ kubectl apply --filename event-display.yaml
-...
-service.serving.knative.dev/event-display created
-</code></pre></li>
-<li>
-<p>(Optional) Deploy the Event Display Service via kn cli:</p>
-<p>Alternatively, you can create the knative service using the <code>kn</code> cli like
-below</p>
-<pre><code>kn service create event-display --image=gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display
-</code></pre></li>
-<li>
-<p>Ensure that the Service pod is running. The pod name will be prefixed with
-<code>event-display</code>.</p>
-<pre><code>$ kubectl get pods
-NAME READY STATUS RESTARTS AGE
-event-display-00001-deployment-5d5df6c7-gv2j4 2/2 Running 0 72s
-...
-</code></pre></li>
-</ol>
-<h3 id="apache-kafka-event-source">Apache Kafka Event Source</h3>
-<ol>
-<li>
-<p>Modify <code>event-source.yaml</code> accordingly with bootstrap servers, topics,
-etc…:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sources.knative.dev/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KafkaSource</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-source</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">consumerGroup</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-group</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">bootstrapServers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">my-cluster-kafka-bootstrap.kafka:9092</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic">#note the kafka namespace</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">topics</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">logs</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>
-<p>Deploy the event source.</p>
-<pre><code>$ kubectl apply -f event-source.yaml
-...
-kafkasource.sources.knative.dev/kafka-source created
-</code></pre></li>
-<li>
-<p>Check that the event source pod is running. The pod name will be prefixed
-with <code>kafka-source</code>.</p>
-<pre><code>$ kubectl get pods
-NAME READY STATUS RESTARTS AGE
-kafka-source-xlnhq-5544766765-dnl5s 1/1 Running 0 40m
-</code></pre></li>
-</ol>
-<h3 id="kafka-binding-resource">Kafka Binding Resource</h3>
-<p>Create the KafkaBinding that will inject kafka bootstrap information into select
-<code>Jobs</code>:</p>
-<ol>
-<li>
-<p>Modify <code>kafka-binding.yaml</code> accordingly with bootstrap servers etc…:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">bindings.knative.dev/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KafkaBinding</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-binding-test</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">subject</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">batch/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Job</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">selector</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">matchLabels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kafka.topic</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"logs"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">bootstrapServers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">my-cluster-kafka-bootstrap.kafka:9092</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-</ol>
-<p>In this case, we will bind any <code>Job</code> with the labels <code>kafka.topic: "logs"</code>.</p>
-<h3 id="create-kubernetes-job">Create Kubernetes Job</h3>
-<ol>
-<li>
-<p>Source code for kafka-publisher service</p>
-<p>Get the source code of kafka-publisher container image from
-<a href="https://github.com/knative-sandbox/eventing-kafka/blob/main/test/test_images/kafka-publisher/main.go">here</a></p>
-</li>
-<li>
-<p>Now we will use the kafka-publisher container to send events to kafka topic
-when the Job runs.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">batch/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Job</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kafka.topic</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"logs"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-publisher-job</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">backoffLimit</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">completions</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">parallelism</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">annotations</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sidecar.istio.io/inject</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"false"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">restartPolicy</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Never</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">docker.io/murugappans/kafka-publisher-1974f83e2ff7c8994707b5e8731528e8@sha256:fd79490514053c643617dc72a43097251fed139c966fd5d131134a0e424882de</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">env</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KAFKA_TOPIC</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"logs"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KAFKA_KEY</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"0"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KAFKA_HEADERS</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"content-type:application/json"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KAFKA_VALUE</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">'{"msg":"This is a test!"}'</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-publisher</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>
-<p>Check that the Job has run successfully.</p>
-<pre><code>$ kubectl get jobs
-NAME COMPLETIONS DURATION AGE
-kafka-publisher-job 1/1 7s 7s
-</code></pre></li>
-</ol>
-<h3 id="verify">Verify</h3>
-<ol>
-<li>
-<p>Ensure the Event Display received the message sent to it by the Event Source.</p>
-<pre><code>$ kubectl logs --selector='serving.knative.dev/service=event-display' -c user-container
-
-☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: dev.knative.kafka.event
- source: /apis/v1/namespaces/default/kafkasources/kafka-source#logs
- subject: partition:0#1
- id: partition:0/offset:1
- time: 2020-05-17T19:45:02.7Z
- datacontenttype: application/json
-Extensions,
- kafkaheadercontenttype: application/json
- key: 0
- traceparent: 00-f383b779f512358b24ffbf6556a6d6da-cacdbe78ef9b5ad3-00
-Data,
- {
- "msg": "This is a test!"
- }
-
-</code></pre></li>
-</ol>
-<h2 id="connecting-to-a-tls-enabled-kafka-broker">Connecting to a TLS enabled Kafka broker</h2>
-<p>The KafkaBinding supports TLS and SASL authentication methods. For injecting TLS
-authentication, please have the below files</p>
-<ul>
-<li>CA Certificate</li>
-<li>Client Certificate and Key</li>
-</ul>
-<p>These files are expected to be in pem format, if it is in other format like jks
-, please convert to pem.</p>
-<ol>
-<li>
-<p>Create the certificate files as secrets in the namespace where KafkaBinding
-is going to be set up</p>
-<pre><code>$ kubectl create secret generic cacert --from-file=caroot.pem
-secret/cacert created
-
-$ kubectl create secret tls kafka-secret --cert=certificate.pem --key=key.pem
-secret/key created
-
-</code></pre></li>
-<li>
-<p>Apply the kafkabinding-tls.yaml, change bootstrapServers accordingly.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sources.knative.dev/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KafkaBinding</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-source-with-tls</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">subject</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">batch/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Job</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">selector</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">matchLabels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kafka.topic</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"logs"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">net</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">tls</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">enable</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">true</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">cert</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">secretKeyRef</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">key</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">tls.crt</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-secret</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">key</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">secretKeyRef</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">key</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">tls.key</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-secret</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">caCert</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">secretKeyRef</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">key</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">caroot.pem</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">cacert</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">consumerGroup</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-group</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">bootstrapServers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">my-secure-kafka-bootstrap.kafka:443</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-</ol>
-
-
-
-
-
- V0.22-Docs: Apache Kafka Channel Example
- https://knative.dev/v0.22-docs/eventing/samples/kafka/channel/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/kafka/channel/
-
-
-
- <p>You can install and configure the Apache Kafka CRD (<code>KafkaChannel</code>) as the
-default channel configuration in Knative Eventing.</p>
-<h2 id="prerequisites">Prerequisites</h2>
-<ul>
-<li>Ensure that you meet the
-<a href="../index.html">prerequisites listed in the Apache Kafka overview</a>.</li>
-<li>A Kubernetes cluster with
-<a href="../../../../install/index.html">Knative Kafka Channel installed</a>.</li>
-</ul>
-<h2 id="creating-a-kafkachannel-channel-crd">Creating a <code>KafkaChannel</code> channel CRD</h2>
-<p>Create a new object by configuring the YAML file as follows:</p>
-<pre><code>cat <<-EOF | kubectl apply -f -
----
-apiVersion: messaging.knative.dev/v1beta1
-kind: KafkaChannel
-metadata:
- name: my-kafka-channel
-spec:
- numPartitions: 3
- replicationFactor: 1
-EOF
-</code></pre><h2 id="specifying-the-default-channel-configuration">Specifying the default channel configuration</h2>
-<p>To configure the usage of the <code>KafkaChannel</code> CRD as the
-<a href="../../../channels/default-channels">default channel configuration</a>, edit the
-<code>default-ch-webhook</code> ConfigMap as follows:</p>
-<pre><code>cat <<-EOF | kubectl apply -f -
----
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: default-ch-webhook
- namespace: knative-eventing
-data:
- # Configuration for defaulting channels that do not specify CRD implementations.
- default-ch-config: |
- clusterDefault:
- apiVersion: messaging.knative.dev/v1beta1
- kind: KafkaChannel
- spec:
- numPartitions: 3
- replicationFactor: 1
-EOF
-</code></pre><h2 id="creating-an-apache-kafka-channel-using-the-default-channel-configuration">Creating an Apache Kafka channel using the default channel configuration</h2>
-<p>Now that <code>KafkaChannel</code> is set as the default channel configuration, you can use
-the <code>channels.messaging.knative.dev</code> CRD to create a new Apache Kafka channel,
-using the generic <code>Channel</code>:</p>
-<pre><code>cat <<-EOF | kubectl apply -f -
----
-apiVersion: messaging.knative.dev/v1
-kind: Channel
-metadata:
- name: testchannel-one
-EOF
-</code></pre><p>Check Kafka for a <code>testchannel</code> topic. With Strimzi this can be done by using
-the command:</p>
-<pre><code>kubectl -n kafka exec -it my-cluster-kafka-0 -- bin/kafka-topics.sh --zookeeper localhost:2181 --list
-</code></pre><p>The result is:</p>
-<pre><code>...
-knative-messaging-kafka.default.testchannel-one
-...
-</code></pre><p>The Apache Kafka topic that is created by the channel implementation is prefixed
-with <code>knative-messaging-kafka</code>. This indicates it is an Apache Kafka channel
-from Knative. It contains the name of the namespace, <code>default</code> in this example,
-followed by the actual name of the channel.</p>
-<h2 id="configuring-the-knative-broker-for-apache-kafka-channels">Configuring the Knative broker for Apache Kafka channels</h2>
-<p>To setup a broker that will use the new default Kafka channels, you must create
-a new <em>default</em> broker, using the command:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create -f - <span style="color:#4e9a06"><<EOF
-</span><span style="color:#4e9a06">apiVersion: eventing.knative.dev/v1
-</span><span style="color:#4e9a06">kind: Broker
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: default
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div><p>This will give you two pods, such as:</p>
-<pre><code>default-broker-filter-64658fc79f-nf596 1/1 Running 0 15m
-default-broker-ingress-ff79755b6-vj9jt 1/1 Running 0 15m
-
-</code></pre><p>Inside the Apache Kafka cluster you should see two new topics, such as:</p>
-<pre><code>...
-knative-messaging-kafka.default.default-kn2-ingress
-knative-messaging-kafka.default.default-kn2-trigger
-...
-</code></pre><h2 id="creating-a-service-and-trigger-to-use-the-apache-kafka-broker">Creating a service and trigger to use the Apache Kafka broker</h2>
-<p>To use the Apache Kafka based broker, let’s take a look at a simple demo. Use
-the<code>ApiServerSource</code> to publish events to the broker as well as the <code>Trigger</code>
-API, which then routes events to a Knative <code>Service</code>.</p>
-<ol>
-<li>
-<p>Install <code>ksvc</code>, using the command:</p>
-<pre><code>kubectl apply -f 000-ksvc.yaml
-</code></pre></li>
-<li>
-<p>Install a source that publishes to the default broker</p>
-<pre><code>kubectl apply -f 020-k8s-events.yaml
-</code></pre></li>
-<li>
-<p>Create a trigger that routes the events to the <code>ksvc</code>:</p>
-<pre><code>kubectl apply -f 030-trigger.yaml
-</code></pre></li>
-</ol>
-<h2 id="verifying-your-apache-kafka-channel-and-broker">Verifying your Apache Kafka channel and broker</h2>
-<p>Now that your Eventing cluster is configured for Apache Kafka, you can verify
-your configuration with the following options.</p>
-<h3 id="receive-events-via-knative">Receive events via Knative</h3>
-<p>Now you can see the events in the log of the <code>ksvc</code> using the command:</p>
-<pre><code>kubectl logs --selector='serving.knative.dev/service=broker-kafka-display' -c user-container
-</code></pre><h2 id="authentication-against-an-apache-kafka">Authentication against an Apache Kafka</h2>
-<p>In production environments it is common that the Apache Kafka cluster is secured using <a href="http://kafka.apache.org/documentation/#security_ssl">TLS</a> or <a href="http://kafka.apache.org/documentation/#security_sasl">SASL</a>. This section shows how to confiugure the <code>KafkaChannel</code> to work against a protected Apache Kafka cluster, with the two supported TLS and SASL authentication methods.</p>
-<h3 id="tls-authentication">TLS authentication</h3>
-<p>To use TLS authentication you must create:</p>
-<ul>
-<li>A CA certificate</li>
-<li>A client certificate and key</li>
-</ul>
-<p><strong>NOTE:</strong> Kafka channels require these files to be in <code>.pem</code> format. If your files are in a different format, you must convert them to <code>.pem</code>.</p>
-<ol>
-<li>Create the certificate files as secrets in your chosen namespace:</li>
-</ol>
-<pre><code>$ kubectl create secret --namespace <namespace> generic <kafka-auth-secret> \
- --from-file=ca.crt=caroot.pem \
- --from-file=user.crt=certificate.pem \
- --from-file=user.key=key.pem
-</code></pre><p><em>NOTE:</em> It is important to use the same keys (<code>ca.crt</code>, <code>user.crt</code> and <code>user.key</code>).</p>
-<p>Reference your secret and the namespace of the secret in the <code>config-kafka</code> ConfigMap:</p>
-<pre><code>apiVersion: v1
-kind: ConfigMap
-metadata:
- name: config-kafka
- namespace: knative-eventing
-data:
- bootstrapServers: <bootstrap-servers>
- authSecretName: <kafka-auth-secret>
- authSecretNamespace: <namespace>
-</code></pre><h3 id="sasl-authentication">SASL authentication</h3>
-<p>To use SASL authentication, you will need the following information:</p>
-<ul>
-<li>A username and password.</li>
-<li>The type of SASL mechanism you wish to use. For example; <code>PLAIN</code>, <code>SCRAM-SHA-256</code> or <code>SCRAM-SHA-512</code>.</li>
-</ul>
-<p><strong>NOTE:</strong> It is recommended to also enable TLS. If you enable this, you will also need the <code>ca.crt</code> certificate as described in the previous section.</p>
-<ol>
-<li>Create the certificate files as secrets in your chosen namespace:</li>
-</ol>
-<pre><code>$ kubectl create secret --namespace <namespace> generic <kafka-auth-secret> \
- --from-file=ca.crt=caroot.pem \
- --from-literal=password="SecretPassword" \
- --from-literal=saslType="SCRAM-SHA-512" \
- --from-literal=user="my-sasl-user"
-</code></pre><p><em>NOTE:</em> It is important to use the same keys; <code>user</code>, <code>password</code> and <code>saslType</code>.</p>
-<p>Reference your secret and the namespace of the secret in the <code>config-kafka</code> ConfigMap:</p>
-<pre><code>apiVersion: v1
-kind: ConfigMap
-metadata:
- name: config-kafka
- namespace: knative-eventing
-data:
- bootstrapServers: <bootstrap-servers>
- authSecretName: <kafka-auth-Secret>
- authSecretNamespace: <namespace>
-</code></pre>
-
-
-
-
- V0.22-Docs: Apache Kafka Source Example
- https://knative.dev/v0.22-docs/eventing/samples/kafka/source/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/kafka/source/
-
-
-
- <p>Tutorial on how to build and deploy a <code>KafkaSource</code> <a href="../../../sources/index.html">Eventing source</a> using a Knative Serving <code>Service</code>.</p>
-<h2 id="prerequisites">Prerequisites</h2>
-<ul>
-<li>Ensure that you meet the <a href="../index.html">prerequisites listed in the Apache Kafka overview</a>.</li>
-<li>A Kubernetes cluster with <a href="../../../../install/index.html">Knative Kafka Source installed</a>.</li>
-</ul>
-<h2 id="apache-kafka-topic-optional">Apache Kafka Topic (Optional)</h2>
-<ol>
-<li>If using Strimzi, you can set a topic modifying <code>source/kafka-topic.yaml</code>
-with your desired:</li>
-</ol>
-<ul>
-<li>
-<p>Topic</p>
-</li>
-<li>
-<p>Cluster Name</p>
-</li>
-<li>
-<p>Partitions</p>
-</li>
-<li>
-<p>Replicas</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka.strimzi.io/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KafkaTopic</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-demo-topic</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">strimzi.io/cluster</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-cluster</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">partitions</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">3</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">replicas</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">config</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">retention.ms</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">7200000</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">segment.bytes</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">1073741824</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-</ul>
-<ol start="2">
-<li>
-<p>Deploy the <code>KafkaTopic</code></p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">$ kubectl apply -f strimzi-topic.yaml
-kafkatopic.kafka.strimzi.io/knative-demo-topic created
-</code></pre></div></li>
-<li>
-<p>Ensure the <code>KafkaTopic</code> is running.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">$ kubectl -n kafka get kafkatopics.kafka.strimzi.io
-NAME AGE
-knative-demo-topic 16s
-</code></pre></div></li>
-</ol>
-<h2 id="create-the-event-display-service">Create the Event Display service</h2>
-<ol>
-<li>
-<p>Download a copy of the code:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">git clone -b <span style="color:#4e9a06">"{{< branch >}}"</span> https://github.com/knative/docs knative-docs
-<span style="color:#204a87">cd</span> knative-docs/docs/eventing/samples/kafka/source
-</code></pre></div></li>
-<li>
-<p>Build the Event Display Service (<code>event-display.yaml</code>)</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#8f5902;font-style:italic"># This corresponds to</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># https://github.com/knative/eventing-contrib/tree/main/cmd/event_display/main.go</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>
-<p>Deploy the Event Display Service</p>
-<pre><code>$ kubectl apply --filename event-display.yaml
-...
-service.serving.knative.dev/event-display created
-</code></pre></li>
-<li>
-<p>Ensure that the Service pod is running. The pod name will be prefixed with
-<code>event-display</code>.</p>
-<pre><code>$ kubectl get pods
-NAME READY STATUS RESTARTS AGE
-event-display-00001-deployment-5d5df6c7-gv2j4 2/2 Running 0 72s
-...
-</code></pre></li>
-</ol>
-<h3 id="apache-kafka-event-source">Apache Kafka Event Source</h3>
-<ol>
-<li>
-<p>Modify <code>source/event-source.yaml</code> accordingly with bootstrap servers, topics,
-etc…:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sources.knative.dev/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KafkaSource</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-source</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">consumerGroup</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-group</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">bootstrapServers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">my-cluster-kafka-bootstrap.kafka:9092</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># note the kafka namespace</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">topics</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">knative-demo-topic</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>
-<p>Deploy the event source.</p>
-<pre><code>$ kubectl apply -f event-source.yaml
-...
-kafkasource.sources.knative.dev/kafka-source created
-</code></pre></li>
-<li>
-<p>Check that the event source pod is running. The pod name will be prefixed
-with <code>kafka-source</code>.</p>
-<pre><code>$ kubectl get pods
-NAME READY STATUS RESTARTS AGE
-kafka-source-xlnhq-5544766765-dnl5s 1/1 Running 0 40m
-</code></pre></li>
-<li>
-<p>Ensure the Apache Kafka Event Source started with the necessary
-configuration.</p>
-<pre><code>$ kubectl logs --selector='knative-eventing-source-name=kafka-source'
-{"level":"info","ts":"2020-05-28T10:39:42.104Z","caller":"adapter/adapter.go:81","msg":"Starting with config: ","Topics":".","ConsumerGroup":"...","SinkURI":"...","Name":".","Namespace":"."}
-</code></pre></li>
-</ol>
-<h3 id="verify">Verify</h3>
-<ol>
-<li>
-<p>Produce a message (<code>{"msg": "This is a test!"}</code>) to the Apache Kafka topic,
-like shown below:</p>
-<pre><code>kubectl -n kafka run kafka-producer -ti --image=strimzi/kafka:0.14.0-kafka-2.3.0 --rm=true --restart=Never -- bin/kafka-console-producer.sh --broker-list my-cluster-kafka-bootstrap:9092 --topic knative-demo-topic
-If you don't see a command prompt, try pressing enter.
->{"msg": "This is a test!"}
-</code></pre></li>
-<li>
-<p>Check that the Apache Kafka Event Source consumed the message and sent it to
-its sink properly. Since these logs are captured in debug level, edit the key <code>level</code> of <code>config-logging</code> configmap in <code>knative-sources</code> namespace to look like this:</p>
-<pre><code>data:
- loglevel.controller: info
- loglevel.webhook: info
- zap-logger-config: |
- {
- "level": "debug",
- "development": false,
- "outputPaths": ["stdout"],
- "errorOutputPaths": ["stderr"],
- "encoding": "json",
- "encoderConfig": {
- "timeKey": "ts",
- "levelKey": "level",
- "nameKey": "logger",
- "callerKey": "caller",
- "messageKey": "msg",
- "stacktraceKey": "stacktrace",
- "lineEnding": "",
- "levelEncoder": "",
- "timeEncoder": "iso8601",
- "durationEncoder": "",
- "callerEncoder": ""
- }
- }
-
-</code></pre><p>Now manually delete the kafkasource deployment and allow the <code>kafka-controller-manager</code> deployment running in <code>knative-sources</code> namespace to redeploy it. Debug level logs should be visible now.</p>
-<pre><code>$ kubectl logs --selector='knative-eventing-source-name=kafka-source'
-...
-
-{"level":"debug","ts":"2020-05-28T10:40:29.400Z","caller":"kafka/consumer_handler.go:77","msg":"Message claimed","topic":".","value":"."}
-{"level":"debug","ts":"2020-05-28T10:40:31.722Z","caller":"kafka/consumer_handler.go:89","msg":"Message marked","topic":".","value":"."}
-</code></pre></li>
-<li>
-<p>Ensure the Event Display received the message sent to it by the Event Source.</p>
-<pre><code>$ kubectl logs --selector='serving.knative.dev/service=event-display' -c user-container
-
-☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: dev.knative.kafka.event
- source: /apis/v1/namespaces/default/kafkasources/kafka-source#my-topic
- subject: partition:0#564
- id: partition:0/offset:564
- time: 2020-02-10T18:10:23.861866615Z
- datacontenttype: application/json
-Extensions,
- key:
-Data,
- {
- "msg": "This is a test!"
- }
-</code></pre></li>
-</ol>
-<h2 id="teardown-steps">Teardown Steps</h2>
-<ol>
-<li>
-<p>Remove the Apache Kafka Event Source</p>
-<pre><code>
-$ kubectl delete -f source/source.yaml kafkasource.sources.knative.dev
-"kafka-source" deleted
-
-</code></pre><ol start="2">
-<li>Remove the Event Display</li>
-</ol>
-<pre><code>
-$ kubectl delete -f source/event-display.yaml service.serving.knative.dev
-"event-display" deleted
-
-</code></pre><ol start="3">
-<li>Remove the Apache Kafka Event Controller</li>
-</ol>
-<pre><code>
-$ kubectl delete -f https://storage.googleapis.com/knative-releases/eventing-contrib/latest/kafka-source.yaml
-serviceaccount "kafka-controller-manager" deleted
-clusterrole.rbac.authorization.k8s.io "eventing-sources-kafka-controller"
-deleted clusterrolebinding.rbac.authorization.k8s.io
-"eventing-sources-kafka-controller" deleted
-customresourcedefinition.apiextensions.k8s.io "kafkasources.sources.knative.dev"
-deleted service "kafka-controller" deleted statefulset.apps
-"kafka-controller-manager" deleted
-
-</code></pre></li>
-<li>
-<p>(Optional) Remove the Apache Kafka Topic</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">$ kubectl delete -f kafka-topic.yaml
-kafkatopic.kafka.strimzi.io <span style="color:#4e9a06">"knative-demo-topic"</span> deleted
-</code></pre></div></li>
-</ol>
-<h2 id="optional-specify-the-key-deserializer">(Optional) Specify the key deserializer</h2>
-<p>When <code>KafkaSource</code> receives a message from Kafka, it dumps the key in the Event
-extension called <code>Key</code> and dumps Kafka message headers in the extensions
-starting with <code>kafkaheader</code>.</p>
-<p>You can specify the key deserializer among four types:</p>
-<ul>
-<li><code>string</code> (default) for UTF-8 encoded strings</li>
-<li><code>int</code> for 32-bit & 64-bit signed integers</li>
-<li><code>float</code> for 32-bit & 64-bit floating points</li>
-<li><code>byte-array</code> for a Base64 encoded byte array</li>
-</ul>
-<p>To specify it, add the label <code>kafkasources.sources.knative.dev/key-type</code> to the <code>KafkaSource</code> definition like:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sources.knative.dev/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KafkaSource</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-source</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kafkasources.sources.knative.dev/key-type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">int</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">consumerGroup</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-group</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">bootstrapServers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">my-cluster-kafka-bootstrap.kafka:9092</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># note the kafka namespace</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">topics</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">knative-demo-topic</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><h2 id="connecting-to-a-tls-enabled-kafka-broker">Connecting to a TLS enabled Kafka broker</h2>
-<p>The KafkaSource supports TLS and SASL authentication methods. For enabling TLS authentication, please have the below files</p>
-<ul>
-<li>CA Certificate</li>
-<li>Client Certificate and Key</li>
-</ul>
-<p>KafkaSource expects these files to be in pem format, if it is in other format like jks, please convert to pem.</p>
-<ol>
-<li>
-<p>Create the certificate files as secrets in the namespace where KafkaSource is going to be set up</p>
-<pre><code>
-$ kubectl create secret generic cacert --from-file=caroot.pem
-secret/cacert created
-
-$ kubectl create secret tls kafka-secret --cert=certificate.pem --key=key.pem
-secret/key created
-
-
-</code></pre></li>
-<li>
-<p>Apply the KafkaSource, change bootstrapServers and topics accordingly.</p>
-</li>
-</ol>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sources.knative.dev/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KafkaSource</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-source-with-tls</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">net</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">tls</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">enable</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">true</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">cert</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">secretKeyRef</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">key</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">tls.crt</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-secret</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">key</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">secretKeyRef</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">key</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">tls.key</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-secret</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">caCert</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">secretKeyRef</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">key</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">caroot.pem</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">cacert</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">consumerGroup</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-group</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">bootstrapServers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">my-secure-kafka-bootstrap.kafka:443</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">topics</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">knative-demo-topic</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div>
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/samples/kafka/kafka.yaml b/archived/v0.22-docs/eventing/samples/kafka/kafka.yaml
deleted file mode 100644
index 9188d7609..000000000
--- a/archived/v0.22-docs/eventing/samples/kafka/kafka.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-apiVersion: kafka.strimzi.io/v1beta1
-kind: Kafka
-metadata:
- name: my-cluster
-spec:
- kafka:
- version: 2.4.0
- replicas: 1
- listeners:
- plain: {}
- tls: {}
- config:
- offsets.topic.replication.factor: 1
- transaction.state.log.replication.factor: 1
- transaction.state.log.min.isr: 1
- log.message.format.version: "2.4"
- storage:
- type: ephemeral
- zookeeper:
- replicas: 3
- storage:
- type: ephemeral
- entityOperator:
- topicOperator: {}
- userOperator: {}
diff --git a/archived/v0.22-docs/eventing/samples/kafka/kafka_setup.sh b/archived/v0.22-docs/eventing/samples/kafka/kafka_setup.sh
deleted file mode 100644
index 0d0fa51bb..000000000
--- a/archived/v0.22-docs/eventing/samples/kafka/kafka_setup.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env bash
-set -e
-# Turn colors in this script off by setting the NO_COLOR variable in your
-# environment to any value:
-#
-# $ NO_COLOR=1 test.sh
-NO_COLOR=${NO_COLOR:-""}
-if [ -z "$NO_COLOR" ]; then
- header=$'\e[1;33m'
- reset=$'\e[0m'
-else
- header=''
- reset=''
-fi
-strimzi_version=`curl https://github.com/strimzi/strimzi-kafka-operator/releases/latest | awk -F 'tag/' '{print $2}' | awk -F '"' '{print $1}' 2>/dev/null`
-function header_text {
- echo "$header$*$reset"
-}
-header_text "Using Strimzi Version: ${strimzi_version}"
-header_text "Strimzi install"
-kubectl create namespace kafka
-curl -L "https://github.com/strimzi/strimzi-kafka-operator/releases/download/${strimzi_version}/strimzi-cluster-operator-${strimzi_version}.yaml" \
- | sed 's/namespace: .*/namespace: kafka/' \
- | kubectl -n kafka apply -f -
-header_text "Applying Strimzi Cluster file"
-kubectl -n kafka apply -f "https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/${strimzi_version}/examples/kafka/kafka-ephemeral-single.yaml"
-
diff --git a/archived/v0.22-docs/eventing/samples/kafka/source/event-display.yaml b/archived/v0.22-docs/eventing/samples/kafka/source/event-display.yaml
deleted file mode 100644
index daa0002e2..000000000
--- a/archived/v0.22-docs/eventing/samples/kafka/source/event-display.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright 2019 The Knative Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-apiVersion: serving.knative.dev/v1
-kind: Service
-metadata:
- name: event-display
-spec:
- template:
- spec:
- containers:
- - image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display
diff --git a/archived/v0.22-docs/eventing/samples/kafka/source/event-source.yaml b/archived/v0.22-docs/eventing/samples/kafka/source/event-source.yaml
deleted file mode 100644
index b4b4aa039..000000000
--- a/archived/v0.22-docs/eventing/samples/kafka/source/event-source.yaml
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright 2019 The Knative Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Replace the following before applying this file:
-# KAFKA_CONSUMER_GROUP_NAME: Name of Kafka consumer group
-# KAFKA_BOOTSTRAP_SERVERS: Comma-separated list of bootstrap servers
-# KAFKA_TOPICS: Comma-separated list of topics
-# KAFKA_SASL_ENABLE: Truthy value to enable/disable SASL, disabled by default (optional)
-# KAFKA_SASL_USER_SECRET_NAME: Name of secret containing SASL user (optional)
-# KAFKA_SASL_USER_SECRET_KEY: Key within secret containing SASL user (optional)
-# KAFKA_SASL_PASSWORD_SECRET_NAME: Name of secret containing SASL password (optional)
-# KAFKA_SASL_PASSWORD_SECRET_KEY: Key within secret containing SASL password (optional)
-# KAFKA_TLS_ENABLE: Truthy to enable TLS, disabled by default (optional)
-# KAFKA_TLS_CERT_SECRET_NAME: Name of secret containing client cert to use when connecting with TLS (optional)
-# KAFKA_TLS_CERT_SECRET_KEY: Key within secret containing client cert to use when connecting with TLS (optional)
-# KAFKA_TLS_KEY_SECRET_NAME: Name of secret containing client key to use when connecting with TLS (optional)
-# KAFKA_TLS_KEY_SECRET_KEY: Key within secret containing client key to use when connecting with TLS (optional)
-# KAFKA_TLS_CA_CERT_SECRET_NAME: Name of secret containing server CA cert to use when connecting with TLS (optional)
-# KAFKA_TLS_CA_CERT_SECRET_KEY: Key within secret containing server CA cert to use when connecting with TLS (optional)
-
-apiVersion: sources.knative.dev/v1beta1
-kind: KafkaSource
-metadata:
- name: kafka-source
-spec:
- consumerGroup: KAFKA_CONSUMER_GROUP_NAME
- bootstrapServers:
- - KAFKA_BOOTSTRAP_SERVERS
- topics:
- - KAFKA_TOPICS
- net:
- sasl:
- enable: KAFKA_SASL_ENABLE
- user:
- secretKeyRef:
- name: KAFKA_SASL_USER_SECRET_NAME
- key: KAFKA_SASL_USER_SECRET_KEY
- password:
- secretKeyRef:
- name: KAFKA_SASL_PASSWORD_SECRET_NAME
- key: KAFKA_SASL_PASSWORD_SECRET_KEY
- tls:
- enable: KAFKA_TLS_ENABLE
- cert:
- secretKeyRef:
- name: KAFKA_TLS_CERT_SECRET_NAME
- key: KAFKA_TLS_CERT_SECRET_KEY
- key:
- secretKeyRef:
- name: KAFKA_TLS_KEY_SECRET_NAME
- key: KAFKA_TLS_KEY_SECRET_KEY
- caCert:
- secretKeyRef:
- name: KAFKA_TLS_CA_CERT_SECRET_NAME
- key: KAFKA_TLS_CA_CERT_SECRET_KEY
- resources:
- limits:
- cpu: 250m
- memory: 512Mi
- requests:
- cpu: 250m
- memory: 512Mi
- sink:
- ref:
- apiVersion: serving.knative.dev/v1
- kind: Service
- name: event-display
diff --git a/archived/v0.22-docs/eventing/samples/kafka/source/index.html b/archived/v0.22-docs/eventing/samples/kafka/source/index.html
deleted file mode 100644
index aa6c25180..000000000
--- a/archived/v0.22-docs/eventing/samples/kafka/source/index.html
+++ /dev/null
@@ -1,2605 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-Apache Kafka Source Example | Knative
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Apache Kafka Source Example | Knative
-
-
-
-
-
-
-
-
-
Black lives matter.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
$ kubectl apply -f event-source.yaml
-...
-kafkasource.sources.knative.dev/kafka-source created
-
-
-
Check that the event source pod is running. The pod name will be prefixed
-with kafka-source.
-
$ kubectl get pods
-NAME READY STATUS RESTARTS AGE
-kafka-source-xlnhq-5544766765-dnl5s 1/1 Running 0 40m
-
-
-
Ensure the Apache Kafka Event Source started with the necessary
-configuration.
-
$ kubectl logs --selector='knative-eventing-source-name=kafka-source'
-{"level":"info","ts":"2020-05-28T10:39:42.104Z","caller":"adapter/adapter.go:81","msg":"Starting with config: ","Topics":".","ConsumerGroup":"...","SinkURI":"...","Name":".","Namespace":"."}
-
-
-
Verify
-
-
-
Produce a message ({"msg": "This is a test!"}) to the Apache Kafka topic,
-like shown below:
-
kubectl -n kafka run kafka-producer -ti --image=strimzi/kafka:0.14.0-kafka-2.3.0 --rm=true --restart=Never -- bin/kafka-console-producer.sh --broker-list my-cluster-kafka-bootstrap:9092 --topic knative-demo-topic
-If you don't see a command prompt, try pressing enter.
->{"msg": "This is a test!"}
-
-
-
Check that the Apache Kafka Event Source consumed the message and sent it to
-its sink properly. Since these logs are captured in debug level, edit the key level of config-logging configmap in knative-sources namespace to look like this:
Now manually delete the kafkasource deployment and allow the kafka-controller-manager deployment running in knative-sources namespace to redeploy it. Debug level logs should be visible now.
When KafkaSource receives a message from Kafka, it dumps the key in the Event
-extension called Key and dumps Kafka message headers in the extensions
-starting with kafkaheader.
-
You can specify the key deserializer among four types:
-
-
string (default) for UTF-8 encoded strings
-
int for 32-bit & 64-bit signed integers
-
float for 32-bit & 64-bit floating points
-
byte-array for a Base64 encoded byte array
-
-
To specify it, add the label kafkasources.sources.knative.dev/key-type to the KafkaSource definition like:
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/samples/kafka/source/kafka-topic.yaml b/archived/v0.22-docs/eventing/samples/kafka/source/kafka-topic.yaml
deleted file mode 100644
index b7826a6ab..000000000
--- a/archived/v0.22-docs/eventing/samples/kafka/source/kafka-topic.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2019 The Knative Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-apiVersion: kafka.strimzi.io/v1beta1
-kind: KafkaTopic
-metadata:
- name: knative-demo-topic
- namespace: kafka
- labels:
- strimzi.io/cluster: my-cluster
-spec:
- partitions: 3
- replicas: 1
- config:
- retention.ms: 7200000
- segment.bytes: 1073741824
diff --git a/archived/v0.22-docs/eventing/samples/kubernetes-event-source/index.html b/archived/v0.22-docs/eventing/samples/kubernetes-event-source/index.html
deleted file mode 100644
index 80da87876..000000000
--- a/archived/v0.22-docs/eventing/samples/kubernetes-event-source/index.html
+++ /dev/null
@@ -1,2504 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-Kubernetes event using the API Server Source | Knative
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Kubernetes event using the API Server Source | Knative
-
-
-
-
-
-
-
-
-
Black lives matter.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
This example shows how to wire
-Kubernetes cluster events,
-using the API Server Source, for consumption by a function that has been
-implemented as a Knative Service.
-
Before you begin
-
-
-
You must have a Knative cluster running both the Serving and Eventing
-components. To learn how to install the required components, see
-Installing Knative.
-
-
-
You can follow the steps below to create new files, or you clone a copy from
-the repo by running:
These instructions assume the namespace default, which you can change to your
-preferred namespace. If you use a different namespace, you will need to modify
-all the YAML files deployed in this sample to point at that namespace.
Create a Service Account that the ApiServerSource runs as. The
-ApiServerSource watches for Kubernetes events and forwards them to the
-Knative Eventing Broker. Create a file named serviceaccount.yaml and copy
-the code block below into it.
If you want to re-use an existing Service Account with the appropriate
-permissions, you need to modify the serviceaccount.yaml.
-
-
-
Enter the following command to create the service account from
-serviceaccount.yaml:
-
kubectl apply --filename serviceaccount.yaml
-
-
-
Create Event Source for Kubernetes Events
-
-
-
In order to receive events, you have to create a concrete Event Source for a
-specific namespace. Create a file named k8s-events.yaml and copy the code
-block below into it.
If you want to consume events from a different namespace or use a different
-Service Account, you need to modify k8s-events.yaml accordingly.
-
-
-
Enter the following command to create the event source:
-
kubectl apply --filename k8s-events.yaml
-
-
-
Trigger
-
In order to check the ApiServerSource is fully working, we will create a
-simple Knative Service that dumps incoming messages to its log and creates a
-Trigger from the Broker to that Knative Service.
-
-
-
Create a file named trigger.yaml and copy the code block below into it.
-
apiVersion:eventing.knative.dev/v1
-kind:Trigger
-metadata:
-name:testevents-trigger
-namespace:default
-spec:
-broker:default
-subscriber:
-ref:
-apiVersion:serving.knative.dev/v1
-kind:Service
-name:event-display
-
----
-# This is a very simple Knative Service that writes the input request to its log.
-
-apiVersion:serving.knative.dev/v1
-kind:Service
-metadata:
-name:event-display
-namespace:default
-spec:
-template:
-spec:
-containers:
-- # This corresponds to
-# https://github.com/knative/eventing-contrib/tree/main/cmd/event_display/main.go
-image:gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display
-
-
-
If the deployed ApiServerSource is pointing at a Broker other than
-default, modify trigger.yaml by adding spec.broker with the Broker’s
-name.
-
-
-
Deploy trigger.yaml:
-
kubectl apply --filename trigger.yaml
-
-
-
Create Events
-
Create events by launching a pod in the default namespace. Create a busybox
-container and immediately delete it:
-
kubectl run busybox --image=busybox --restart=Never -- ls
-kubectl delete pod busybox
-
Verify
-
We will verify that the Kubernetes events were sent into the Knative eventing
-system by looking at our message dumper function logs. If you deployed the
-Trigger, continue using this section. If not, you will need to look
-downstream yourself:
-
kubectl get pods
-kubectl logs -l serving.knative.dev/service=event-display -c user-container
-
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
You can now see the final output by inspecting the logs of the event-display
-pods. Note that since we set the PingSource to emit every minute, it might
-take some time for the events to show up in the logs.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
In this example, we are going to see how we can create a Parallel with mutually
-exclusive branches.
-
This example is the same as the
-multiple branches example except that we are
-now going to rely on the Knative
-switch function to
-provide a soft mutual exclusivity guarantee.
-
NOTE: this example must be deployed in the default namespace.
-
Prerequisites
-
Please refer to the sample overview for the prerequisites.
-
Create the Knative Services
-
Let’s first create the switcher and transformer services that we will use in our
-Parallel.
You can now see the final output by inspecting the logs of the
-me-event-display pods. Note that since we set the PingSource to emit every
-minute, it might take some time for the events to show up in the logs.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Sometimes you may want to send binary data, which cannot be directly serialized in yaml, to downstream. This can be achieved by using dataBase64 as the payload. As the name suggests, dataBase64 should carry data that is base64 encoded.
-
Please note that data and dataBase64 cannot co-exist.
-
Use the following command to create the event source with binary data from STDIN:
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/samples/sequence/index.xml b/archived/v0.22-docs/eventing/samples/sequence/index.xml
deleted file mode 100644
index 97d1615c3..000000000
--- a/archived/v0.22-docs/eventing/samples/sequence/index.xml
+++ /dev/null
@@ -1,775 +0,0 @@
-
-
- Knative – Sequence Example
- https://knative.dev/v0.22-docs/eventing/samples/sequence/
- Recent content in Sequence Example on Knative
- Hugo -- gohugo.io
-
-
-
-
-
-
-
-
-
-
- V0.22-Docs: Sequence terminal
- https://knative.dev/v0.22-docs/eventing/samples/sequence/sequence-terminal/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/sequence/sequence-terminal/
-
-
-
- <p>We are going to create the following logical configuration. We create a
-PingSource, feeding events to a <a href="../../../flows/sequence"><code>Sequence</code></a>.
-Sequence can then do either external work, or out of band create additional
-events.</p>
-<p><img src="./sequence-terminal.png" alt="Logical Configuration"></p>
-<p>The functions used in these examples live in
-<a href="https://github.com/knative/eventing-contrib/blob/main/cmd/appender/main.go">https://github.com/knative/eventing-contrib/blob/main/cmd/appender/main.go</a>.</p>
-<h2 id="prerequisites">Prerequisites</h2>
-<p>For this example, we’ll assume you have set up an <code>InMemoryChannel</code> as well as
-Knative Serving (for our functions). The examples use <code>default</code> namespace,
-again, if you want to deploy to another Namespace, you will need to modify the
-examples to reflect this.</p>
-<p>If you want to use different type of <code>Channel</code>, you will have to modify the
-<code>Sequence.Spec.ChannelTemplate</code> to create the appropriate Channel resources.</p>
-<h2 id="setup">Setup</h2>
-<h3 id="create-the-knative-services">Create the Knative Services</h3>
-<p>First create the 3 steps that will be referenced in the Steps.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">first</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/appender</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">env</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MESSAGE</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">" - Handled by 0"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">second</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/appender</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">env</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MESSAGE</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">" - Handled by 1"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">third</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/appender</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">env</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MESSAGE</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">" - Handled by 2"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default create -f ./steps.yaml
-</code></pre></div><h3 id="create-the-sequence">Create the Sequence</h3>
-<p>The <code>sequence.yaml</code> file contains the specifications for creating the Sequence.
-If you are using a different type of Channel, you need to change the
-spec.channelTemplate to point to your desired Channel.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">flows.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Sequence</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sequence</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">channelTemplate</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">messaging.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">InMemoryChannel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">steps</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">first</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">second</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">third</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Change <code>default</code> below to create the <code>Sequence</code> in the Namespace where you want
-the resources to be created.</p>
-<p>Here, if you are using different type of Channel, you need to change the
-spec.channelTemplate to point to your desired Channel.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default create -f ./sequence.yaml
-</code></pre></div><h3 id="create-the-pingsource-targeting-the-sequence">Create the PingSource targeting the Sequence</h3>
-<p>This will create a PingSource which will send a CloudEvent with
-<code>{"message": "Hello world!"}</code> as the data payload every 2 minutes.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sources.knative.dev/v1beta2</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">PingSource</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ping-source</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">schedule</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"*/2 * * * *"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">contentType</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"application/json"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">'{"message": "Hello world!"}'</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">flows.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Sequence</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sequence</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default create -f ./ping-source.yaml
-</code></pre></div><h3 id="inspecting-the-results">Inspecting the results</h3>
-<p>You can now see the final output by inspecting the logs of the event-display
-pods. Note that since we set the <code>PingSource</code> to emit every 2 minutes, it might
-take some time for the events to show up in the logs.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default get pods
-</code></pre></div><p>Let’s look at the logs for the first <code>Step</code> in the <code>Sequence</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default logs -l serving.knative.dev/service<span style="color:#ce5c00;font-weight:bold">=</span>first -c user-container --tail<span style="color:#ce5c00;font-weight:bold">=</span>-1
-
-2020/03/02 21:28:00 listening on 8080, appending <span style="color:#4e9a06">" - Handled by 0"</span> to events
-2020/03/02 21:28:01 Received a new event:
-2020/03/02 21:28:01 <span style="color:#ce5c00;font-weight:bold">[</span>2020-03-02T21:28:00.0010247Z<span style="color:#ce5c00;font-weight:bold">]</span> /apis/v1/namespaces/default/pingsources/ping-source dev.knative.sources.ping: <span style="color:#000;font-weight:bold">&</span><span style="color:#ce5c00;font-weight:bold">{</span>Sequence:0 Message:Hello world!<span style="color:#ce5c00;font-weight:bold">}</span>
-2020/03/02 21:28:01 Transform the event to:
-2020/03/02 21:28:01 <span style="color:#ce5c00;font-weight:bold">[</span>2020-03-02T21:28:00.0010247Z<span style="color:#ce5c00;font-weight:bold">]</span> /apis/v1/namespaces/default/pingsources/ping-source dev.knative.sources.ping: <span style="color:#000;font-weight:bold">&</span><span style="color:#ce5c00;font-weight:bold">{</span>Sequence:0 Message:Hello world! - Handled by 0<span style="color:#ce5c00;font-weight:bold">}</span>
-</code></pre></div><p>And you can see that the initial PingSource message <code>("Hello World!")</code> has now
-been modified by the first step in the Sequence to include " - Handled by 0".
-Exciting :)</p>
-<p>Then we can look at the output of the second Step in the <code>Sequence</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default logs -l serving.knative.dev/service<span style="color:#ce5c00;font-weight:bold">=</span>second -c user-container --tail<span style="color:#ce5c00;font-weight:bold">=</span>-1
-
-2020/03/02 21:28:02 listening on 8080, appending <span style="color:#4e9a06">" - Handled by 1"</span> to events
-2020/03/02 21:28:02 Received a new event:
-2020/03/02 21:28:02 <span style="color:#ce5c00;font-weight:bold">[</span>2020-03-02T21:28:00.0010247Z<span style="color:#ce5c00;font-weight:bold">]</span> /apis/v1/namespaces/default/pingsources/ping-source dev.knative.sources.ping: <span style="color:#000;font-weight:bold">&</span><span style="color:#ce5c00;font-weight:bold">{</span>Sequence:0 Message:Hello world! - Handled by 0<span style="color:#ce5c00;font-weight:bold">}</span>
-2020/03/02 21:28:02 Transform the event to:
-2020/03/02 21:28:02 <span style="color:#ce5c00;font-weight:bold">[</span>2020-03-02T21:28:00.0010247Z<span style="color:#ce5c00;font-weight:bold">]</span> /apis/v1/namespaces/default/pingsources/ping-source dev.knative.sources.ping: <span style="color:#000;font-weight:bold">&</span><span style="color:#ce5c00;font-weight:bold">{</span>Sequence:0 Message:Hello world! - Handled by <span style="color:#0000cf;font-weight:bold">0</span> - Handled by 1<span style="color:#ce5c00;font-weight:bold">}</span>
-</code></pre></div><p>And as expected it’s now been handled by both the first and second Step as
-reflected by the Message being now: “Hello world! - Handled by 0 - Handled by 1”</p>
-<p>Then we can look at the output of the last Step in the <code>Sequence</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default logs -l serving.knative.dev/service<span style="color:#ce5c00;font-weight:bold">=</span>third -c user-container --tail<span style="color:#ce5c00;font-weight:bold">=</span>-1
-
-2020/03/02 21:28:03 listening on 8080, appending <span style="color:#4e9a06">" - Handled by 2"</span> to events
-2020/03/02 21:28:03 Received a new event:
-2020/03/02 21:28:03 <span style="color:#ce5c00;font-weight:bold">[</span>2020-03-02T21:28:00.0010247Z<span style="color:#ce5c00;font-weight:bold">]</span> /apis/v1/namespaces/default/pingsources/ping-source dev.knative.sources.ping: <span style="color:#000;font-weight:bold">&</span><span style="color:#ce5c00;font-weight:bold">{</span>Sequence:0 Message:Hello world! - Handled by <span style="color:#0000cf;font-weight:bold">0</span> - Handled by 1<span style="color:#ce5c00;font-weight:bold">}</span>
-2020/03/02 21:28:03 Transform the event to:
-2020/03/02 21:28:03 <span style="color:#ce5c00;font-weight:bold">[</span>2020-03-02T21:28:00.0010247Z<span style="color:#ce5c00;font-weight:bold">]</span> /apis/v1/namespaces/default/pingsources/ping-source dev.knative.sources.ping: <span style="color:#000;font-weight:bold">&</span><span style="color:#ce5c00;font-weight:bold">{</span>Sequence:0 Message:Hello world! - Handled by <span style="color:#0000cf;font-weight:bold">0</span> - Handled by <span style="color:#0000cf;font-weight:bold">1</span> - Handled by 2<span style="color:#ce5c00;font-weight:bold">}</span>
-</code></pre></div>
-
-
-
-
- V0.22-Docs: Sequence wired to event-display
- https://knative.dev/v0.22-docs/eventing/samples/sequence/sequence-reply-to-event-display/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/sequence/sequence-reply-to-event-display/
-
-
-
- <p>We are going to create the following logical configuration. We create a
-PingSource, feeding events to a <a href="../../../flows/sequence"><code>Sequence</code></a>, then
-taking the output of that <code>Sequence</code> and displaying the resulting output.</p>
-<p><img src="./sequence-reply-to-event-display.png" alt="Logical Configuration"></p>
-<p>The functions used in these examples live in
-<a href="https://github.com/knative/eventing-contrib/blob/main/cmd/appender/main.go">https://github.com/knative/eventing-contrib/blob/main/cmd/appender/main.go</a>.</p>
-<h2 id="prerequisites">Prerequisites</h2>
-<p>For this example, we’ll assume you have set up an <code>InMemoryChannel</code> as well as
-Knative Serving (for our functions). The examples use <code>default</code> namespace,
-again, if you want to deploy to another Namespace, you will need to modify the
-examples to reflect this.</p>
-<p>If you want to use different type of <code>Channel</code>, you will have to modify the
-<code>Sequence.Spec.ChannelTemplate</code> to create the appropriate Channel resources.</p>
-<h2 id="setup">Setup</h2>
-<h3 id="create-the-knative-services">Create the Knative Services</h3>
-<p>Change <code>default</code> below to create the steps in the Namespace where you want
-resources created.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">first</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/appender</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">env</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MESSAGE</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">" - Handled by 0"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">second</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/appender</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">env</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MESSAGE</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">" - Handled by 1"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">third</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/appender</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">env</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MESSAGE</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">" - Handled by 2"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default create -f ./steps.yaml
-</code></pre></div><h3 id="create-the-sequence">Create the Sequence</h3>
-<p>The <code>sequence.yaml</code> file contains the specifications for creating the Sequence.
-If you are using a different type of Channel, you need to change the
-spec.channelTemplate to point to your desired Channel.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">flows.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Sequence</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sequence</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">channelTemplate</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">messaging.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">InMemoryChannel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">steps</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">first</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">second</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">third</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">reply</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Change <code>default</code> below to create the <code>Sequence</code> in the Namespace where you want
-the resources to be created.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default create -f ./sequence.yaml
-</code></pre></div><h3 id="create-the-service-displaying-the-events-created-by-sequence">Create the Service displaying the events created by Sequence</h3>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Change <code>default</code> below to create the <code>Sequence</code> in the Namespace where you want
-your resources to be created.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default create -f ./event-display.yaml
-</code></pre></div><h3 id="create-the-pingsource-targeting-the-sequence">Create the PingSource targeting the Sequence</h3>
-<p>This will create a PingSource which will send a CloudEvent with {“message”:
-“Hello world!"} as the data payload every 2 minutes.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sources.knative.dev/v1beta2</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">PingSource</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ping-source</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">schedule</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"*/2 * * * *"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">contentType</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"application/json"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">'{"message": "Hello world!"}'</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">flows.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Sequence</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sequence</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default create -f ./ping-source.yaml
-</code></pre></div><h3 id="inspecting-the-results">Inspecting the results</h3>
-<p>You can now see the final output by inspecting the logs of the event-display
-pods.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default get pods
-</code></pre></div><p>Wait a bit and then look at the logs for the event-display pod:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default logs -l serving.knative.dev/service<span style="color:#ce5c00;font-weight:bold">=</span>event-display -c user-container --tail<span style="color:#ce5c00;font-weight:bold">=</span>-1
-☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: samples.http.mode3
- source: /apis/v1/namespaces/default/pingsources/ping-source
- id: e8fa7906-ab62-4e61-9c13-a9406e2130a9
- time: 2020-03-02T20:52:00.0004957Z
- datacontenttype: application/json
-Extensions,
- knativehistory: sequence-kn-sequence-0-kn-channel.default.svc.cluster.local<span style="color:#000;font-weight:bold">;</span> sequence-kn-sequence-1-kn-channel.default.svc.cluster.local<span style="color:#000;font-weight:bold">;</span> sequence-kn-sequence-2-kn-channel.default.svc.cluster.local
- traceparent: 00-6e2947379387f35ddc933b9190af16ad-de3db0bc4e442394-00
-Data,
- <span style="color:#ce5c00;font-weight:bold">{</span>
- <span style="color:#4e9a06">"id"</span>: 0,
- <span style="color:#4e9a06">"message"</span>: <span style="color:#4e9a06">"Hello world! - Handled by 0 - Handled by 1 - Handled by 2"</span>
- <span style="color:#ce5c00;font-weight:bold">}</span>
-</code></pre></div><p>And you can see that the initial PingSource message <code>("Hello World!")</code> has been
-appended to it by each of the steps in the Sequence.</p>
-
-
-
-
-
- V0.22-Docs: Sequence wired to another Sequence
- https://knative.dev/v0.22-docs/eventing/samples/sequence/sequence-reply-to-sequence/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/sequence/sequence-reply-to-sequence/
-
-
-
- <p>We are going to create the following logical configuration. We create a
-PingSource, feeding events to a <a href="../../../flows/sequence"><code>Sequence</code></a>, then
-taking the output of that <code>Sequence</code> and sending it to a second <code>Sequence</code> and
-finally displaying the resulting output.</p>
-<p><img src="./sequence-reply-to-sequence.png" alt="Logical Configuration"></p>
-<p>The functions used in these examples live in
-<a href="https://github.com/knative/eventing-contrib/blob/main/cmd/appender/main.go">https://github.com/knative/eventing-contrib/blob/main/cmd/appender/main.go</a>.</p>
-<h2 id="prerequisites">Prerequisites</h2>
-<p>For this example, we’ll assume you have set up an <code>InMemoryChannel</code> as well as
-Knative Serving (for our functions). The examples use <code>default</code> namespace,
-again, if you want to deploy to another namespace, you will need to modify the
-examples to reflect this.</p>
-<p>If you want to use different type of <code>Channel</code>, you will have to modify the
-<code>Sequence.Spec.ChannelTemplate</code> to create the appropriate Channel resources.</p>
-<h2 id="setup">Setup</h2>
-<h3 id="create-the-knative-services">Create the Knative Services</h3>
-<p>Change <code>default</code> below to create the steps in the Namespace where you want
-resources created.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">first</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/appender</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">env</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MESSAGE</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">" - Handled by 0"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">second</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/appender</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">env</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MESSAGE</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">" - Handled by 1"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">third</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/appender</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">env</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MESSAGE</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">" - Handled by 2"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">fourth</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/appender</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">env</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MESSAGE</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">" - Handled by 3"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">fifth</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/appender</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">env</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MESSAGE</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">" - Handled by 4"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sixth</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/appender</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">env</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MESSAGE</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">" - Handled by 5"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default create -f ./steps.yaml
-</code></pre></div><h3 id="create-the-first-sequence">Create the first Sequence</h3>
-<p>The <code>sequence1.yaml</code> file contains the specifications for creating the Sequence.
-If you are using a different type of Channel, you need to change the
-spec.channelTemplate to point to your desired Channel.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">flows.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Sequence</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">first-sequence</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">channelTemplate</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">messaging.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">InMemoryChannel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">steps</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">first</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">second</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">third</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">reply</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Sequence</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">flows.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">second-sequence</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Change <code>default</code> below to create the <code>Sequence</code> in the Namespace where you want
-your resources created.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default create -f ./sequence1.yaml
-</code></pre></div><h3 id="create-the-second-sequence">Create the second Sequence</h3>
-<p>The <code>sequence2.yaml</code> file contains the specifications for creating the Sequence.
-If you are using a different type of Channel, you need to change the
-spec.channelTemplate to point to your desired Channel.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">flows.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Sequence</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">second-sequence</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">channelTemplate</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">messaging.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">InMemoryChannel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">steps</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">fourth</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">fifth</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sixth</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">reply</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default create -f ./sequence2.yaml
-</code></pre></div><h3 id="create-the-service-displaying-the-events-created-by-sequence">Create the Service displaying the events created by Sequence</h3>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containerers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Change <code>default</code> below to create the <code>Sequence</code> in the Namespace where you want
-your resources created.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default create -f ./event-display.yaml
-</code></pre></div><h3 id="create-the-pingsource-targeting-the-first-sequence">Create the PingSource targeting the first Sequence</h3>
-<p>This will create a PingSource which will send a CloudEvent with
-<code>{"message": "Hello world!"}</code> as the data payload every 2 minutes.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sources.knative.dev/v1beta2</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">PingSource</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ping-source</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">schedule</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"*/2 * * * *"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">contentType</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"application/json"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">'{"message": "Hello world!"}'</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">flows.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Sequence</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">first-sequence</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default create -f ./ping-source.yaml
-</code></pre></div><h3 id="inspecting-the-results">Inspecting the results</h3>
-<p>You can now see the final output by inspecting the logs of the event-display
-pods.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default get pods
-</code></pre></div><p>Then look at the logs for the event-display pod:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default logs -l serving.knative.dev/service<span style="color:#ce5c00;font-weight:bold">=</span>event-display -c user-container --tail<span style="color:#ce5c00;font-weight:bold">=</span>-1
-☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: dev.knative.sources.ping
- source: /apis/v1/namespaces/default/pingsources/ping-source
- id: 29d531df-78d8-4d11-9ffd-ba24045241a9
- time: 2020-03-02T21:18:00.0011708Z
- datacontenttype: application/json
-Extensions,
- knativehistory: first-sequence-kn-sequence-0-kn-channel.default.svc.cluster.local<span style="color:#000;font-weight:bold">;</span> first-sequence-kn-sequence-1-kn-channel.default.svc.cluster.local<span style="color:#000;font-weight:bold">;</span> first-sequence-kn-sequence-2-kn-channel.default.svc.cluster.local<span style="color:#000;font-weight:bold">;</span> second-sequence-kn-sequence-0-kn-channel.default.svc.cluster.local<span style="color:#000;font-weight:bold">;</span> second-sequence-kn-sequence-1-kn-channel.default.svc.cluster.local<span style="color:#000;font-weight:bold">;</span> second-sequence-kn-sequence-2-kn-channel.default.svc.cluster.local
- traceparent: 00-e5abc9de525a89ead80560b8f328de5c-fc12b64a6296f541-00
-Data,
- <span style="color:#ce5c00;font-weight:bold">{</span>
- <span style="color:#4e9a06">"id"</span>: 0,
- <span style="color:#4e9a06">"message"</span>: <span style="color:#4e9a06">"Hello world! - Handled by 0 - Handled by 1 - Handled by 2 - Handled by 3 - Handled by 4 - Handled by 5"</span>
- <span style="color:#ce5c00;font-weight:bold">}</span>
-</code></pre></div><p>And you can see that the initial PingSource message <code>("Hello World!")</code> has been
-appended to it by each of the steps in the Sequence.</p>
-
-
-
-
-
- V0.22-Docs: Using Sequence with Broker and Trigger
- https://knative.dev/v0.22-docs/eventing/samples/sequence/sequence-with-broker-trigger/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/samples/sequence/sequence-with-broker-trigger/
-
-
-
- <p>We are going to create the following logical configuration. We create a
-PingSource, feeding events into the Broker, then we create a <code>Filter</code> that wires
-those events into a <a href="../../../flows/sequence"><code>Sequence</code></a> consisting of 3
-steps. Then we take the end of the Sequence and feed newly minted events back
-into the Broker and create another Trigger which will then display those events.</p>
-<h2 id="prerequisites">Prerequisites</h2>
-<ul>
-<li>Knative Serving</li>
-<li><code>InMemoryChannel</code></li>
-</ul>
-<p><strong>NOTE:</strong> The examples use the <code>default</code> namespace.</p>
-<p>If you want to use different type of <code>Channel</code>, you will have to modify the
-<code>Sequence.Spec.ChannelTemplate</code> to create the appropriate Channel resources.</p>
-<p><img src="./sequence-with-broker-trigger.png" alt="Logical Configuration"></p>
-<p>The functions used in these examples live in
-<a href="https://github.com/knative/eventing-contrib/blob/main/cmd/appender/main.go">https://github.com/knative/eventing-contrib/blob/main/cmd/appender/main.go</a>.</p>
-<h2 id="setup">Setup</h2>
-<h3 id="creating-the-broker">Creating the Broker</h3>
-<p>To create the cluster default Broker type:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create -f - <span style="color:#4e9a06"><<EOF
-</span><span style="color:#4e9a06">apiVersion: eventing.knative.dev/v1
-</span><span style="color:#4e9a06">kind: Broker
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: default
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div><h3 id="create-the-knative-services">Create the Knative Services</h3>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">first</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/appender</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">env</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MESSAGE</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">" - Handled by 0"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">second</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/appender</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">env</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MESSAGE</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">" - Handled by 1"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">third</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/appender</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">env</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">MESSAGE</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">" - Handled by 2"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">TYPE</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"samples.http.mod3"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Change the <code>default</code> namespace below to create the services in the namespace where you have
-configured your broker.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default create -f ./steps.yaml
-</code></pre></div><h3 id="create-the-sequence">Create the Sequence</h3>
-<p>The <code>sequence.yaml</code> file contains the specifications for creating the Sequence.
-If you are using a different type of Channel, you need to change the
-spec.channelTemplate to point to your desired Channel.</p>
-<p>Also, change the spec.reply.name to point to your <code>Broker</code></p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">flows.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Sequence</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sequence</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">channelTemplate</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">messaging.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">InMemoryChannel</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">steps</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">first</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">second</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">third</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">reply</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Broker</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Change the <code>default</code> namespace below to create the sequence in the namespace where you have
-configured your broker.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default create -f ./sequence.yaml
-</code></pre></div><h3 id="create-the-pingsource-targeting-the-broker">Create the PingSource targeting the Broker</h3>
-<p>This will create a PingSource which will send a CloudEvent with {“message”:
-“Hello world!"} as the data payload every 2 minutes.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sources.knative.dev/v1beta2</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">PingSource</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ping-source</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">schedule</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"*/2 * * * *"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">contentType</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"application/json"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">'{"message": "Hello world!"}'</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Broker</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Change the <code>default</code> namespace below to create the PingSource in the namespace where you have
-configured your broker and sequence.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default create -f ./ping-source.yaml
-</code></pre></div><h3 id="create-the-trigger-targeting-the-sequence">Create the Trigger targeting the Sequence</h3>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Trigger</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sequence-trigger</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">broker</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">filter</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">attributes</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">dev.knative.sources.ping</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">subscriber</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">flows.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Sequence</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sequence</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Change the <code>default</code> namespace below to create the trigger in the namespace where you have
-configured your broker and sequence.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default create -f ./trigger.yaml
-
-</code></pre></div><h3 id="create-the-service-and-trigger-displaying-the-events-created-by-sequence">Create the Service and Trigger displaying the events created by Sequence</h3>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sequence-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/appender</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Trigger</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">display-trigger</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">broker</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">filter</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">attributes</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">type</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">samples.http.mod3</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">subscriber</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sequence-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>Change <code>default</code> namespace below to create the service and trigger in the namespace
-where you have configured your broker.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default create -f ./display-trigger.yaml
-</code></pre></div><h3 id="inspecting-the-results">Inspecting the results</h3>
-<p>You can now see the final output by inspecting the logs of the sequence-display
-pods.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default get pods
-</code></pre></div><p>View the logs for the <code>sequence-display</code> pod:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n default logs -l serving.knative.dev/service<span style="color:#ce5c00;font-weight:bold">=</span>sequence-display -c user-container --tail<span style="color:#ce5c00;font-weight:bold">=</span>-1
-☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: samples.http.mod3
- source: /apis/v1/namespaces/default/pingsources/ping-source
- id: 159bba01-054a-4ae7-b7be-d4e7c5f773d2
- time: 2020-03-03T14:56:00.000652027Z
- datacontenttype: application/json
-Extensions,
- knativearrivaltime: 2020-03-03T14:56:00.018390608Z
- knativehistory: default-kne-trigger-kn-channel.default.svc.cluster.local<span style="color:#000;font-weight:bold">;</span> sequence-kn-sequence-0-kn-channel.default.svc.cluster.local<span style="color:#000;font-weight:bold">;</span> sequence-kn-sequence-1-kn-channel.default.svc.cluster.local<span style="color:#000;font-weight:bold">;</span> sequence-kn-sequence-2-kn-channel.default.svc.cluster.local<span style="color:#000;font-weight:bold">;</span> default-kne-trigger-kn-channel.default.svc.cluster.local
- traceparent: 00-e893412106ff417a90a5695e53ffd9cc-5829ae45a14ed462-00
-Data,
- <span style="color:#ce5c00;font-weight:bold">{</span>
- <span style="color:#4e9a06">"id"</span>: 0,
- <span style="color:#4e9a06">"message"</span>: <span style="color:#4e9a06">"Hello world! - Handled by 0 - Handled by 1 - Handled by 2"</span>
- <span style="color:#ce5c00;font-weight:bold">}</span>
-</code></pre></div><p>And you can see that the initial PingSource message <code>{"Hello World!"}</code> has been
-appended to it by each of the steps in the Sequence.</p>
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/samples/sequence/sequence-reply-to-event-display/event-display.yaml b/archived/v0.22-docs/eventing/samples/sequence/sequence-reply-to-event-display/event-display.yaml
deleted file mode 100644
index 63d234e98..000000000
--- a/archived/v0.22-docs/eventing/samples/sequence/sequence-reply-to-event-display/event-display.yaml
+++ /dev/null
@@ -1,9 +0,0 @@
-apiVersion: serving.knative.dev/v1
-kind: Service
-metadata:
- name: event-display
-spec:
- template:
- spec:
- containers:
- - image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display
diff --git a/archived/v0.22-docs/eventing/samples/sequence/sequence-reply-to-event-display/index.html b/archived/v0.22-docs/eventing/samples/sequence/sequence-reply-to-event-display/index.html
deleted file mode 100644
index e1ec6e00d..000000000
--- a/archived/v0.22-docs/eventing/samples/sequence/sequence-reply-to-event-display/index.html
+++ /dev/null
@@ -1,2419 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-Sequence wired to event-display | Knative
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sequence wired to event-display | Knative
-
-
-
-
-
-
-
-
-
Black lives matter.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
We are going to create the following logical configuration. We create a
-PingSource, feeding events to a Sequence, then
-taking the output of that Sequence and displaying the resulting output.
For this example, we’ll assume you have set up an InMemoryChannel as well as
-Knative Serving (for our functions). The examples use default namespace,
-again, if you want to deploy to another Namespace, you will need to modify the
-examples to reflect this.
-
If you want to use different type of Channel, you will have to modify the
-Sequence.Spec.ChannelTemplate to create the appropriate Channel resources.
-
Setup
-
Create the Knative Services
-
Change default below to create the steps in the Namespace where you want
-resources created.
The sequence.yaml file contains the specifications for creating the Sequence.
-If you are using a different type of Channel, you need to change the
-spec.channelTemplate to point to your desired Channel.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
We are going to create the following logical configuration. We create a
-PingSource, feeding events to a Sequence, then
-taking the output of that Sequence and sending it to a second Sequence and
-finally displaying the resulting output.
For this example, we’ll assume you have set up an InMemoryChannel as well as
-Knative Serving (for our functions). The examples use default namespace,
-again, if you want to deploy to another namespace, you will need to modify the
-examples to reflect this.
-
If you want to use different type of Channel, you will have to modify the
-Sequence.Spec.ChannelTemplate to create the appropriate Channel resources.
-
Setup
-
Create the Knative Services
-
Change default below to create the steps in the Namespace where you want
-resources created.
The sequence1.yaml file contains the specifications for creating the Sequence.
-If you are using a different type of Channel, you need to change the
-spec.channelTemplate to point to your desired Channel.
Change default below to create the Sequence in the Namespace where you want
-your resources created.
-
kubectl -n default create -f ./sequence1.yaml
-
Create the second Sequence
-
The sequence2.yaml file contains the specifications for creating the Sequence.
-If you are using a different type of Channel, you need to change the
-spec.channelTemplate to point to your desired Channel.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
We are going to create the following logical configuration. We create a
-PingSource, feeding events to a Sequence.
-Sequence can then do either external work, or out of band create additional
-events.
For this example, we’ll assume you have set up an InMemoryChannel as well as
-Knative Serving (for our functions). The examples use default namespace,
-again, if you want to deploy to another Namespace, you will need to modify the
-examples to reflect this.
-
If you want to use different type of Channel, you will have to modify the
-Sequence.Spec.ChannelTemplate to create the appropriate Channel resources.
-
Setup
-
Create the Knative Services
-
First create the 3 steps that will be referenced in the Steps.
The sequence.yaml file contains the specifications for creating the Sequence.
-If you are using a different type of Channel, you need to change the
-spec.channelTemplate to point to your desired Channel.
You can now see the final output by inspecting the logs of the event-display
-pods. Note that since we set the PingSource to emit every 2 minutes, it might
-take some time for the events to show up in the logs.
-
kubectl -n default get pods
-
Let’s look at the logs for the first Step in the Sequence:
-
kubectl -n default logs -l serving.knative.dev/service=first -c user-container --tail=-1
-
-2020/03/02 21:28:00 listening on 8080, appending " - Handled by 0" to events
-2020/03/02 21:28:01 Received a new event:
-2020/03/02 21:28:01 [2020-03-02T21:28:00.0010247Z] /apis/v1/namespaces/default/pingsources/ping-source dev.knative.sources.ping: &{Sequence:0 Message:Hello world!}
-2020/03/02 21:28:01 Transform the event to:
-2020/03/02 21:28:01 [2020-03-02T21:28:00.0010247Z] /apis/v1/namespaces/default/pingsources/ping-source dev.knative.sources.ping: &{Sequence:0 Message:Hello world! - Handled by 0}
-
And you can see that the initial PingSource message ("Hello World!") has now
-been modified by the first step in the Sequence to include " - Handled by 0".
-Exciting :)
-
Then we can look at the output of the second Step in the Sequence:
-
kubectl -n default logs -l serving.knative.dev/service=second -c user-container --tail=-1
-
-2020/03/02 21:28:02 listening on 8080, appending " - Handled by 1" to events
-2020/03/02 21:28:02 Received a new event:
-2020/03/02 21:28:02 [2020-03-02T21:28:00.0010247Z] /apis/v1/namespaces/default/pingsources/ping-source dev.knative.sources.ping: &{Sequence:0 Message:Hello world! - Handled by 0}
-2020/03/02 21:28:02 Transform the event to:
-2020/03/02 21:28:02 [2020-03-02T21:28:00.0010247Z] /apis/v1/namespaces/default/pingsources/ping-source dev.knative.sources.ping: &{Sequence:0 Message:Hello world! - Handled by 0 - Handled by 1}
-
And as expected it’s now been handled by both the first and second Step as
-reflected by the Message being now: “Hello world! - Handled by 0 - Handled by 1”
-
Then we can look at the output of the last Step in the Sequence:
-
kubectl -n default logs -l serving.knative.dev/service=third -c user-container --tail=-1
-
-2020/03/02 21:28:03 listening on 8080, appending " - Handled by 2" to events
-2020/03/02 21:28:03 Received a new event:
-2020/03/02 21:28:03 [2020-03-02T21:28:00.0010247Z] /apis/v1/namespaces/default/pingsources/ping-source dev.knative.sources.ping: &{Sequence:0 Message:Hello world! - Handled by 0 - Handled by 1}
-2020/03/02 21:28:03 Transform the event to:
-2020/03/02 21:28:03 [2020-03-02T21:28:00.0010247Z] /apis/v1/namespaces/default/pingsources/ping-source dev.knative.sources.ping: &{Sequence:0 Message:Hello world! - Handled by 0 - Handled by 1 - Handled by 2}
-
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
We are going to create the following logical configuration. We create a
-PingSource, feeding events into the Broker, then we create a Filter that wires
-those events into a Sequence consisting of 3
-steps. Then we take the end of the Sequence and feed newly minted events back
-into the Broker and create another Trigger which will then display those events.
-
Prerequisites
-
-
Knative Serving
-
InMemoryChannel
-
-
NOTE: The examples use the default namespace.
-
If you want to use different type of Channel, you will have to modify the
-Sequence.Spec.ChannelTemplate to create the appropriate Channel resources.
Change the default namespace below to create the services in the namespace where you have
-configured your broker.
-
kubectl -n default create -f ./steps.yaml
-
Create the Sequence
-
The sequence.yaml file contains the specifications for creating the Sequence.
-If you are using a different type of Channel, you need to change the
-spec.channelTemplate to point to your desired Channel.
-
Also, change the spec.reply.name to point to your Broker
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/sink/index.xml b/archived/v0.22-docs/eventing/sink/index.xml
deleted file mode 100644
index 050c9b05f..000000000
--- a/archived/v0.22-docs/eventing/sink/index.xml
+++ /dev/null
@@ -1,160 +0,0 @@
-
-
- Knative – Sink
- https://knative.dev/v0.22-docs/eventing/sink/
- Recent content in Sink on Knative
- Hugo -- gohugo.io
-
-
-
-
-
-
-
-
-
-
- V0.22-Docs: Apache Kafka Sink
- https://knative.dev/v0.22-docs/eventing/sink/kafka-sink/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/sink/kafka-sink/
-
-
-
- <p>This page shows how to install and configure Apache Kafka Sink.</p>
-<h2 id="prerequisites">Prerequisites</h2>
-<p><a href="../../../install/install-eventing-with-yaml">Installing Eventing using YAML files</a>.</p>
-<h2 id="installation">Installation</h2>
-<ol>
-<li>
-<p>Install the Kafka controller:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply --filename https://github.com/knative-sandbox/eventing-kafka-broker/releases/download/v0.22.0/eventing-kafka-controller.yaml
-</code></pre></div></li>
-<li>
-<p>Install the Kafka Sink data plane:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply --filename https://github.com/knative-sandbox/eventing-kafka-broker/releases/download/v0.22.0/eventing-kafka-sink.yaml
-</code></pre></div></li>
-<li>
-<p>Verify that <code>kafka-controller</code> and <code>kafka-sink-receiver</code> are running:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl get deployments.apps -n knative-eventing
-</code></pre></div><p>Example output:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">NAME READY UP-TO-DATE AVAILABLE AGE
-eventing-controller 1/1 <span style="color:#0000cf;font-weight:bold">1</span> <span style="color:#0000cf;font-weight:bold">1</span> 10s
-eventing-webhook 1/1 <span style="color:#0000cf;font-weight:bold">1</span> <span style="color:#0000cf;font-weight:bold">1</span> 9s
-kafka-controller 1/1 <span style="color:#0000cf;font-weight:bold">1</span> <span style="color:#0000cf;font-weight:bold">1</span> 3s
-kafka-sink-receiver 1/1 <span style="color:#0000cf;font-weight:bold">1</span> <span style="color:#0000cf;font-weight:bold">1</span> 5s
-</code></pre></div></li>
-</ol>
-<h2 id="kafka-sink">Kafka Sink</h2>
-<p>A <code>KafkaSink</code> object looks like this:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1alpha1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KafkaSink</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-kafka-sink</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">topic</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">mytopic</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">bootstrapServers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">my-cluster-kafka-bootstrap.kafka:9092</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><h2 id="security">Security</h2>
-<p>Apache Kafka supports different security features, Knative supports the followings:</p>
-<ul>
-<li><a href="#authentication-using-sasl">Authentication using <code>SASL</code> without encryption</a></li>
-<li><a href="#authentication-using-sasl-and-encryption-using-ssl">Authentication using <code>SASL</code> and encryption using <code>SSL</code></a></li>
-<li><a href="#authentication-and-encryption-using-ssl">Authentication and encryption using <code>SSL</code></a></li>
-<li><a href="#encryption-using-ssl-without-client-authentication">Encryption using <code>SSL</code> without client authentication</a></li>
-</ul>
-<p>To enable security features, in the <code>KafkaSink</code> spec, we can reference a <code>Secret</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">eventing.knative.dev/v1alpha1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">KafkaSink</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my-kafka-sink</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">default</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">topic</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">mytopic</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">bootstrapServers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#000">my-cluster-kafka-bootstrap.kafka:9092</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">auth</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">secret</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">my_secret</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>The <code>Secret</code> <code>my_secret</code> must exist in the same namespace of the <code>KafkaSink</code>, in this case: <code>default</code>.</p>
-<p><em>Note: Certificates and keys must be in <a href="https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail"><code>PEM</code> format</a>.</em></p>
-<h3 id="authentication-using-sasl">Authentication using SASL</h3>
-<p>Knative supports the following SASL mechanisms:</p>
-<ul>
-<li><code>PLAIN</code></li>
-<li><code>SCRAM-SHA-256</code></li>
-<li><code>SCRAM-SHA-512</code></li>
-</ul>
-<p>To use a specific SASL mechanism replace <code><sasl_mechanism></code> with the mechanism of your choice.</p>
-<h3 id="authentication-using-sasl-without-encryption">Authentication using SASL without encryption</h3>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl create secret --namespace <namespace> generic <my_secret> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">protocol</span><span style="color:#ce5c00;font-weight:bold">=</span>SASL_PLAINTEXT <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span>sasl.mechanism<span style="color:#ce5c00;font-weight:bold">=</span><sasl_mechanism> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">user</span><span style="color:#ce5c00;font-weight:bold">=</span><my_user> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">password</span><span style="color:#ce5c00;font-weight:bold">=</span><my_password>
-</code></pre></div><h3 id="authentication-using-sasl-and-encryption-using-ssl">Authentication using SASL and encryption using SSL</h3>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl create secret --namespace <namespace> generic <my_secret> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">protocol</span><span style="color:#ce5c00;font-weight:bold">=</span>SASL_SSL <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span>sasl.mechanism<span style="color:#ce5c00;font-weight:bold">=</span><sasl_mechanism> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-file<span style="color:#ce5c00;font-weight:bold">=</span>ca.crt<span style="color:#ce5c00;font-weight:bold">=</span>caroot.pem <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">user</span><span style="color:#ce5c00;font-weight:bold">=</span><my_user> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">password</span><span style="color:#ce5c00;font-weight:bold">=</span><my_password>
-</code></pre></div><h3 id="encryption-using-ssl-without-client-authentication">Encryption using SSL without client authentication</h3>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl create secret --namespace <namespace> generic <my_secret> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">protocol</span><span style="color:#ce5c00;font-weight:bold">=</span>SSL <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-file<span style="color:#ce5c00;font-weight:bold">=</span>ca.crt<span style="color:#ce5c00;font-weight:bold">=</span><my_caroot.pem_file_path> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span>user.skip<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#204a87">true</span>
-</code></pre></div><h3 id="authentication-and-encryption-using-ssl">Authentication and encryption using SSL</h3>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl create secret --namespace <namespace> generic <my_secret> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-literal<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#000">protocol</span><span style="color:#ce5c00;font-weight:bold">=</span>SSL <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-file<span style="color:#ce5c00;font-weight:bold">=</span>ca.crt<span style="color:#ce5c00;font-weight:bold">=</span><my_caroot.pem_file_path> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-file<span style="color:#ce5c00;font-weight:bold">=</span>user.crt<span style="color:#ce5c00;font-weight:bold">=</span><my_cert.pem_file_path> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --from-file<span style="color:#ce5c00;font-weight:bold">=</span>user.key<span style="color:#ce5c00;font-weight:bold">=</span><my_key.pem_file_path>
-</code></pre></div><p><em>NOTE: <code>ca.crt</code> can be omitted to fallback to use system’s root CA set.</em></p>
-<h2 id="kafka-producer-configurations">Kafka Producer configurations</h2>
-<p>A Kafka Producer is the component responsible for sending events to the Apache Kafka cluster.
-Knative exposes all available Kafka Producer configurations that can be modified to suit your workloads.</p>
-<p>You can change these configurations by modifying the <code>config-kafka-sink-data-plane</code> config map in
-the <code>knative-eventing</code> namespace.</p>
-<p>Documentation for the settings available in this config map is available on the
-<a href="https://kafka.apache.org/documentation/">Apache Kafka website</a>,
-in particular, <a href="https://kafka.apache.org/documentation/#producerconfigs">Producer configurations</a>.</p>
-<h2 id="enable-debug-logging-for-data-plane-components">Enable debug logging for data plane components</h2>
-<p>To enable debug logging for data plane components change the logging level to <code>DEBUG</code> in the <code>kafka-config-logging</code> config map.</p>
-<ol>
-<li>
-<p>Apply the following <code>kafka-config-logging</code> config map:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ConfigMap</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">kafka-config-logging</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-eventing</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">data</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">config.xml</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000;font-weight:bold">|</span><span style="color:#8f5902;font-style:italic">
-</span><span style="color:#8f5902;font-style:italic"> <configuration>
-</span><span style="color:#8f5902;font-style:italic"> <appender name="jsonConsoleAppender" class="ch.qos.logback.core.ConsoleAppender">
-</span><span style="color:#8f5902;font-style:italic"> <encoder class="net.logstash.logback.encoder.LogstashEncoder"/>
-</span><span style="color:#8f5902;font-style:italic"> </appender>
-</span><span style="color:#8f5902;font-style:italic"> <root level="DEBUG">
-</span><span style="color:#8f5902;font-style:italic"> <appender-ref ref="jsonConsoleAppender"/>
-</span><span style="color:#8f5902;font-style:italic"> </root>
-</span><span style="color:#8f5902;font-style:italic"> </configuration></span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>
-<p>Restart the <code>kafka-sink-receiver</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl rollout restart deployment -n knative-eventing kafka-sink-receiver
-</code></pre></div></li>
-</ol>
-<h3 id="additional-information">Additional information</h3>
-<ul>
-<li>To report bugs or add feature requests, open an issue in the <a href="https://github.com/knative-sandbox/eventing-kafka-broker">eventing-kafka-broker repository</a>.</li>
-</ul>
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/sink/kafka-sink/index.html b/archived/v0.22-docs/eventing/sink/kafka-sink/index.html
deleted file mode 100644
index 63d4a8c3f..000000000
--- a/archived/v0.22-docs/eventing/sink/kafka-sink/index.html
+++ /dev/null
@@ -1,2419 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-Apache Kafka Sink | Knative
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Apache Kafka Sink | Knative
-
-
-
-
-
-
-
-
-
Black lives matter.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
NOTE: ca.crt can be omitted to fallback to use system’s root CA set.
-
Kafka Producer configurations
-
A Kafka Producer is the component responsible for sending events to the Apache Kafka cluster.
-Knative exposes all available Kafka Producer configurations that can be modified to suit your workloads.
-
You can change these configurations by modifying the config-kafka-sink-data-plane config map in
-the knative-eventing namespace.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
These samples show how to configure Camel Sources. These event sources are highly dynamic and allow you to
-generate events from a variety of systems (cloud platforms, social networks, datastores, message brokers, legacy systems, etc.),
-leveraging all the 300+ components provided by Apache Camel.
-
All Camel Sources use Apache Camel K as the runtime engine.
Install the Apache Camel K Operator in
-any namespace where you want to run Camel sources.
-
The preferred version that is compatible with Camel sources is
-Camel K v1.0.0-M4.
-
Installation instructions are provided in the
-Apache Camel K Manual.
-Documentation includes specific instructions for common Kubernetes
-environments, including development clusters.
The samples directory contains some sample sources that can be used to generate
-events.
-
The simplest example of CamelSource, that does not require additional
-configuration, is the timer source.
-
The timer source periodically generates “Hello world!” events and forwards them to the provided destination.
-
If you want, you can customize the source behavior using options available in
-the Apache Camel documentation for the
-timer component.
-All Camel components are documented in the
-Apache Camel Website.
If you have deployed the timer source, you should see new log lines appearing every
-3 seconds.
-
Run a MQTT CamelSource
-
One of the 300+ Camel components that you can leverage is Camel-Paho,
-based on the Eclipse Paho open source project.
-
A source based on Paho (like the provided MQTT CamelSource) allows to bridge any MQTT broker to a Knative resource,
-automatically converting IoT messages to Cloudevents.
-
To use the MQTT source, you need a MQTT broker running and reachable from your cluster.
-For example, it’s possible to run a Mosquito MQTT Broker for testing purposes.
-
First, edit the MQTT CamelSource and put the
-correct address of the MQTT broker in the brokerUrl field.
-You also need to provide the name of the topic that you want to subscribe to: just change paho:mytopic to match
-the topic that you want to use.
-
You can also scale this source out, in order to obtain more throughput, by changing the value of the replicas field.
-By default it creates 2 replicas for demonstration purposes.
-
To reduce noise in the event display, you can remove all previously created
-CamelSources from the namespace:
Another useful component available with Camel is the Telegram component. It can
-be used to forward messages of a Telegram chat into
-Knative channels as events.
-
Before using the provided Telegram CamelSource example, you need to follow the
-instructions on the Telegram website for creating a
-Telegram Bot. The quickest way to create a bot
-is to contact the Bot Father, another Telegram
-Bot, using your preferred Telegram client (mobile or web). After you create the
-bot, you will receive an authorization token that is needed for the source
-to work.
-
First, edit the telegram CamelSource and put the
-authorization token, replacing the <put-your-token-here> placeholder.
-
To reduce noise in the event display, you can remove all previously created
-CamelSources from the namespace:
CamelSources are not limited to using a single Camel component. For example,
-you can combine the Camel Timer component
-with the Camel HTTP component
-to periodically fetch an external API, transform the result into a Cloudevent and forward it to a
-given destination.
-
The example will retrieve a static JSON file from a remote URL, but you can edit the
-HTTP poller CamelSource to add your own API.
-
If you have previously deployed other CamelSources, to reduce noise in the event
-display, you can remove them all from the namespace:
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Create a Service Account that the ApiServerSource runs as. The
-ApiServerSource watches for Kubernetes events and forwards them to the
-Knative Eventing Broker.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
ContainerSource will start a container image which will generate events under
-certain situations and send messages to a sink URI. It also can be an easy way
-to support your own event sources in Knative. This guide shows how to configure
-ContainerSource as an event source for functions and summarizes guidelines for
-creating your own event source as a ContainerSource.
Creating the ContainerSource using the heartbeats image
-
In order to run the heartbeats container as an event source, you have to create
-a concrete ContainerSource with specific arguments and environment settings. Be
-sure to replace heartbeats_image_uri with a valid uri for your heartbeats
-image you published in the previous step.
-Note that arguments and environment variables are set and will be passed
-to the container.
-
kubectl -n containersource-example apply -f - << EOF
-apiVersion: sources.knative.dev/v1
-kind: ContainerSource
-metadata:
- name: test-heartbeats
-spec:
- template:
- spec:
- containers:
- # This corresponds to a heartbeats image uri you build and publish in the previous step
- # e.g. gcr.io/[gcloud-project]/knative.dev/eventing-contrib/cmd/heartbeats
- - image: <heartbeats_image_uri>
- name: heartbeats
- args:
- - --period=1
- env:
- - name: POD_NAME
- value: "mypod"
- - name: POD_NAMESPACE
- value: "event-test"
- sink:
- ref:
- apiVersion: v1
- kind: Service
- name: event-display
-EOF
-
Verify
-
View the logs for the event-display event consumer by
-entering the following command:
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/sources/creating-event-sources/index.xml b/archived/v0.22-docs/eventing/sources/creating-event-sources/index.xml
deleted file mode 100644
index 86c03abc0..000000000
--- a/archived/v0.22-docs/eventing/sources/creating-event-sources/index.xml
+++ /dev/null
@@ -1,305 +0,0 @@
-
-
- Knative – Creating an event source
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/
- Recent content in Creating an event source on Knative
- Hugo -- gohugo.io
-
-
-
-
-
-
-
-
-
-
- V0.22-Docs: Writing an event source using Javascript
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source-easy-way/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source-easy-way/
-
-
-
- <p>This tutorial provides instructions to build an event source in Javascript and implement it with a ContainerSource or SinkBinding.</p>
-<ul>
-<li>Using a <a href="../../containersource">ContainerSource</a> is a simple way to turn any dispatcher container into a Knative event source.</li>
-<li>Using <a href="../../sinkbinding">SinkBinding</a> provides a framework for injecting environment variables into any Kubernetes resource that has a <code>spec.template</code> and is <a href="https://pkg.go.dev/knative.dev/pkg/apis/duck/v1#PodSpecable">PodSpecable</a>.</li>
-</ul>
-<p>ContainerSource and SinkBinding both work by injecting environment variables to an application. Injected environment variables at minimum contain the URL of a sink that will receive events.</p>
-<h2 id="bootstrapping">Bootstrapping</h2>
-<p>Create the project and add the dependencies:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">npm init
-npm install cloudevents-sdk@2.0.1 --save
-</code></pre></div><p><strong>NOTE:</strong> Due to this <a href="https://github.com/cloudevents/sdk-javascript/issues/191">bug</a>, you must use version 2.0.1 of the Javascript SDK or newer.</p>
-<h2 id="using-containersource">Using ContainerSource</h2>
-<p>A ContainerSource creates a container for your event source image and manages this container.</p>
-<p>The sink URL to post the events will be made available to the application through the <code>K_SINK</code> environment variable by the ContainerSource.</p>
-<h3 id="example">Example</h3>
-<p>The following example event source emits an event to the sink every 1000 milliseconds:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-javascript" data-lang="javascript"><span style="color:#8f5902;font-style:italic">// File - index.js
-</span><span style="color:#8f5902;font-style:italic"></span>
-<span style="color:#204a87;font-weight:bold">const</span> <span style="color:#000;font-weight:bold">{</span> <span style="color:#000">CloudEvent</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">HTTPEmitter</span> <span style="color:#000;font-weight:bold">}</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">require</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"cloudevents-sdk"</span><span style="color:#000;font-weight:bold">);</span>
-
-<span style="color:#204a87;font-weight:bold">let</span> <span style="color:#000">sinkUrl</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">process</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">env</span><span style="color:#000;font-weight:bold">[</span><span style="color:#4e9a06">'K_SINK'</span><span style="color:#000;font-weight:bold">];</span>
-
-<span style="color:#000">console</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">log</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"Sink URL is "</span> <span style="color:#ce5c00;font-weight:bold">+</span> <span style="color:#000">sinkUrl</span><span style="color:#000;font-weight:bold">);</span>
-
-<span style="color:#204a87;font-weight:bold">let</span> <span style="color:#000">emitter</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#204a87;font-weight:bold">new</span> <span style="color:#000">HTTPEmitter</span><span style="color:#000;font-weight:bold">({</span>
- <span style="color:#000">url</span><span style="color:#ce5c00;font-weight:bold">:</span> <span style="color:#000">sinkUrl</span>
-<span style="color:#000;font-weight:bold">});</span>
-
-<span style="color:#204a87;font-weight:bold">let</span> <span style="color:#000">eventIndex</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#0000cf;font-weight:bold">0</span><span style="color:#000;font-weight:bold">;</span>
-<span style="color:#000">setInterval</span><span style="color:#000;font-weight:bold">(</span><span style="color:#204a87;font-weight:bold">function</span> <span style="color:#000;font-weight:bold">()</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">console</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">log</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"Emitting event #"</span> <span style="color:#ce5c00;font-weight:bold">+</span> <span style="color:#ce5c00;font-weight:bold">++</span><span style="color:#000">eventIndex</span><span style="color:#000;font-weight:bold">);</span>
-
- <span style="color:#204a87;font-weight:bold">let</span> <span style="color:#000">myevent</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#204a87;font-weight:bold">new</span> <span style="color:#000">CloudEvent</span><span style="color:#000;font-weight:bold">({</span>
- <span style="color:#000">source</span><span style="color:#ce5c00;font-weight:bold">:</span> <span style="color:#4e9a06">"urn:event:from:my-api/resource/123"</span><span style="color:#000;font-weight:bold">,</span>
- <span style="color:#000">type</span><span style="color:#ce5c00;font-weight:bold">:</span> <span style="color:#4e9a06">"your.event.source.type"</span><span style="color:#000;font-weight:bold">,</span>
- <span style="color:#000">id</span><span style="color:#ce5c00;font-weight:bold">:</span> <span style="color:#4e9a06">"your-event-id"</span><span style="color:#000;font-weight:bold">,</span>
- <span style="color:#000">dataContentType</span><span style="color:#ce5c00;font-weight:bold">:</span> <span style="color:#4e9a06">"application/json"</span><span style="color:#000;font-weight:bold">,</span>
- <span style="color:#000">data</span><span style="color:#ce5c00;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span><span style="color:#4e9a06">"hello"</span><span style="color:#ce5c00;font-weight:bold">:</span> <span style="color:#4e9a06">"World "</span> <span style="color:#ce5c00;font-weight:bold">+</span> <span style="color:#000">eventIndex</span><span style="color:#000;font-weight:bold">},</span>
- <span style="color:#000;font-weight:bold">});</span>
-
- <span style="color:#8f5902;font-style:italic">// Emit the event
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000">emitter</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">send</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">myevent</span><span style="color:#000;font-weight:bold">)</span>
- <span style="color:#000;font-weight:bold">.</span><span style="color:#000">then</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">response</span> <span style="color:#000;font-weight:bold">=></span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#8f5902;font-style:italic">// Treat the response
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000">console</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">log</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"Event posted successfully"</span><span style="color:#000;font-weight:bold">);</span>
- <span style="color:#000">console</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">log</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">response</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">data</span><span style="color:#000;font-weight:bold">);</span>
- <span style="color:#000;font-weight:bold">})</span>
- <span style="color:#000;font-weight:bold">.</span><span style="color:#204a87;font-weight:bold">catch</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">err</span> <span style="color:#000;font-weight:bold">=></span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#8f5902;font-style:italic">// Deal with errors
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000">console</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">log</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"Error during event post"</span><span style="color:#000;font-weight:bold">);</span>
- <span style="color:#000">console</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">error</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">err</span><span style="color:#000;font-weight:bold">);</span>
- <span style="color:#000;font-weight:bold">});</span>
-<span style="color:#000;font-weight:bold">},</span> <span style="color:#0000cf;font-weight:bold">1000</span><span style="color:#000;font-weight:bold">);</span>
-</code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-dockerfile" data-lang="dockerfile"><span style="color:#8f5902;font-style:italic"># File - Dockerfile</span><span style="color:#a40000">
-</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span><span style="color:#204a87;font-weight:bold">FROM</span><span style="color:#4e9a06"> node:10</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span><span style="color:#204a87;font-weight:bold">WORKDIR</span><span style="color:#4e9a06"> /usr/src/app</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span><span style="color:#204a87;font-weight:bold">COPY</span> package*.json ./<span style="color:#a40000">
-</span><span style="color:#a40000"></span><span style="color:#204a87;font-weight:bold">RUN</span> npm install<span style="color:#a40000">
-</span><span style="color:#a40000"></span><span style="color:#204a87;font-weight:bold">COPY</span> . .<span style="color:#a40000">
-</span><span style="color:#a40000"></span><span style="color:#204a87;font-weight:bold">EXPOSE</span><span style="color:#4e9a06"> 8080</span><span style="color:#a40000">
-</span><span style="color:#a40000"></span><span style="color:#204a87;font-weight:bold">CMD</span> <span style="color:#000;font-weight:bold">[</span> <span style="color:#4e9a06">"node"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#4e9a06">"index.js"</span> <span style="color:#000;font-weight:bold">]</span><span style="color:#a40000">
-</span><span style="color:#a40000">
-</span></code></pre></div><p>The example code uses <em>Binary</em> mode for CloudEvents. To employ structured code, change <code>let binding = new v1.BinaryHTTPEmitter(config);</code> to <code>let binding = new v1.StructuredHTTPEmitter(config);</code>.</p>
-<p>Binary mode is used in most cases because:</p>
-<ul>
-<li>It is faster in terms of serialization and deserialization.</li>
-<li>It works better with CloudEvent-aware proxies, such as Knative Channels, and can simply check the header instead of parsing the payload.</li>
-</ul>
-<h3 id="procedure">Procedure</h3>
-<ol>
-<li>
-<p>Build and push the image:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">docker build . -t path/to/image/registry/node-knative-heartbeat-source:v1
-docker push path/to/image/registry/node-knative-heartbeat-source:v1
-</code></pre></div></li>
-<li>
-<p>Create the event display service which logs any CloudEvents posted to it:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">docker.io/aliok/event_display-864884f202126ec3150c5fcef437d90c@sha256:93cb4dcda8fee80a1f68662ae6bf20301471b046ede628f3c3f94f39752fbe08</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>
-<p>Create the ContainerSource object:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sources.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ContainerSource</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">test-heartbeats</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">path/to/image/registry/node-knative-heartbeat-source:v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">heartbeats</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>
-<p>Check the logs of the event display service. You will see a new message is pushed every second:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">$ kubectl logs -l serving.knative.dev/service<span style="color:#ce5c00;font-weight:bold">=</span>event-display -c user-container
-
-☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: your.event.source.type
- source: urn:event:from:your-api/resource/123
- id: your-event-id
- datacontenttype: application/json
-Data,
- <span style="color:#ce5c00;font-weight:bold">{</span>
- <span style="color:#4e9a06">"hello"</span>: <span style="color:#4e9a06">"World 1"</span>
- <span style="color:#ce5c00;font-weight:bold">}</span>
-</code></pre></div></li>
-<li>
-<p>Optional: If you are interested in seeing what is injected into the event source as a <code>K_SINK</code>, you can check the logs:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">$ kubectl logs test-heartbeats-deployment-7575c888c7-85w5t
-
-Sink URL is http://event-display.default.svc.cluster.local
-Emitting event <span style="color:#8f5902;font-style:italic">#1</span>
-Emitting event <span style="color:#8f5902;font-style:italic">#2</span>
-Event posted successfully
-Event posted successfully
-</code></pre></div></li>
-</ol>
-<h2 id="using-sinkbinding">Using SinkBinding</h2>
-<p>SinkBinding does not create any containers. It injects the sink information to an already existing Kubernetes resources. This is a flexible approach as you can use any Kubernetes PodSpecable object as an event source, such as Deployment, Job, or Knative services.</p>
-<h3 id="procedure-1">Procedure</h3>
-<ol>
-<li>
-<p>Create an event display service:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">docker.io/aliok/event_display-864884f202126ec3150c5fcef437d90c@sha256:93cb4dcda8fee80a1f68662ae6bf20301471b046ede628f3c3f94f39752fbe08</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>
-<p>Create a Kubernetes deployment that runs the event source:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">node-heartbeats-deployment</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">node-heartbeats</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">replicas</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">2</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">selector</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">matchLabels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">node-heartbeats</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">node-heartbeats</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">node-heartbeats</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">path/to/image/registry/node-knative-heartbeat-source:v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ports</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">containerPort</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#0000cf;font-weight:bold">8080</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>
-<p>Because the SinkBinding has not yet been created, you will see an error message, because the <code>K_SINK</code> environment variable is not yet injected:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">$ kubectl logs node-heartbeats-deployment-9ffbb644b-llkzk
-
-Sink URL is undefined
-Emitting event <span style="color:#8f5902;font-style:italic">#1</span>
-Error during event post
-TypeError <span style="color:#ce5c00;font-weight:bold">[</span>ERR_INVALID_ARG_TYPE<span style="color:#ce5c00;font-weight:bold">]</span>: The <span style="color:#4e9a06">"url"</span> argument must be of <span style="color:#204a87">type</span> string. Received <span style="color:#204a87">type</span> undefined
-</code></pre></div></li>
-<li>
-<p>Create the SinkBinding object:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sources.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">SinkBinding</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">bind-node-heartbeat</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">subject</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">apps/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Deployment</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">selector</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">matchLabels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">node-heartbeats</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><p>You will see the pods are recreated and this time the <code>K_SINK</code> environment variable is injected.</p>
-<p>Also note that since the <code>replicas</code> is set to 2, there will be 2 pods that are posting events to the sink.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">$ kubectl logs event-display-dpplv-deployment-67c9949cf9-bvjvk -c user-container
-
-☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: your.event.source.type
- source: urn:event:from:your-api/resource/123
- id: your-event-id
- datacontenttype: application/json
-Data,
- <span style="color:#ce5c00;font-weight:bold">{</span>
- <span style="color:#4e9a06">"hello"</span>: <span style="color:#4e9a06">"World 1"</span>
- <span style="color:#ce5c00;font-weight:bold">}</span>
-
-☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: your.event.source.type
- source: urn:event:from:your-api/resource/123
- id: your-event-id
- datacontenttype: application/json
-Data,
- <span style="color:#ce5c00;font-weight:bold">{</span>
- <span style="color:#4e9a06">"hello"</span>: <span style="color:#4e9a06">"World 1"</span>
- <span style="color:#ce5c00;font-weight:bold">}</span>
-</code></pre></div></li>
-</ol>
-
-
-
-
-
- V0.22-Docs: Creating an event source by using the sample event source
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/
-
-
-
- <p>This guide explains how to create your own event source for Knative
-Eventing by using a <a href="https://github.com/knative-sandbox/sample-source">sample repository</a>, and explains the key concepts behind each required component. Documentation for the default <a href="../../sources/">Knative event sources</a> can be used as an additional reference.</p>
-<p>After completing the provided tutorial, you will have created a basic event source controller and a receive adapter. Events can be viewed by using the <code>event_display</code> Knative service.</p>
-<!--TODO: Provide links to docs about what the event source controller and receiver adapter are-->
-<!-- Is Go required? Is this for all Knative development or just event source creation?-->
-<h2 id="prerequisites">Prerequisites</h2>
-<ul>
-<li>You are familiar with Kubernetes and Go development.</li>
-<li>You have installed Git.</li>
-<li>You have installed Go.</li>
-<li>Clone the <a href="https://github.com/knative-sandbox/sample-source">sample source</a>. <!--optional?--></li>
-</ul>
-<!-- add links, versions if required-->
-<!---TODO: decide...Maybe don't list these if they're optional, unless they're called out in a procedure-->
-<p>Optional:</p>
-<ul>
-<li>Install the <a href="https://github.com/google/ko/">ko</a> CLI tool.</li>
-<li>Install the <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/">kubectl</a> CLI tool.</li>
-<li>Set up <a href="https://github.com/kubernetes/minikube">minikube</a>.</li>
-</ul>
-<h2 id="steps">Steps</h2>
-<ol>
-<li><a href="./01-theory">Separation of Concerns</a></li>
-<li><a href="./02-lifecycle-and-types">API Definition</a></li>
-<li><a href="./03-controller">Controller</a></li>
-<li><a href="./04-reconciler">Reconciler</a></li>
-<li><a href="./05-receive-adapter">Receive Adapter</a></li>
-<li><a href="./06-yaml">Example YAML</a></li>
-<li><a href="./07-knative-sandbox">Moving the event source to the <code>knative-sandbox</code> organization</a></li>
-</ol>
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source-easy-way/Dockerfile b/archived/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source-easy-way/Dockerfile
deleted file mode 100644
index 677ef1f33..000000000
--- a/archived/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source-easy-way/Dockerfile
+++ /dev/null
@@ -1,18 +0,0 @@
-FROM node:10
-
-# Create app directory
-WORKDIR /usr/src/app
-
-# Install app dependencies
-# A wildcard is used to ensure both package.json AND package-lock.json
-COPY package*.json ./
-
-RUN npm install
-# If you are building your code for production
-# RUN npm ci --only=production
-
-# Bundle app source
-COPY . .
-
-EXPOSE 8080
-CMD [ "node", "index.js" ]
diff --git a/archived/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source-easy-way/index.html b/archived/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source-easy-way/index.html
deleted file mode 100644
index 180f3d32e..000000000
--- a/archived/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source-easy-way/index.html
+++ /dev/null
@@ -1,2449 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Writing an event source using Javascript | Knative
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Writing an event source using Javascript | Knative
-
-
-
-
-
-
-
-
-
Black lives matter.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
This tutorial provides instructions to build an event source in Javascript and implement it with a ContainerSource or SinkBinding.
-
-
Using a ContainerSource is a simple way to turn any dispatcher container into a Knative event source.
-
Using SinkBinding provides a framework for injecting environment variables into any Kubernetes resource that has a spec.template and is PodSpecable.
-
-
ContainerSource and SinkBinding both work by injecting environment variables to an application. Injected environment variables at minimum contain the URL of a sink that will receive events.
The example code uses Binary mode for CloudEvents. To employ structured code, change let binding = new v1.BinaryHTTPEmitter(config); to let binding = new v1.StructuredHTTPEmitter(config);.
-
Binary mode is used in most cases because:
-
-
It is faster in terms of serialization and deserialization.
-
It works better with CloudEvent-aware proxies, such as Knative Channels, and can simply check the header instead of parsing the payload.
SinkBinding does not create any containers. It injects the sink information to an already existing Kubernetes resources. This is a flexible approach as you can use any Kubernetes PodSpecable object as an event source, such as Deployment, Job, or Knative services.
Because the SinkBinding has not yet been created, you will see an error message, because the K_SINK environment variable is not yet injected:
-
$ kubectl logs node-heartbeats-deployment-9ffbb644b-llkzk
-
-Sink URL is undefined
-Emitting event #1
-Error during event post
-TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type undefined
-
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Contributor: implement a new source with minimal k8s overhead (don’t have to learn controller/k8s internals)
-
Operator: easily install Sources and verify that they are “safe”
-
Developer: easily discover what Sources they can pull from on this cluster
-
Developer: easily configure a Source based on existing knowledge of other Sources.
-
-
Separation of concerns
-
Contributor:
-
-
Receive Adapter (RA) - process that receives incoming events.
-
Implement CloudEvent binding interfaces, cloudevent’s go sdk provides libraries for standard access to configure interfaces as needed.
-
Passing configuration from the Source CRD YAML, that the controller needs to configure the Receive Adapter
-
-
Source library (provided by Knative):
-
-
Controller runtime (this is what we share via injection) incorporates protocol specific config into “generic controller” CRD.
-
Identifying specific event characteristics (i.e. value of interest, relevant metadata, etc) to pass along to the serverless system
-
Propagating events internally to the system (i.e. cloudevents)
-
-
Theory
-
Quick Introduction to Knative Eventing Sources
-A Knative Source is Kubernetes Custom Resource that generates or imports an event and pushes that event to another endpoint on the cluster via a CloudEvents.
-
The specification
-for Knative Eventing Sources contains a number of requirements that
-together define a well-behaved Knative Source.
-
To achieve this, there are several separations of concerns that we have to keep in mind:
-
-
A controller to run our Event Source and reconcile the underlying Receive Adapter deployments
-
A “receive adapter” which generates or imports the actual events
-
A series of identifying characteristics for our event
-
Transporting a valid event to the serverless system for further processing
-
-
There are also two different classes of developer to consider:
-
-
A “contributor” knows about the foreign protocol but is not a Knative expert.
-
Knative Eventing expert knows how Knative Eventing components are implemented, configured and deployed, but is not an expert in all the foreign protocols that sources may implement.
-
-
These two roles will often not be the same person. We want to confine the job of the “contributor” to implementing the Receive Adapter, and specifying what configuration their adapter needs to connect, subscribe, or do whatever it does.
-
The Knative Eventing developer exposes the protocol configuration as part of the Source CRD, and the controller passes any required configuration (which may include resolved data like URLs) to the Receive Adapter.
-
API Resources required:
-
-
KubeClientSet.Appsv1.Deployment (Inherited via the Eventing base reconciler)
-Used to deploy the Receive Adapter for “importing” events
-
EventingClientSet.EventingV1Alpha1 (Inherited via the Eventing base reconciler)
-Used to interact with Events within the Knative system
-
SourceClientSet.SourcesV1Alpha1
-Used for source — in this case, samplesource — specific config and translated to the underlying deployment (via the inherited KubeClientSet)
-
-
To ease writing a new event source, the eventing subsystem has offloaded several core functionalities (via injection) to the eventing-sources-controller.
Specifically, the clientset, cache, informers, and listers can all be generated and shared. Thus, they can be generated, imported, and assigned to the underlying reconciler when creating a new controller source implementation:
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Define the types required in the resource’s schema in
-pkg/apis/samples/v1alpha1/samplesource_types.go
-This includes the fields that will be required in the resource yaml as
-well as what will be referenced in the controller using the source’s
-clientset and API
-
-
// +genclient
-// +genreconciler
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:openapi-gen=true
-typeSampleSourcestruct{
- metav1.TypeMeta`json:",inline"`
- // +optional
-metav1.ObjectMeta`json:"metadata,omitempty"`
-
- // Spec holds the desired state of the SampleSource (from the client).
-SpecSampleSourceSpec`json:"spec"`
-
- // Status communicates the observed state of the SampleSource (from the controller).
-// +optional
-StatusSampleSourceStatus`json:"status,omitempty"`
-}
-
-// SampleSourceSpec holds the desired state of the SampleSource (from the client).
-typeSampleSourceSpecstruct{
- // inherits duck/v1 SourceSpec, which currently provides:
-// * Sink - a reference to an object that will resolve to a domain name or
-// a URI directly to use as the sink.
-// * CloudEventOverrides - defines overrides to control the output format
-// and modifications of the event sent to the sink.
-duckv1.SourceSpec`json:",inline"`
-
- // ServiceAccountName holds the name of the Kubernetes service account
-// as which the underlying K8s resources should be run. If unspecified
-// this will default to the "default" service account for the namespace
-// in which the SampleSource exists.
-// +optional
-ServiceAccountNamestring`json:"serviceAccountName,omitempty"`
-
- // Interval is the time interval between events.
-//
-// The string format is a sequence of decimal numbers, each with optional
-// fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time
-// units are "ns", "us" (or "µs"), "ms", "s", "m", "h". If unspecified
-// this will default to "10s".
-Intervalstring`json:"interval"`
-}
-
-// SampleSourceStatus communicates the observed state of the SampleSource (from the controller).
-typeSampleSourceStatusstruct{
- duckv1.Status`json:",inline"`
-
- // SinkURI is the current active sink URI that has been configured
-// for the SampleSource.
-// +optional
-SinkURI*apis.URL`json:"sinkUri,omitempty"`
-}
-
Define the lifecycle that will be reflected in the status and SinkURI fields
-
const(
- // SampleConditionReady has status True when the SampleSource is ready to send events.
-SampleConditionReady=apis.ConditionReady
- // ...
-)
-
-
Define the functions that will be called from the Reconciler functions to set the lifecycle conditions. This is typically done in
-pkg/apis/samples/VERSION/samplesource_lifecycle.go
-
// InitializeConditions sets relevant unset conditions to Unknown state.
-func(s*SampleSourceStatus)InitializeConditions(){
- SampleCondSet.Manage(s).InitializeConditions()
-}
-
-...
-
-// MarkSink sets the condition that the source has a sink configured.
-func(s*SampleSourceStatus)MarkSink(uri*apis.URL){
- s.SinkURI=uri
- iflen(uri.String())>0{
- SampleCondSet.Manage(s).MarkTrue(SampleConditionSinkProvided)
- }else{
- SampleCondSet.Manage(s).MarkUnknown(SampleConditionSinkProvided,"SinkEmpty","Sink has resolved to empty.%s","")
- }
-}
-
-// MarkNoSink sets the condition that the source does not have a sink configured.
-func(s*SampleSourceStatus)MarkNoSink(reason,messageFormatstring,messageA...interface{}){
- SampleCondSet.Manage(s).MarkFalse(SampleConditionSinkProvided,reason,messageFormat,messageA...)
-}
-
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Pass the new controller implementation to the shared main
-
import(
- // The set of controllers this controller process runs.
-"knative.dev/sample-source/pkg/reconciler/sample"
-
- // This defines the shared main for injected controllers.
-"knative.dev/pkg/injection/sharedmain"
-)
-
-funcmain(){
- sharedmain.Main("sample-source-controller",sample.NewController)
-}
-
Define the NewController implementation, it will be passed a configmap.Watcher, as well as a context which the injected listers will use for the reconciler struct arguments
-
funcNewController(
- ctxcontext.Context,
- cmwconfigmap.Watcher,
-)*controller.Impl{
- // ...
-deploymentInformer:=deploymentinformer.Get(ctx)
- sinkBindingInformer:=sinkbindinginformer.Get(ctx)
- sampleSourceInformer:=samplesourceinformer.Get(ctx)
-
- r:=&Reconciler{
- dr:&reconciler.DeploymentReconciler{KubeClientSet:kubeclient.Get(ctx)},
- sbr:&reconciler.SinkBindingReconciler{EventingClientSet:eventingclient.Get(ctx)},
- // Config accessor takes care of tracing/config/logging config propagation to the receive adapter
-configAccessor:reconcilersource.WatchConfigurations(ctx,"sample-source",cmw),
-}
-
The base reconciler is imported from the knative.dev/pkg dependency:
Controller for the SampleSource uses Deployment and SinkBinding resources to deploy and also bind the event source and the receive adapter. Also ensure the informers are set up correctly for these secondary resources
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
NB The exact arguments may change based on functional requirements
-Create the underlying deployment from the arguments provided, matching pod templates, labels, owner references, etc as needed to fill out the deployment
-Example: pkg/reconciler/sample/resources/receive_adapter.go
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Similar to the controller, we’ll need an injection based main.go similar to the controller under cmd/receiver_adapter/main.go
-
// This Adapter generates events at a regular interval.
-packagemain
-
-import(
- "knative.dev/eventing/pkg/adapter"
- myadapter"knative.dev/sample-source/pkg/adapter"
-)
-
-funcmain(){
- adapter.Main("sample-source",myadapter.NewEnv,myadapter.NewAdapter)
-}
-
-
Defining NewAdapter implementation and Start function
-
The adapter’s pkg implementation consists of two main functions;
-
-
A NewAdapter(ctx context.Context, aEnv adapter.EnvConfigAccessor, ceClient cloudevents.Client) adapter.Adapter {} call, which creates the
-new adapter with passed variables via the EnvConfigAccessor. The created adapter will be passed the cloudevents client (which is where the events are forwarded to). This is sometimes referred
-to as a sink, or ceClient in the Knative ecosystem. The return value is a reference to the adapter as defined by the adapter’s local struct.
-
-
In our sample-source’s case;
-
// Adapter generates events at a regular interval.
-typeAdapterstruct{
- logger*zap.Logger
- intervaltime.Duration
- nextIDint
- clientcloudevents.Client
-}
-
-
Start function implemented as an interface to the adapter struct.
stopCh is the signal to stop the Adapter. Otherwise the role of the function is to process the next
-event. In the case of the sample-source, it creates an event to forward to the specified cloudevent sink/client
-every X interval, as specified by the loaded EnvConfigAccessor (loaded via the resource yaml).
-
func(a*Adapter)Start(stopCh<-chanstruct{})error{
- a.logger.Infow("Starting heartbeat",zap.String("interval",a.interval.String()))
- for{
- select{
- case<-time.After(a.interval):
- event:=a.newEvent()
- a.logger.Infow("Sending new event",zap.String("event",event.String()))
- ifresult:=a.client.Send(context.Background(),event);!cloudevents.IsACK(result){
- a.logger.Infow("failed to send event",zap.String("event",event.String()),zap.Error(result))
- // We got an error but it could be transient, try again next interval.
-continue
- }
- case<-stopCh:
- a.logger.Info("Shutting down...")
- returnnil
- }
- }
-}
-
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Once the sample-source-controller-manager is running in the knative-samples namespace, you can
-apply the example.yaml to connect our sample-source every 10s directly to a ksvc.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Creating an event source by using the sample event source
-
-
This guide explains how to create your own event source for Knative
-Eventing by using a sample repository, and explains the key concepts behind each required component. Documentation for the default Knative event sources can be used as an additional reference.
-
After completing the provided tutorial, you will have created a basic event source controller and a receive adapter. Events can be viewed by using the event_display Knative service.
-
-
-
Prerequisites
-
-
You are familiar with Kubernetes and Go development.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/index.xml b/archived/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/index.xml
deleted file mode 100644
index ebc623e72..000000000
--- a/archived/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/index.xml
+++ /dev/null
@@ -1,556 +0,0 @@
-
-
- Knative – Creating an event source by using the sample event source
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/
- Recent content in Creating an event source by using the sample event source on Knative
- Hugo -- gohugo.io
-
-
-
-
-
-
-
-
-
-
- V0.22-Docs: Design and Theory Behind an Event Source
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/01-theory/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/01-theory/
-
-
-
- <h1 id="topics">Topics</h1>
-<p>What are the personas and critical paths?</p>
-<ul>
-<li>Contributor: implement a new source with minimal k8s overhead (don’t have to learn controller/k8s internals)</li>
-<li>Operator: easily install Sources and verify that they are “safe”</li>
-<li>Developer: easily discover what Sources they can pull from on this cluster</li>
-<li>Developer: easily configure a Source based on existing knowledge of other Sources.</li>
-</ul>
-<h2 id="separation-of-concerns">Separation of concerns</h2>
-<h3 id="contributor">Contributor:</h3>
-<ul>
-<li>Receive Adapter (RA) - process that receives incoming events.</li>
-<li>Implement CloudEvent binding interfaces, <a href="https://github.com/cloudevents/sdk-go">cloudevent’s go sdk</a> provides libraries for standard access to configure interfaces as needed.</li>
-<li>Passing configuration from the Source <code>CRD</code> YAML, that the controller needs to configure the <code>Receive Adapter</code></li>
-</ul>
-<h3 id="source-library-provided-by-knative">Source library (provided by Knative):</h3>
-<ul>
-<li>Controller runtime (this is what we share via injection) incorporates protocol specific config into “generic controller” CRD.</li>
-<li>Identifying specific event characteristics (i.e. value of interest, relevant metadata, etc) to pass along to the serverless system</li>
-<li>Propagating events internally to the system (i.e. cloudevents)</li>
-</ul>
-<h1 id="theory">Theory</h1>
-<p>Quick Introduction to Knative Eventing Sources
-A Knative Source is Kubernetes Custom Resource that generates or imports an event and pushes that event to another endpoint on the cluster via a <a href="https://github.com/cloudevents/spec/blob/v1.0/primer.md">CloudEvents</a>.</p>
-<p><a href="https://github.com/knative/eventing/blob/main/docs/spec/sources.md">The specification</a>
-for Knative Eventing Sources contains a number of requirements that
-together define a well-behaved Knative Source.</p>
-<p>To achieve this, there are several separations of concerns that we have to keep in mind:</p>
-<ol>
-<li>A controller to run our Event Source and reconcile the underlying <code>Receive Adapter</code> deployments</li>
-<li>A “receive adapter” which generates or imports the actual events</li>
-<li>A series of identifying characteristics for our event</li>
-<li>Transporting a valid event to the serverless system for further processing</li>
-</ol>
-<p>There are also two different classes of developer to consider:</p>
-<ol>
-<li>A “contributor” knows about the foreign protocol but is not a Knative expert.</li>
-<li>Knative Eventing expert knows how Knative Eventing components are implemented, configured and deployed, but is not an expert in all the foreign protocols that sources may implement.</li>
-</ol>
-<p>These two roles will often not be the same person. We want to confine the job of the “contributor” to implementing the <code>Receive Adapter</code>, and specifying what configuration their adapter needs to connect, subscribe, or do whatever it does.</p>
-<p>The Knative Eventing developer exposes the protocol configuration as part of the Source <code>CRD</code>, and the controller passes any required configuration (which may include resolved data like URLs) to the <code>Receive Adapter</code>.</p>
-<p>API Resources required:</p>
-<ul>
-<li><code>KubeClientSet.Appsv1.Deployment</code> (Inherited via the Eventing base reconciler)
-Used to deploy the <code>Receive Adapter</code> for “importing” events</li>
-<li><code>EventingClientSet.EventingV1Alpha1</code> (Inherited via the Eventing base reconciler)
-Used to interact with Events within the Knative system</li>
-<li><code>SourceClientSet.SourcesV1Alpha1</code>
-Used for source — in this case, <code>samplesource</code> — specific config and translated to the underlying deployment (via the inherited KubeClientSet)</li>
-</ul>
-<p>To ease writing a new event source, the eventing subsystem has offloaded several core functionalities (via injection) to the <code>eventing-sources-controller</code>.</p>
-<p><img src="https://raw.githubusercontent.com/knative/docs/main/docs/eventing/samples/writing-event-source/simplified-controller.png" alt="Simplified Controller"></p>
-<p>Fig 1. - Via shared <a href="https://docs.google.com/presentation/d/e/2PACX-1vQbpISBvY7jqzu2wy2t1_0R4LSBEBS0JrUS7M7V3BMVqy2K1Zk_0Xhy7WPPaeANLHE0yqtz1DuWlSAl/pub?resourcekey=0-mf6dN2vu9SS3bo2TUeCk9Q&slide=id.g596dcbbefb_0_40">Knative Dependency Injection</a></p>
-<p>Specifically, the <code>clientset</code>, <code>cache</code>, <code>informers</code>, and <code>listers</code> can all be generated and shared. Thus, they can be generated, imported, and assigned to the underlying reconciler when creating a new controller source implementation:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-golang" data-lang="golang"><span style="color:#204a87;font-weight:bold">import</span> <span style="color:#000;font-weight:bold">(</span>
- <span style="color:#8f5902;font-style:italic">// ...
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000">sampleSourceClient</span> <span style="color:#4e9a06">"knative.dev/sample-source/pkg/client/injection/client"</span>
- <span style="color:#000">samplesourceinformer</span> <span style="color:#4e9a06">"knative.dev/sample-source/pkg/client/injection/informers/samples/v1alpha1/samplesource"</span>
-<span style="color:#000;font-weight:bold">)</span>
-<span style="color:#8f5902;font-style:italic">// ...
-</span><span style="color:#8f5902;font-style:italic"></span><span style="color:#204a87;font-weight:bold">func</span> <span style="color:#000">NewController</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">ctx</span> <span style="color:#000">context</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Context</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">cmw</span> <span style="color:#000">configmap</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Watcher</span><span style="color:#000;font-weight:bold">)</span> <span style="color:#ce5c00;font-weight:bold">*</span><span style="color:#000">controller</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Impl</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">sampleSourceInformer</span> <span style="color:#ce5c00;font-weight:bold">:=</span> <span style="color:#000">samplesourceinformer</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Get</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">ctx</span><span style="color:#000;font-weight:bold">)</span>
-
- <span style="color:#000">r</span> <span style="color:#ce5c00;font-weight:bold">:=</span> <span style="color:#ce5c00;font-weight:bold">&</span><span style="color:#000">Reconciler</span><span style="color:#000;font-weight:bold">{</span>
- <span style="color:#8f5902;font-style:italic">// ...
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000">samplesourceClientSet</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000">sampleSourceClient</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Get</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">ctx</span><span style="color:#000;font-weight:bold">),</span>
- <span style="color:#000">samplesourceLister</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000">sampleSourceInformer</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Lister</span><span style="color:#000;font-weight:bold">(),</span>
- <span style="color:#8f5902;font-style:italic">// ...
-</span><span style="color:#8f5902;font-style:italic"></span><span style="color:#000;font-weight:bold">}</span>
-</code></pre></div><p>Sample source’s <a href="https://github.com/knative-sandbox/sample-source/blob/main/hack/update-codegen.sh"><code>update-codegen.sh</code></a> have the configuration
-to have the required things above generated and injected:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash"><span style="color:#8f5902;font-style:italic"># Generation</span>
-<span style="color:#4e9a06">${</span><span style="color:#000">CODEGEN_PKG</span><span style="color:#4e9a06">}</span>/generate-groups.sh <span style="color:#4e9a06">"deepcopy,client,informer,lister"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> knative.dev/sample-source/pkg/client knative.dev/sample-source/pkg/apis <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> <span style="color:#4e9a06">"samples:v1alpha1"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --go-header-file <span style="color:#4e9a06">${</span><span style="color:#000">REPO_ROOT</span><span style="color:#4e9a06">}</span>/hack/boilerplate/boilerplate.go.txt
-
-<span style="color:#8f5902;font-style:italic"># Injection</span>
-<span style="color:#4e9a06">${</span><span style="color:#000">KNATIVE_CODEGEN_PKG</span><span style="color:#4e9a06">}</span>/hack/generate-knative.sh <span style="color:#4e9a06">"injection"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> knative.dev/sample-source/pkg/client knative.dev/sample-source/pkg/apis <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> <span style="color:#4e9a06">"samples:v1alpha1"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --go-header-file <span style="color:#4e9a06">${</span><span style="color:#000">REPO_ROOT</span><span style="color:#4e9a06">}</span>/hack/boilerplate/boilerplate.go.txt
-</code></pre></div><p>File Layout & Hierarchy:</p>
-<ul>
-<li><code>cmd/controller/main.go</code> - Pass source’s NewController implementation to the shared main</li>
-<li><code>cmd/receive_adapter/main.go</code> - Translate resource variables to underlying adapter struct (to eventually be passed into the serverless system)</li>
-<li><code>pkg/reconciler/sample/controller.go</code> - NewController implementation to pass to sharedmain</li>
-<li><code>pkg/reconciler/sample/samplesource.go</code> - reconciliation functions for the receive adapter</li>
-<li><code>pkg/apis/samples/VERSION/samplesource_types.go</code> - schema for the underlying api types (variables to be defined in the resource yaml)</li>
-<li><code>pkg/apis/samples/VERSION/samplesource_lifecycle.go</code> - status updates for the source’s reconciliation details
-<ul>
-<li>Source ready</li>
-<li>Sink provided</li>
-<li>Deployed</li>
-<li>Eventtype Provided</li>
-<li>K8s Resources Correct</li>
-</ul>
-</li>
-<li><code>pkg/adapter/adapter.go</code> - receive_adapter functions supporting translation of events to CloudEvents</li>
-</ul>
-
-
-
-
-
- V0.22-Docs: Sample Source Lifecycle and Types
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/02-lifecycle-and-types/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/02-lifecycle-and-types/
-
-
-
- <h2 id="api-definition">API Definition</h2>
-<ol>
-<li>Define the types required in the resource’s schema in
-<code>pkg/apis/samples/v1alpha1/samplesource_types.go</code>
-This includes the fields that will be required in the resource yaml as
-well as what will be referenced in the controller using the source’s
-clientset and API</li>
-</ol>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#8f5902;font-style:italic">// +genclient
-</span><span style="color:#8f5902;font-style:italic">// +genreconciler
-</span><span style="color:#8f5902;font-style:italic">// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-</span><span style="color:#8f5902;font-style:italic">// +k8s:openapi-gen=true
-</span><span style="color:#8f5902;font-style:italic"></span><span style="color:#204a87;font-weight:bold">type</span> <span style="color:#000">SampleSource</span> <span style="color:#204a87;font-weight:bold">struct</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">metav1</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">TypeMeta</span> <span style="color:#4e9a06">`json:",inline"`</span>
- <span style="color:#8f5902;font-style:italic">// +optional
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000">metav1</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">ObjectMeta</span> <span style="color:#4e9a06">`json:"metadata,omitempty"`</span>
-
- <span style="color:#8f5902;font-style:italic">// Spec holds the desired state of the SampleSource (from the client).
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000">Spec</span> <span style="color:#000">SampleSourceSpec</span> <span style="color:#4e9a06">`json:"spec"`</span>
-
- <span style="color:#8f5902;font-style:italic">// Status communicates the observed state of the SampleSource (from the controller).
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#8f5902;font-style:italic">// +optional
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000">Status</span> <span style="color:#000">SampleSourceStatus</span> <span style="color:#4e9a06">`json:"status,omitempty"`</span>
-<span style="color:#000;font-weight:bold">}</span>
-
-<span style="color:#8f5902;font-style:italic">// SampleSourceSpec holds the desired state of the SampleSource (from the client).
-</span><span style="color:#8f5902;font-style:italic"></span><span style="color:#204a87;font-weight:bold">type</span> <span style="color:#000">SampleSourceSpec</span> <span style="color:#204a87;font-weight:bold">struct</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#8f5902;font-style:italic">// inherits duck/v1 SourceSpec, which currently provides:
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#8f5902;font-style:italic">// * Sink - a reference to an object that will resolve to a domain name or
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#8f5902;font-style:italic">// a URI directly to use as the sink.
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#8f5902;font-style:italic">// * CloudEventOverrides - defines overrides to control the output format
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#8f5902;font-style:italic">// and modifications of the event sent to the sink.
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000">duckv1</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">SourceSpec</span> <span style="color:#4e9a06">`json:",inline"`</span>
-
- <span style="color:#8f5902;font-style:italic">// ServiceAccountName holds the name of the Kubernetes service account
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#8f5902;font-style:italic">// as which the underlying K8s resources should be run. If unspecified
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#8f5902;font-style:italic">// this will default to the "default" service account for the namespace
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#8f5902;font-style:italic">// in which the SampleSource exists.
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#8f5902;font-style:italic">// +optional
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000">ServiceAccountName</span> <span style="color:#204a87;font-weight:bold">string</span> <span style="color:#4e9a06">`json:"serviceAccountName,omitempty"`</span>
-
- <span style="color:#8f5902;font-style:italic">// Interval is the time interval between events.
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#8f5902;font-style:italic">//
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#8f5902;font-style:italic">// The string format is a sequence of decimal numbers, each with optional
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#8f5902;font-style:italic">// fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#8f5902;font-style:italic">// units are "ns", "us" (or "µs"), "ms", "s", "m", "h". If unspecified
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#8f5902;font-style:italic">// this will default to "10s".
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000">Interval</span> <span style="color:#204a87;font-weight:bold">string</span> <span style="color:#4e9a06">`json:"interval"`</span>
-<span style="color:#000;font-weight:bold">}</span>
-
-<span style="color:#8f5902;font-style:italic">// SampleSourceStatus communicates the observed state of the SampleSource (from the controller).
-</span><span style="color:#8f5902;font-style:italic"></span><span style="color:#204a87;font-weight:bold">type</span> <span style="color:#000">SampleSourceStatus</span> <span style="color:#204a87;font-weight:bold">struct</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">duckv1</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Status</span> <span style="color:#4e9a06">`json:",inline"`</span>
-
- <span style="color:#8f5902;font-style:italic">// SinkURI is the current active sink URI that has been configured
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#8f5902;font-style:italic">// for the SampleSource.
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#8f5902;font-style:italic">// +optional
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000">SinkURI</span> <span style="color:#ce5c00;font-weight:bold">*</span><span style="color:#000">apis</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">URL</span> <span style="color:#4e9a06">`json:"sinkUri,omitempty"`</span>
-<span style="color:#000;font-weight:bold">}</span>
-</code></pre></div><p>Define the lifecycle that will be reflected in the status and SinkURI fields</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#204a87;font-weight:bold">const</span> <span style="color:#000;font-weight:bold">(</span>
- <span style="color:#8f5902;font-style:italic">// SampleConditionReady has status True when the SampleSource is ready to send events.
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000">SampleConditionReady</span> <span style="color:#000;font-weight:bold">=</span> <span style="color:#000">apis</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">ConditionReady</span>
- <span style="color:#8f5902;font-style:italic">// ...
-</span><span style="color:#8f5902;font-style:italic"></span><span style="color:#000;font-weight:bold">)</span>
-
-</code></pre></div><p>Define the functions that will be called from the Reconciler functions to set the lifecycle conditions. This is typically done in
-<code>pkg/apis/samples/VERSION/samplesource_lifecycle.go</code></p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#8f5902;font-style:italic">// InitializeConditions sets relevant unset conditions to Unknown state.
-</span><span style="color:#8f5902;font-style:italic"></span><span style="color:#204a87;font-weight:bold">func</span> <span style="color:#000;font-weight:bold">(</span><span style="color:#000">s</span> <span style="color:#ce5c00;font-weight:bold">*</span><span style="color:#000">SampleSourceStatus</span><span style="color:#000;font-weight:bold">)</span> <span style="color:#000">InitializeConditions</span><span style="color:#000;font-weight:bold">()</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">SampleCondSet</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Manage</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">s</span><span style="color:#000;font-weight:bold">).</span><span style="color:#000">InitializeConditions</span><span style="color:#000;font-weight:bold">()</span>
-<span style="color:#000;font-weight:bold">}</span>
-
-<span style="color:#ce5c00;font-weight:bold">...</span>
-
-<span style="color:#8f5902;font-style:italic">// MarkSink sets the condition that the source has a sink configured.
-</span><span style="color:#8f5902;font-style:italic"></span><span style="color:#204a87;font-weight:bold">func</span> <span style="color:#000;font-weight:bold">(</span><span style="color:#000">s</span> <span style="color:#ce5c00;font-weight:bold">*</span><span style="color:#000">SampleSourceStatus</span><span style="color:#000;font-weight:bold">)</span> <span style="color:#000">MarkSink</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">uri</span> <span style="color:#ce5c00;font-weight:bold">*</span><span style="color:#000">apis</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">URL</span><span style="color:#000;font-weight:bold">)</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">s</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">SinkURI</span> <span style="color:#000;font-weight:bold">=</span> <span style="color:#000">uri</span>
- <span style="color:#204a87;font-weight:bold">if</span> <span style="color:#204a87">len</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">uri</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">String</span><span style="color:#000;font-weight:bold">())</span> <span style="color:#000;font-weight:bold">></span> <span style="color:#0000cf;font-weight:bold">0</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">SampleCondSet</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Manage</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">s</span><span style="color:#000;font-weight:bold">).</span><span style="color:#000">MarkTrue</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">SampleConditionSinkProvided</span><span style="color:#000;font-weight:bold">)</span>
- <span style="color:#000;font-weight:bold">}</span> <span style="color:#204a87;font-weight:bold">else</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">SampleCondSet</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Manage</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">s</span><span style="color:#000;font-weight:bold">).</span><span style="color:#000">MarkUnknown</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">SampleConditionSinkProvided</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#4e9a06">"SinkEmpty"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#4e9a06">"Sink has resolved to empty.%s"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#4e9a06">""</span><span style="color:#000;font-weight:bold">)</span>
- <span style="color:#000;font-weight:bold">}</span>
-<span style="color:#000;font-weight:bold">}</span>
-
-<span style="color:#8f5902;font-style:italic">// MarkNoSink sets the condition that the source does not have a sink configured.
-</span><span style="color:#8f5902;font-style:italic"></span><span style="color:#204a87;font-weight:bold">func</span> <span style="color:#000;font-weight:bold">(</span><span style="color:#000">s</span> <span style="color:#ce5c00;font-weight:bold">*</span><span style="color:#000">SampleSourceStatus</span><span style="color:#000;font-weight:bold">)</span> <span style="color:#000">MarkNoSink</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">reason</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">messageFormat</span> <span style="color:#204a87;font-weight:bold">string</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">messageA</span> <span style="color:#ce5c00;font-weight:bold">...</span><span style="color:#204a87;font-weight:bold">interface</span><span style="color:#000;font-weight:bold">{})</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">SampleCondSet</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Manage</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">s</span><span style="color:#000;font-weight:bold">).</span><span style="color:#000">MarkFalse</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">SampleConditionSinkProvided</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">reason</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">messageFormat</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">messageA</span><span style="color:#ce5c00;font-weight:bold">...</span><span style="color:#000;font-weight:bold">)</span>
-<span style="color:#000;font-weight:bold">}</span>
-</code></pre></div>
-
-
-
-
- V0.22-Docs: Controller Implementation and Design
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/03-controller/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/03-controller/
-
-
-
- <h1 id="controller-implementation">Controller Implementation</h1>
-<h2 id="cmdcontroller">cmd/controller</h2>
-<p>Pass the new controller implementation to the shared main</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#204a87;font-weight:bold">import</span> <span style="color:#000;font-weight:bold">(</span>
- <span style="color:#8f5902;font-style:italic">// The set of controllers this controller process runs.
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#4e9a06">"knative.dev/sample-source/pkg/reconciler/sample"</span>
-
- <span style="color:#8f5902;font-style:italic">// This defines the shared main for injected controllers.
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#4e9a06">"knative.dev/pkg/injection/sharedmain"</span>
-<span style="color:#000;font-weight:bold">)</span>
-
-<span style="color:#204a87;font-weight:bold">func</span> <span style="color:#000">main</span><span style="color:#000;font-weight:bold">()</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">sharedmain</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Main</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"sample-source-controller"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">sample</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">NewController</span><span style="color:#000;font-weight:bold">)</span>
-<span style="color:#000;font-weight:bold">}</span>
-</code></pre></div><p>Define the NewController implementation, it will be passed a <code>configmap.Watcher</code>, as well as a context which the injected listers will use for the reconciler struct arguments</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#204a87;font-weight:bold">func</span> <span style="color:#000">NewController</span><span style="color:#000;font-weight:bold">(</span>
- <span style="color:#000">ctx</span> <span style="color:#000">context</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Context</span><span style="color:#000;font-weight:bold">,</span>
- <span style="color:#000">cmw</span> <span style="color:#000">configmap</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Watcher</span><span style="color:#000;font-weight:bold">,</span>
-<span style="color:#000;font-weight:bold">)</span> <span style="color:#ce5c00;font-weight:bold">*</span><span style="color:#000">controller</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Impl</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#8f5902;font-style:italic">// ...
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000">deploymentInformer</span> <span style="color:#ce5c00;font-weight:bold">:=</span> <span style="color:#000">deploymentinformer</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Get</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">ctx</span><span style="color:#000;font-weight:bold">)</span>
- <span style="color:#000">sinkBindingInformer</span> <span style="color:#ce5c00;font-weight:bold">:=</span> <span style="color:#000">sinkbindinginformer</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Get</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">ctx</span><span style="color:#000;font-weight:bold">)</span>
- <span style="color:#000">sampleSourceInformer</span> <span style="color:#ce5c00;font-weight:bold">:=</span> <span style="color:#000">samplesourceinformer</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Get</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">ctx</span><span style="color:#000;font-weight:bold">)</span>
-
- <span style="color:#000">r</span> <span style="color:#ce5c00;font-weight:bold">:=</span> <span style="color:#ce5c00;font-weight:bold">&</span><span style="color:#000">Reconciler</span><span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">dr</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#ce5c00;font-weight:bold">&</span><span style="color:#000">reconciler</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">DeploymentReconciler</span><span style="color:#000;font-weight:bold">{</span><span style="color:#000">KubeClientSet</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000">kubeclient</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Get</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">ctx</span><span style="color:#000;font-weight:bold">)},</span>
- <span style="color:#000">sbr</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#ce5c00;font-weight:bold">&</span><span style="color:#000">reconciler</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">SinkBindingReconciler</span><span style="color:#000;font-weight:bold">{</span><span style="color:#000">EventingClientSet</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000">eventingclient</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Get</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">ctx</span><span style="color:#000;font-weight:bold">)},</span>
- <span style="color:#8f5902;font-style:italic">// Config accessor takes care of tracing/config/logging config propagation to the receive adapter
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000">configAccessor</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000">reconcilersource</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">WatchConfigurations</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">ctx</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#4e9a06">"sample-source"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">cmw</span><span style="color:#000;font-weight:bold">),</span>
-<span style="color:#000;font-weight:bold">}</span>
-</code></pre></div><p>The base reconciler is imported from the knative.dev/pkg dependency:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#204a87;font-weight:bold">import</span> <span style="color:#000;font-weight:bold">(</span>
- <span style="color:#8f5902;font-style:italic">// ...
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000">reconcilersource</span> <span style="color:#4e9a06">"knative.dev/eventing/pkg/reconciler/source"</span>
- <span style="color:#8f5902;font-style:italic">// ...
-</span><span style="color:#8f5902;font-style:italic"></span><span style="color:#000;font-weight:bold">)</span>
-</code></pre></div><p>Ensure the correct informers have EventHandlers filtered to them</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"> <span style="color:#000">sampleSourceInformer</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Informer</span><span style="color:#000;font-weight:bold">().</span><span style="color:#000">AddEventHandler</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">controller</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">HandleAll</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">impl</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Enqueue</span><span style="color:#000;font-weight:bold">))</span>
-</code></pre></div><p>Controller for the <code>SampleSource</code> uses <code>Deployment</code> and <code>SinkBinding</code> resources to deploy and also bind the event source and the receive adapter. Also ensure the informers are set up correctly for these secondary resources</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"> <span style="color:#000">deploymentInformer</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Informer</span><span style="color:#000;font-weight:bold">().</span><span style="color:#000">AddEventHandler</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">cache</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">FilteringResourceEventHandler</span><span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">FilterFunc</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000">controller</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">FilterGroupKind</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">v1alpha1</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Kind</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"SampleSource"</span><span style="color:#000;font-weight:bold">)),</span>
- <span style="color:#000">Handler</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000">controller</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">HandleAll</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">impl</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">EnqueueControllerOf</span><span style="color:#000;font-weight:bold">),</span>
- <span style="color:#000;font-weight:bold">})</span>
-
- <span style="color:#000">sinkBindingInformer</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Informer</span><span style="color:#000;font-weight:bold">().</span><span style="color:#000">AddEventHandler</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">cache</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">FilteringResourceEventHandler</span><span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">FilterFunc</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000">controller</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">FilterGroupKind</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">v1alpha1</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Kind</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"SampleSource"</span><span style="color:#000;font-weight:bold">)),</span>
- <span style="color:#000">Handler</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000">controller</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">HandleAll</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">impl</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">EnqueueControllerOf</span><span style="color:#000;font-weight:bold">),</span>
- <span style="color:#000;font-weight:bold">})</span>
-</code></pre></div>
-
-
-
-
- V0.22-Docs: Reconciler Implementation and Design
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/04-reconciler/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/04-reconciler/
-
-
-
- <h2 id="reconciler-functionality">Reconciler Functionality</h2>
-<p>General steps the reconciliation process needs to cover:</p>
-<ol>
-<li>Update the <code>ObservedGeneration</code> and initialize the <code>Status</code> conditions (as defined in <code>samplesource_lifecycle.go</code> and <code>samplesource_types.go</code>)</li>
-</ol>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#000">src</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Status</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">InitializeConditions</span><span style="color:#000;font-weight:bold">()</span>
-<span style="color:#000">src</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Status</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">ObservedGeneration</span> <span style="color:#000;font-weight:bold">=</span> <span style="color:#000">src</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Generation</span>
-</code></pre></div><ol start="2">
-<li>Create/reconcile the Receive Adapter (detailed below)</li>
-<li>If successful, update the <code>Status</code> and <code>MarkDeployed</code></li>
-</ol>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#000">src</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Status</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">PropagateDeploymentAvailability</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">ra</span><span style="color:#000;font-weight:bold">)</span>
-</code></pre></div><ol start="4">
-<li>Create/reconcile the <code>SinkBinding</code> for the Receive Adapter targeting the <code>Sink</code> (detailed below)</li>
-<li>MarkSink with the result</li>
-</ol>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#000">src</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Status</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">MarkSink</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">sb</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Status</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">SinkURI</span><span style="color:#000;font-weight:bold">)</span>
-</code></pre></div><ol start="6">
-<li>Return a new reconciler event stating that the process is done</li>
-</ol>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#204a87;font-weight:bold">return</span> <span style="color:#000">pkgreconciler</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">NewEvent</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">corev1</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">EventTypeNormal</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#4e9a06">"SampleSourceReconciled"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#4e9a06">"SampleSource reconciled: \"%s/%s\""</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">namespace</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">name</span><span style="color:#000;font-weight:bold">)</span>
-</code></pre></div><h2 id="reconcilecreate-the-receive-adapter">Reconcile/Create The Receive Adapter</h2>
-<p>As part of the source reconciliation, we have to create and deploy
-(and update if necessary) the underlying receive adapter.</p>
-<p>Verify the specified kubernetes resources are valid, and update the <code>Status</code> accordingly</p>
-<p>Assemble the ReceiveAdapterArgs</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#000">raArgs</span> <span style="color:#ce5c00;font-weight:bold">:=</span> <span style="color:#000">resources</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">ReceiveAdapterArgs</span><span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">EventSource</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000">src</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Namespace</span> <span style="color:#ce5c00;font-weight:bold">+</span> <span style="color:#4e9a06">"/"</span> <span style="color:#ce5c00;font-weight:bold">+</span> <span style="color:#000">src</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Name</span><span style="color:#000;font-weight:bold">,</span>
- <span style="color:#000">Image</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000">r</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">ReceiveAdapterImage</span><span style="color:#000;font-weight:bold">,</span>
- <span style="color:#000">Source</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000">src</span><span style="color:#000;font-weight:bold">,</span>
- <span style="color:#000">Labels</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000">resources</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Labels</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">src</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Name</span><span style="color:#000;font-weight:bold">),</span>
- <span style="color:#000">AdditionalEnvs</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000">r</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">configAccessor</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">ToEnvVars</span><span style="color:#000;font-weight:bold">(),</span> <span style="color:#8f5902;font-style:italic">// Grab config envs for tracing/logging/metrics
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#000;font-weight:bold">}</span>
-</code></pre></div><p>NB The exact arguments may change based on functional requirements
-Create the underlying deployment from the arguments provided, matching pod templates, labels, owner references, etc as needed to fill out the deployment
-Example: <a href="https://github.com/knative-sandbox/sample-source/blob/main/pkg/reconciler/sample/resources/receive_adapter.go">pkg/reconciler/sample/resources/receive_adapter.go</a></p>
-<ol>
-<li>Fetch the existing receive adapter deployment</li>
-</ol>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#000">namespace</span> <span style="color:#ce5c00;font-weight:bold">:=</span> <span style="color:#000">owner</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">GetObjectMeta</span><span style="color:#000;font-weight:bold">().</span><span style="color:#000">GetNamespace</span><span style="color:#000;font-weight:bold">()</span>
-<span style="color:#000">ra</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">err</span> <span style="color:#ce5c00;font-weight:bold">:=</span> <span style="color:#000">r</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">KubeClientSet</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">AppsV1</span><span style="color:#000;font-weight:bold">().</span><span style="color:#000">Deployments</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">namespace</span><span style="color:#000;font-weight:bold">).</span><span style="color:#000">Get</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">expected</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Name</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">metav1</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">GetOptions</span><span style="color:#000;font-weight:bold">{})</span>
-</code></pre></div><ol start="2">
-<li>Otherwise, create the deployment</li>
-</ol>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#000">ra</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">err</span> <span style="color:#000;font-weight:bold">=</span> <span style="color:#000">r</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">KubeClientSet</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">AppsV1</span><span style="color:#000;font-weight:bold">().</span><span style="color:#000">Deployments</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">namespace</span><span style="color:#000;font-weight:bold">).</span><span style="color:#000">Create</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">expected</span><span style="color:#000;font-weight:bold">)</span>
-</code></pre></div><ol start="3">
-<li>Check if the expected vs existing spec is different, and update the deployment if required</li>
-</ol>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#000;font-weight:bold">}</span> <span style="color:#204a87;font-weight:bold">else</span> <span style="color:#204a87;font-weight:bold">if</span> <span style="color:#000">r</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">podSpecImageSync</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">expected</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Spec</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Template</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Spec</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">ra</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Spec</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Template</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Spec</span><span style="color:#000;font-weight:bold">)</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">ra</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Spec</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Template</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Spec</span> <span style="color:#000;font-weight:bold">=</span> <span style="color:#000">expected</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Spec</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Template</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Spec</span>
- <span style="color:#204a87;font-weight:bold">if</span> <span style="color:#000">ra</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">err</span> <span style="color:#000;font-weight:bold">=</span> <span style="color:#000">r</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">KubeClientSet</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">AppsV1</span><span style="color:#000;font-weight:bold">().</span><span style="color:#000">Deployments</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">namespace</span><span style="color:#000;font-weight:bold">).</span><span style="color:#000">Update</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">ra</span><span style="color:#000;font-weight:bold">);</span> <span style="color:#000">err</span> <span style="color:#ce5c00;font-weight:bold">!=</span> <span style="color:#204a87;font-weight:bold">nil</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#204a87;font-weight:bold">return</span> <span style="color:#000">ra</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">err</span>
- <span style="color:#000;font-weight:bold">}</span>
-</code></pre></div><ol start="4">
-<li>If updated, record the event</li>
-</ol>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#204a87;font-weight:bold">return</span> <span style="color:#000">pkgreconciler</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">NewEvent</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">corev1</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">EventTypeNormal</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#4e9a06">"DeploymentUpdated"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#4e9a06">"updated deployment: \"%s/%s\""</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">namespace</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">name</span><span style="color:#000;font-weight:bold">)</span>
-</code></pre></div><h2 id="reconcilecreate-the-sinkbinding">Reconcile/Create The SinkBinding</h2>
-<p>Instead of directly giving the details of the sink to the receive adapter, use a <code>SinkBinding</code> to bind the receive adapter with the sink.</p>
-<p>Steps here are almost the same with the <code>Deployment</code> reconciliation above, but it is for another resource, <code>SinkBinding</code>.</p>
-<ol>
-<li>Create a <code>Reference</code> for the receive adapter deployment. This deployment will be <code>SinkBinding</code>’s source:</li>
-</ol>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#000">tracker</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Reference</span><span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">APIVersion</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000">appsv1</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">SchemeGroupVersion</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">String</span><span style="color:#000;font-weight:bold">(),</span>
- <span style="color:#000">Kind</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">"Deployment"</span><span style="color:#000;font-weight:bold">,</span>
- <span style="color:#000">Namespace</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000">ra</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Namespace</span><span style="color:#000;font-weight:bold">,</span>
- <span style="color:#000">Name</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000">ra</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Name</span><span style="color:#000;font-weight:bold">,</span>
-<span style="color:#000;font-weight:bold">}</span>
-</code></pre></div><ol start="2">
-<li>Fetch the existing <code>SinkBinding</code></li>
-</ol>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#000">namespace</span> <span style="color:#ce5c00;font-weight:bold">:=</span> <span style="color:#000">owner</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">GetObjectMeta</span><span style="color:#000;font-weight:bold">().</span><span style="color:#000">GetNamespace</span><span style="color:#000;font-weight:bold">()</span>
-<span style="color:#000">sb</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">err</span> <span style="color:#ce5c00;font-weight:bold">:=</span> <span style="color:#000">r</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">EventingClientSet</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">SourcesV1alpha2</span><span style="color:#000;font-weight:bold">().</span><span style="color:#000">SinkBindings</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">namespace</span><span style="color:#000;font-weight:bold">).</span><span style="color:#000">Get</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">expected</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Name</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">metav1</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">GetOptions</span><span style="color:#000;font-weight:bold">{})</span>
-</code></pre></div><ol start="2">
-<li>If it doesn’t exist, create it</li>
-</ol>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#000">sb</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">err</span> <span style="color:#000;font-weight:bold">=</span> <span style="color:#000">r</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">EventingClientSet</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">SourcesV1alpha2</span><span style="color:#000;font-weight:bold">().</span><span style="color:#000">SinkBindings</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">namespace</span><span style="color:#000;font-weight:bold">).</span><span style="color:#000">Create</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">expected</span><span style="color:#000;font-weight:bold">)</span>
-</code></pre></div><ol start="3">
-<li>Check if the expected vs existing spec is different, and update the <code>SinkBinding</code> if required</li>
-</ol>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#204a87;font-weight:bold">else</span> <span style="color:#204a87;font-weight:bold">if</span> <span style="color:#000">r</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">specChanged</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">sb</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Spec</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">expected</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Spec</span><span style="color:#000;font-weight:bold">)</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">sb</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Spec</span> <span style="color:#000;font-weight:bold">=</span> <span style="color:#000">expected</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Spec</span>
- <span style="color:#204a87;font-weight:bold">if</span> <span style="color:#000">sb</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">err</span> <span style="color:#000;font-weight:bold">=</span> <span style="color:#000">r</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">EventingClientSet</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">SourcesV1alpha2</span><span style="color:#000;font-weight:bold">().</span><span style="color:#000">SinkBindings</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">namespace</span><span style="color:#000;font-weight:bold">).</span><span style="color:#000">Update</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">sb</span><span style="color:#000;font-weight:bold">);</span> <span style="color:#000">err</span> <span style="color:#ce5c00;font-weight:bold">!=</span> <span style="color:#204a87;font-weight:bold">nil</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#204a87;font-weight:bold">return</span> <span style="color:#000">sb</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">err</span>
- <span style="color:#000;font-weight:bold">}</span>
-</code></pre></div><ol start="4">
-<li>If updated, record the event</li>
-</ol>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#204a87;font-weight:bold">return</span> <span style="color:#000">pkgreconciler</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">NewEvent</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">corev1</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">EventTypeNormal</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#4e9a06">"SinkBindingUpdated"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#4e9a06">"updated SinkBinding: \"%s/%s\""</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">namespace</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">name</span><span style="color:#000;font-weight:bold">)</span>
-</code></pre></div>
-
-
-
-
- V0.22-Docs: Receive Adapter Implementation and Design
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/05-receive-adapter/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/05-receive-adapter/
-
-
-
- <h2 id="receive-adapter-cmd">Receive Adapter cmd</h2>
-<p>Similar to the controller, we’ll need an injection based <code>main.go</code> similar to the controller under <code>cmd/receiver_adapter/main.go</code></p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#8f5902;font-style:italic">// This Adapter generates events at a regular interval.
-</span><span style="color:#8f5902;font-style:italic"></span><span style="color:#204a87;font-weight:bold">package</span> <span style="color:#000">main</span>
-
-<span style="color:#204a87;font-weight:bold">import</span> <span style="color:#000;font-weight:bold">(</span>
- <span style="color:#4e9a06">"knative.dev/eventing/pkg/adapter"</span>
- <span style="color:#000">myadapter</span> <span style="color:#4e9a06">"knative.dev/sample-source/pkg/adapter"</span>
-<span style="color:#000;font-weight:bold">)</span>
-
-<span style="color:#204a87;font-weight:bold">func</span> <span style="color:#000">main</span><span style="color:#000;font-weight:bold">()</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">adapter</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Main</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"sample-source"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">myadapter</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">NewEnv</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">myadapter</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">NewAdapter</span><span style="color:#000;font-weight:bold">)</span>
-<span style="color:#000;font-weight:bold">}</span>
-
-</code></pre></div><h2 id="defining-newadapter-implementation-and-start-function">Defining NewAdapter implementation and Start function</h2>
-<p>The adapter’s <code>pkg</code> implementation consists of two main functions;</p>
-<ol>
-<li>A <code>NewAdapter(ctx context.Context, aEnv adapter.EnvConfigAccessor, ceClient cloudevents.Client) adapter.Adapter {}</code> call, which creates the
-new adapter with passed variables via the <code>EnvConfigAccessor</code>. The created adapter will be passed the cloudevents client (which is where the events are forwarded to). This is sometimes referred
-to as a sink, or <code>ceClient</code> in the Knative ecosystem. The return value is a reference to the adapter as defined by the adapter’s local struct.</li>
-</ol>
-<p>In our <code>sample-source</code>’s case;</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#8f5902;font-style:italic">// Adapter generates events at a regular interval.
-</span><span style="color:#8f5902;font-style:italic"></span><span style="color:#204a87;font-weight:bold">type</span> <span style="color:#000">Adapter</span> <span style="color:#204a87;font-weight:bold">struct</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">logger</span> <span style="color:#ce5c00;font-weight:bold">*</span><span style="color:#000">zap</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Logger</span>
- <span style="color:#000">interval</span> <span style="color:#000">time</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Duration</span>
- <span style="color:#000">nextID</span> <span style="color:#204a87;font-weight:bold">int</span>
- <span style="color:#000">client</span> <span style="color:#000">cloudevents</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Client</span>
-<span style="color:#000;font-weight:bold">}</span>
-</code></pre></div><ol start="2">
-<li><code>Start</code> function implemented as an interface to the adapter struct.</li>
-</ol>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#204a87;font-weight:bold">func</span> <span style="color:#000;font-weight:bold">(</span><span style="color:#000">a</span> <span style="color:#ce5c00;font-weight:bold">*</span><span style="color:#000">Adapter</span><span style="color:#000;font-weight:bold">)</span> <span style="color:#000">Start</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">stopCh</span> <span style="color:#ce5c00;font-weight:bold"><-</span><span style="color:#204a87;font-weight:bold">chan</span> <span style="color:#204a87;font-weight:bold">struct</span><span style="color:#000;font-weight:bold">{})</span> <span style="color:#204a87;font-weight:bold">error</span> <span style="color:#000;font-weight:bold">{</span>
-</code></pre></div><p><code>stopCh</code> is the signal to stop the Adapter. Otherwise the role of the function is to process the next
-event. In the case of the <code>sample-source</code>, it creates an event to forward to the specified cloudevent sink/client
-every X interval, as specified by the loaded <code>EnvConfigAccessor</code> (loaded via the resource yaml).</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-go" data-lang="go"><span style="color:#204a87;font-weight:bold">func</span> <span style="color:#000;font-weight:bold">(</span><span style="color:#000">a</span> <span style="color:#ce5c00;font-weight:bold">*</span><span style="color:#000">Adapter</span><span style="color:#000;font-weight:bold">)</span> <span style="color:#000">Start</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">stopCh</span> <span style="color:#ce5c00;font-weight:bold"><-</span><span style="color:#204a87;font-weight:bold">chan</span> <span style="color:#204a87;font-weight:bold">struct</span><span style="color:#000;font-weight:bold">{})</span> <span style="color:#204a87;font-weight:bold">error</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">a</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">logger</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Infow</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"Starting heartbeat"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">zap</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">String</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"interval"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">a</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">interval</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">String</span><span style="color:#000;font-weight:bold">()))</span>
- <span style="color:#204a87;font-weight:bold">for</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#204a87;font-weight:bold">select</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#204a87;font-weight:bold">case</span> <span style="color:#ce5c00;font-weight:bold"><-</span><span style="color:#000">time</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">After</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">a</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">interval</span><span style="color:#000;font-weight:bold">):</span>
- <span style="color:#000">event</span> <span style="color:#ce5c00;font-weight:bold">:=</span> <span style="color:#000">a</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">newEvent</span><span style="color:#000;font-weight:bold">()</span>
- <span style="color:#000">a</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">logger</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Infow</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"Sending new event"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">zap</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">String</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"event"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">event</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">String</span><span style="color:#000;font-weight:bold">()))</span>
- <span style="color:#204a87;font-weight:bold">if</span> <span style="color:#000">result</span> <span style="color:#ce5c00;font-weight:bold">:=</span> <span style="color:#000">a</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">client</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Send</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">context</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Background</span><span style="color:#000;font-weight:bold">(),</span> <span style="color:#000">event</span><span style="color:#000;font-weight:bold">);</span> <span style="color:#000;font-weight:bold">!</span><span style="color:#000">cloudevents</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">IsACK</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">result</span><span style="color:#000;font-weight:bold">)</span> <span style="color:#000;font-weight:bold">{</span>
- <span style="color:#000">a</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">logger</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Infow</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"failed to send event"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">zap</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">String</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"event"</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">event</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">String</span><span style="color:#000;font-weight:bold">()),</span> <span style="color:#000">zap</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Error</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">result</span><span style="color:#000;font-weight:bold">))</span>
- <span style="color:#8f5902;font-style:italic">// We got an error but it could be transient, try again next interval.
-</span><span style="color:#8f5902;font-style:italic"></span> <span style="color:#204a87;font-weight:bold">continue</span>
- <span style="color:#000;font-weight:bold">}</span>
- <span style="color:#204a87;font-weight:bold">case</span> <span style="color:#ce5c00;font-weight:bold"><-</span><span style="color:#000">stopCh</span><span style="color:#000;font-weight:bold">:</span>
- <span style="color:#000">a</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">logger</span><span style="color:#000;font-weight:bold">.</span><span style="color:#000">Info</span><span style="color:#000;font-weight:bold">(</span><span style="color:#4e9a06">"Shutting down..."</span><span style="color:#000;font-weight:bold">)</span>
- <span style="color:#204a87;font-weight:bold">return</span> <span style="color:#204a87;font-weight:bold">nil</span>
- <span style="color:#000;font-weight:bold">}</span>
- <span style="color:#000;font-weight:bold">}</span>
-<span style="color:#000;font-weight:bold">}</span>
-</code></pre></div>
-
-
-
-
- V0.22-Docs: Publishing to your Kubernetes cluster
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/06-yaml/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/06-yaml/
-
-
-
- <h2 id="run-the-sample-source-locally">Run the sample source locally</h2>
-<p>Start a minikube cluster.</p>
-<p><em>If you already have a Kubernetes cluster running, you can skip this step. The
-cluster must be 1.15+</em></p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-sh" data-lang="sh">minikube start
-</code></pre></div><p>Setup <code>ko</code> to use the minikube docker instance and local registry</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-sh" data-lang="sh"><span style="color:#204a87">eval</span> <span style="color:#204a87;font-weight:bold">$(</span>minikube docker-env<span style="color:#204a87;font-weight:bold">)</span>
-<span style="color:#204a87">export</span> <span style="color:#000">KO_DOCKER_REPO</span><span style="color:#ce5c00;font-weight:bold">=</span>ko.local
-</code></pre></div><p>Apply the CRD and configuration yaml</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-sh" data-lang="sh">ko apply -f config
-</code></pre></div><p>Once the <code>sample-source-controller-manager</code> is running in the <code>knative-samples</code> namespace, you can
-apply the <code>example.yaml</code> to connect our <code>sample-source</code> every <code>10s</code> directly to a <code>ksvc</code>.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-samples</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#000">---</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">samples.knative.dev/v1alpha1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">SampleSource</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sample-source</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">namespace</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">knative-samples</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">interval</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"10s"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div><div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-sh" data-lang="sh">ko apply -f example.yaml
-</code></pre></div><p>Once reconciled, you can confirm the <code>ksvc</code> is outputting valid cloudevents every <code>10s</code> to align with our specified interval.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-sh" data-lang="sh">% kubectl -n knative-samples logs -l serving.knative.dev/service<span style="color:#ce5c00;font-weight:bold">=</span>event-display -c user-container -f
-</code></pre></div><pre><code>☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: dev.knative.sample
- source: http://sample.knative.dev/heartbeat-source
- id: d4619592-363e-4a41-82d1-b1586c390e24
- time: 2019-12-17T01:31:10.795588888Z
- datacontenttype: application/json
-Data,
- {
- "Sequence": 0,
- "Heartbeat": "10s"
- }
-☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: dev.knative.sample
- source: http://sample.knative.dev/heartbeat-source
- id: db2edad0-06bc-4234-b9e1-7ea3955841d6
- time: 2019-12-17T01:31:20.825969504Z
- datacontenttype: application/json
-Data,
- {
- "Sequence": 1,
- "Heartbeat": "10s"
- }
-</code></pre>
-
-
-
-
- V0.22-Docs: Moving the event source to knative-sandbox
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/07-knative-sandbox/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/07-knative-sandbox/
-
-
-
- <p>If you would like to move your source over to the <a href="https://github.com/knative-sandbox"><code>knative-sandbox</code></a> organization follow the instructions to <a href="https://knative.dev/community/contributing/mechanics/creating-a-sandbox-repo/">create a sandbox repository</a>.</p>
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/simplified-controller.png b/archived/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/simplified-controller.png
deleted file mode 100644
index f5b65437a..000000000
Binary files a/archived/v0.22-docs/eventing/sources/creating-event-sources/writing-event-source/simplified-controller.png and /dev/null differ
diff --git a/archived/v0.22-docs/eventing/sources/index.html b/archived/v0.22-docs/eventing/sources/index.html
deleted file mode 100644
index 768eb473c..000000000
--- a/archived/v0.22-docs/eventing/sources/index.html
+++ /dev/null
@@ -1,2651 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Event sources | Knative
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Event sources | Knative
-
-
-
-
-
-
-
-
-
Black lives matter.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
An event source is a Kubernetes custom resource (CR), created by a developer or cluster administrator, that acts as a link between an event producer and an event sink.
-A sink can be a k8s service, including Knative Services, a Channel, or a Broker that receives events from an event source.
-
Event sources are created by instantiating a CR from a Source object.
-The Source object defines the arguments and parameters needed to instantiate a CR.
Brings Kubernetes API server events into Knative. The APIServerSource fires a new event each time a Kubernetes resource is created, updated or deleted.
Enables use of Apache Camel components for pushing events into Knative. A CamelSource is an event source that can represent any existing Apache Camel component, that provides a consumer side, and enables publishing events to an addressable endpoint. Each Camel endpoint has the form of a URI where the scheme is the ID of the component to use. CamelSource requires Camel-K to be installed into the current namespace. See the CamelSource example.
Brings Apache Kafka messages into Knative. The KafkaSource reads events from an Apache Kafka Cluster, and passes these events to a sink so that they can be consumed. See the Kafka Source example for more details.
The ContainerSource will instantiate container image(s) that can generate events until the ContainerSource is deleted. This may be used, for example, to poll an FTP server for new files or generate events at a set time interval. Given a spec.template with at least a container image specified, ContainerSource will keep a Pod running with the specified image(s). K_SINK (destination address) and KE_CE_OVERRIDES (JSON CloudEvents attributes) environment variables are injected into the running image(s). It is used by multiple other Sources as underlying infrastructure. Refer to the Container Source example for more details.
Registers for events of the specified types on the specified GitHub organization or repository, and brings those events into Knative. The GitHubSource fires a new event for selected GitHub event types. See the GitHub Source example for more details.
Registers for events of the specified types on the specified GitLab repository, and brings those events into Knative. The GitLabSource creates a webhooks for specified event types, listens for incoming events, and passes them to a consumer. See the GitLab Source example for more details.
The SinkBinding can be used to author new event sources using any of the familiar compute abstractions that Kubernetes makes available (e.g. Deployment, Job, DaemonSet, StatefulSet), or Knative abstractions (e.g. Service, Configuration). SinkBinding provides a framework for injecting K_SINK (destination address) and K_CE_OVERRIDES (JSON cloudevents attributes) environment variables into any Kubernetes resource which has a spec.template that looks like a Pod (aka PodSpecable). See the SinkBinding example for more details.
AutoContainerSource is a controller that allows the Source CRDs without needing a controller. It notices CRDs with a specific label and starts controlling resources of that type. It utilizes Container Source as underlying infrastructure.
Registers for events of the specified types on the specified Google Cloud Audit Logs. Brings those events into Knative. Refer to the CloudAuditLogsSource example for more details.
Create, update, and delete Google Cloud Scheduler Jobs. When those jobs are triggered, receive the event inside Knative. See the CloudSchedulerSource example for further details.
Registers for events of the specified types on the specified Google Cloud Storage bucket and optional object prefix. Brings those events into Knative. See the CloudStorageSource example.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/sources/index.xml b/archived/v0.22-docs/eventing/sources/index.xml
deleted file mode 100644
index 3acb19533..000000000
--- a/archived/v0.22-docs/eventing/sources/index.xml
+++ /dev/null
@@ -1,1022 +0,0 @@
-
-
- Knative – Event sources
- https://knative.dev/v0.22-docs/eventing/sources/
- Recent content in Event sources on Knative
- Hugo -- gohugo.io
-
-
-
-
-
-
-
-
-
-
- V0.22-Docs: APIServerSource
- https://knative.dev/v0.22-docs/eventing/sources/apiserversource/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/sources/apiserversource/
-
-
-
- <p><img src="https://img.shields.io/badge/API_Version-v1-red?style=flat-square" alt="version"></p>
-<p>An APIServerSource brings Kubernetes API server events into Knative.</p>
-<h2 id="installation">Installation</h2>
-<p>The APIServerSource source type is enabled by default when you install Knative Eventing.</p>
-<h2 id="example">Example</h2>
-<p>This example shows how to create an APIServerSource that listens to Kubernetes Events and
-send CloudEvents to the Event Display Service.</p>
-<h3 id="creating-a-namespace">Creating a namespace</h3>
-<p>Create a new namespace called <code>apiserversource-example</code> by entering the following
-command:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create namespace apiserversource-example
-</code></pre></div><h3 id="creating-the-event-display-service">Creating the Event Display Service</h3>
-<p>In this step, you create one event consumer, <code>event-display</code> to verify that
-<code>APIServerSource</code> is properly working.</p>
-<p>To deploy the <code>event-display</code> consumer to your cluster, run the following
-command:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n apiserversource-example apply -f - <span style="color:#4e9a06"><< EOF
-</span><span style="color:#4e9a06">apiVersion: apps/v1
-</span><span style="color:#4e9a06">kind: Deployment
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> replicas: 1
-</span><span style="color:#4e9a06"> selector:
-</span><span style="color:#4e9a06"> matchLabels: &labels
-</span><span style="color:#4e9a06"> app: event-display
-</span><span style="color:#4e9a06"> template:
-</span><span style="color:#4e9a06"> metadata:
-</span><span style="color:#4e9a06"> labels: *labels
-</span><span style="color:#4e9a06"> spec:
-</span><span style="color:#4e9a06"> containers:
-</span><span style="color:#4e9a06"> - name: event-display
-</span><span style="color:#4e9a06"> image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display
-</span><span style="color:#4e9a06">
-</span><span style="color:#4e9a06">---
-</span><span style="color:#4e9a06">
-</span><span style="color:#4e9a06">kind: Service
-</span><span style="color:#4e9a06">apiVersion: v1
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> selector:
-</span><span style="color:#4e9a06"> app: event-display
-</span><span style="color:#4e9a06"> ports:
-</span><span style="color:#4e9a06"> - protocol: TCP
-</span><span style="color:#4e9a06"> port: 80
-</span><span style="color:#4e9a06"> targetPort: 8080
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div><h3 id="creating-a-service-account">Creating a Service Account</h3>
-<p>Create a Service Account that the <code>ApiServerSource</code> runs as. The
-<code>ApiServerSource</code> watches for Kubernetes events and forwards them to the
-Knative Eventing Broker.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n apiserversource-example apply -f - <span style="color:#4e9a06"><< EOF
-</span><span style="color:#4e9a06">apiVersion: v1
-</span><span style="color:#4e9a06">kind: ServiceAccount
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: events-sa
-</span><span style="color:#4e9a06"> namespace: apiserversource-example
-</span><span style="color:#4e9a06">
-</span><span style="color:#4e9a06">---
-</span><span style="color:#4e9a06">apiVersion: rbac.authorization.k8s.io/v1
-</span><span style="color:#4e9a06">kind: ClusterRole
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: event-watcher
-</span><span style="color:#4e9a06">rules:
-</span><span style="color:#4e9a06"> - apiGroups:
-</span><span style="color:#4e9a06"> - ""
-</span><span style="color:#4e9a06"> resources:
-</span><span style="color:#4e9a06"> - events
-</span><span style="color:#4e9a06"> verbs:
-</span><span style="color:#4e9a06"> - get
-</span><span style="color:#4e9a06"> - list
-</span><span style="color:#4e9a06"> - watch
-</span><span style="color:#4e9a06">
-</span><span style="color:#4e9a06">---
-</span><span style="color:#4e9a06">apiVersion: rbac.authorization.k8s.io/v1
-</span><span style="color:#4e9a06">kind: ClusterRoleBinding
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: k8s-ra-event-watcher
-</span><span style="color:#4e9a06">roleRef:
-</span><span style="color:#4e9a06"> apiGroup: rbac.authorization.k8s.io
-</span><span style="color:#4e9a06"> kind: ClusterRole
-</span><span style="color:#4e9a06"> name: event-watcher
-</span><span style="color:#4e9a06">subjects:
-</span><span style="color:#4e9a06"> - kind: ServiceAccount
-</span><span style="color:#4e9a06"> name: events-sa
-</span><span style="color:#4e9a06"> namespace: apiserversource-example
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div><h3 id="creating-the-apiserversource">Creating the APIServerSource</h3>
-<p>In order to receive kubernetes events, you need to create a concrete APIServerSource for the namespace.</p>
-
-
-
-
-
-<ul class="nav nav-tabs" id="create-source" role="tablist">
-
-
-
-
-
-
- <li class="nav-item active">
- <a class="nav-link active" id="create-source-0-tab" data-toggle="tab" href="#create-source-0" role="tab" aria-controls="create-source-0" aria-selected="true">YAML</a>
- </li>
-
-
-
-
- <li class="nav-item ">
- <a class="nav-link " id="create-source-1-tab" data-toggle="tab" href="#create-source-1" role="tab" aria-controls="create-source-1" aria-selected="true">kn</a>
- </li>
-
-</ul>
-
-<div class="tab-content" >
-
-
-
-
-
-
- <div class="tab-pane fade show active" id="create-source-0" role="tabpanel" aria-labelledby="create-source-0-tab">
-
- <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n apiserversource-example apply -f - <span style="color:#4e9a06"><< EOF
-</span><span style="color:#4e9a06">apiVersion: sources.knative.dev/v1
-</span><span style="color:#4e9a06">kind: ApiServerSource
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: testevents
-</span><span style="color:#4e9a06"> namespace: apiserversource-example
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> serviceAccountName: events-sa
-</span><span style="color:#4e9a06"> mode: Resource
-</span><span style="color:#4e9a06"> resources:
-</span><span style="color:#4e9a06"> - apiVersion: v1
-</span><span style="color:#4e9a06"> kind: Event
-</span><span style="color:#4e9a06"> sink:
-</span><span style="color:#4e9a06"> ref:
-</span><span style="color:#4e9a06"> apiVersion: v1
-</span><span style="color:#4e9a06"> kind: Service
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div>
-
- </div>
-
-
-
-
- <div class="tab-pane fade " id="create-source-1" role="tabpanel" aria-labelledby="create-source-1-tab">
-
- <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kn <span style="color:#204a87">source</span> apiserver create testevents <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --namespace apiserversource-example <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --mode <span style="color:#4e9a06">"Resource"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --resource <span style="color:#4e9a06">"Event:v1"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --service-account events-sa <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --sink --sink http://event-display.svc.cluster.local
-</code></pre></div>
-
- </div>
-
-</div>
-
-<h3 id="creating-events">Creating Events</h3>
-<p>Create events by launching a pod in the default namespace. Create a <code>busybox</code>
-container and immediately delete it:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n apiserversource-example run busybox --image<span style="color:#ce5c00;font-weight:bold">=</span>busybox --restart<span style="color:#ce5c00;font-weight:bold">=</span>Never -- ls
-kubectl -n apiserversource-example delete pod busybox
-</code></pre></div><h3 id="verify">Verify</h3>
-<p>We will verify that the Kubernetes events were sent into the Knative eventing
-system by looking at our message dumper function logs.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n apiserversource-example logs -l <span style="color:#000">app</span><span style="color:#ce5c00;font-weight:bold">=</span>event-display --tail<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#0000cf;font-weight:bold">100</span>
-</code></pre></div><p>You should see log lines similar to:</p>
-<pre><code>☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: dev.knative.apiserver.resource.update
- source: https://10.96.0.1:443
- subject: /apis/v1/namespaces/apiserversource-example/events/testevents.15dd3050eb1e6f50
- id: e0447eb7-36b5-443b-9d37-faf4fe5c62f0
- time: 2020-07-28T19:14:54.719501054Z
- datacontenttype: application/json
-Extensions,
- kind: Event
- name: busybox.1626008649e617e3
- namespace: apiserversource-example
-Data,
- {
- "apiVersion": "v1",
- "count": 1,
- "eventTime": null,
- "firstTimestamp": "2020-07-28T19:14:54Z",
- "involvedObject": {
- "apiVersion": "v1",
- "fieldPath": "spec.containers{busybox}",
- "kind": "Pod",
- "name": "busybox",
- "namespace": "apiserversource-example",
- "resourceVersion": "28987493",
- "uid": "1efb342a-737b-11e9-a6c5-42010a8a00ed"
- },
- "kind": "Event",
- "lastTimestamp": "2020-07-28T19:14:54Z",
- "message": "Started container",
- "metadata": {
- "creationTimestamp": "2020-07-28T19:14:54Z",
- "name": "busybox.1626008649e617e3",
- "namespace": "default",
- "resourceVersion": "506088",
- "selfLink": "/api/v1/namespaces/apiserversource-example/events/busybox.1626008649e617e3",
- "uid": "2005af47-737b-11e9-a6c5-42010a8a00ed"
- },
- "reason": "Started",
- "reportingComponent": "",
- "reportingInstance": "",
- "source": {
- "component": "kubelet",
- "host": "gke-knative-auto-cluster-default-pool-23c23c4f-xdj0"
- },
- "type": "Normal"
- }
-</code></pre><h3 id="cleanup">Cleanup</h3>
-<p>Delete the <code>apiserversource-example</code> namespace and all of its resources from your
-cluster by entering the following command:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl delete namespace apiserversource-example
-</code></pre></div><h2 id="reference-documentation">Reference Documentation</h2>
-<p>See the <a href="../../../reference/api/eventing/#sources.knative.dev/v1.APIServerSource">APIServerSource specification</a>.</p>
-<h2 id="contact">Contact</h2>
-<p>For any inquiries about this source, please reach out on to the
-<a href="https://groups.google.com/forum/#!forum/knative-users">Knative users group</a>.</p>
-
-
-
-
-
- V0.22-Docs: ContainerSource
- https://knative.dev/v0.22-docs/eventing/sources/containersource/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/sources/containersource/
-
-
-
- <p><img src="https://img.shields.io/badge/API_Version-v1-red?style=flat-square" alt="version"></p>
-<p>ContainerSource will start a container image which will generate events under
-certain situations and send messages to a sink URI. It also can be an easy way
-to support your own event sources in Knative. This guide shows how to configure
-ContainerSource as an event source for functions and summarizes guidelines for
-creating your own event source as a ContainerSource.</p>
-<h3 id="prerequisites">Prerequisites</h3>
-<ul>
-<li>Install <a href="https://github.com/google/ko">ko</a></li>
-<li>Set <code>KO_DOCKER_REPO</code>
-(e.g. <code>gcr.io/[gcloud-project]</code> or <code>docker.io/<username></code>)</li>
-<li>Authenticated with your <code>KO_DOCKER_REPO</code></li>
-<li>Install <a href="https://docs.docker.com/install/"><code>docker</code></a></li>
-</ul>
-<h2 id="installation">Installation</h2>
-<p>The ContainerSource source type is enabled by default when you install Knative Eventing.</p>
-<h2 id="example">Example</h2>
-<p>This example shows how the heartbeats container sends events to the Event Display Service.</p>
-<h3 id="preparing-the-heartbeats-image">Preparing the heartbeats image</h3>
-<p>Knative <a href="https://github.com/knative/eventing-contrib">event-sources</a> has a
-sample of heartbeats event source. You could clone the source code by</p>
-<pre><code>git clone -b "release-0.22" https://github.com/knative/eventing-contrib.git
-</code></pre><p>And then build a heartbeats image and publish to your image repo with</p>
-<pre><code>ko publish knative.dev/eventing-contrib/cmd/heartbeats
-</code></pre><h3 id="creating-a-namespace">Creating a namespace</h3>
-<p>Create a new namespace called <code>containersource-example</code> by entering the following
-command:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create namespace containersource-example
-</code></pre></div><h3 id="creating-the-event-display-service">Creating the Event Display Service</h3>
-<p>In order to verify <code>ContainerSource</code> is working, we will create a Event Display
-Service that dumps incoming messages to its log.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n containersource-example apply -f - <span style="color:#4e9a06"><< EOF
-</span><span style="color:#4e9a06">apiVersion: apps/v1
-</span><span style="color:#4e9a06">kind: Deployment
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> replicas: 1
-</span><span style="color:#4e9a06"> selector:
-</span><span style="color:#4e9a06"> matchLabels: &labels
-</span><span style="color:#4e9a06"> app: event-display
-</span><span style="color:#4e9a06"> template:
-</span><span style="color:#4e9a06"> metadata:
-</span><span style="color:#4e9a06"> labels: *labels
-</span><span style="color:#4e9a06"> spec:
-</span><span style="color:#4e9a06"> containers:
-</span><span style="color:#4e9a06"> - name: event-display
-</span><span style="color:#4e9a06"> image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display
-</span><span style="color:#4e9a06">
-</span><span style="color:#4e9a06">---
-</span><span style="color:#4e9a06">
-</span><span style="color:#4e9a06">kind: Service
-</span><span style="color:#4e9a06">apiVersion: v1
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> selector:
-</span><span style="color:#4e9a06"> app: event-display
-</span><span style="color:#4e9a06"> ports:
-</span><span style="color:#4e9a06"> - protocol: TCP
-</span><span style="color:#4e9a06"> port: 80
-</span><span style="color:#4e9a06"> targetPort: 8080
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div><h3 id="creating-the-containersource-using-the-heartbeats-image">Creating the ContainerSource using the heartbeats image</h3>
-<p>In order to run the heartbeats container as an event source, you have to create
-a concrete ContainerSource with specific arguments and environment settings. Be
-sure to replace <code>heartbeats_image_uri</code> with a valid uri for your heartbeats
-image you published in the previous step.
-Note that arguments and environment variables are set and will be passed
-to the container.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n containersource-example apply -f - <span style="color:#4e9a06"><< EOF
-</span><span style="color:#4e9a06">apiVersion: sources.knative.dev/v1
-</span><span style="color:#4e9a06">kind: ContainerSource
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: test-heartbeats
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> template:
-</span><span style="color:#4e9a06"> spec:
-</span><span style="color:#4e9a06"> containers:
-</span><span style="color:#4e9a06"> # This corresponds to a heartbeats image uri you build and publish in the previous step
-</span><span style="color:#4e9a06"> # e.g. gcr.io/[gcloud-project]/knative.dev/eventing-contrib/cmd/heartbeats
-</span><span style="color:#4e9a06"> - image: <heartbeats_image_uri>
-</span><span style="color:#4e9a06"> name: heartbeats
-</span><span style="color:#4e9a06"> args:
-</span><span style="color:#4e9a06"> - --period=1
-</span><span style="color:#4e9a06"> env:
-</span><span style="color:#4e9a06"> - name: POD_NAME
-</span><span style="color:#4e9a06"> value: "mypod"
-</span><span style="color:#4e9a06"> - name: POD_NAMESPACE
-</span><span style="color:#4e9a06"> value: "event-test"
-</span><span style="color:#4e9a06"> sink:
-</span><span style="color:#4e9a06"> ref:
-</span><span style="color:#4e9a06"> apiVersion: v1
-</span><span style="color:#4e9a06"> kind: Service
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div><h3 id="verify">Verify</h3>
-<p>View the logs for the <code>event-display</code> event consumer by
-entering the following command:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n containersource-example logs -l <span style="color:#000">app</span><span style="color:#ce5c00;font-weight:bold">=</span>event-display --tail<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#0000cf;font-weight:bold">200</span>
-</code></pre></div><p>This returns the <code>Attributes</code> and <code>Data</code> of the events that the ContainerSource sent to the <code>event-display</code> Service:</p>
-<pre><code>☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: dev.knative.eventing.samples.heartbeat
- source: https://knative.dev/eventing-contrib/cmd/heartbeats/#event-test/mypod
- id: 2b72d7bf-c38f-4a98-a433-608fbcdd2596
- time: 2019-10-18T15:23:20.809775386Z
- contenttype: application/json
-Extensions,
- beats: true
- heart: yes
- the: 42
-Data,
- {
- "id": 2,
- "label": ""
- }
-</code></pre><h3 id="cleanup">Cleanup</h3>
-<p>Delete the <code>containersource-example</code> namespace and all of its resources from your
-cluster by entering the following command:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl delete namespace containersource-example
-</code></pre></div><h2 id="reference-documentation">Reference Documentation</h2>
-<p>See the <a href="../../../reference/api/eventing/#sources.knative.dev/v1.ContainerSource">ContainerSource specification</a>.</p>
-<h2 id="contact">Contact</h2>
-<p>For any inquiries about this source, please reach out on to the
-<a href="https://groups.google.com/forum/#!forum/knative-users">Knative users group</a>.</p>
-
-
-
-
-
- V0.22-Docs: PingSource
- https://knative.dev/v0.22-docs/eventing/sources/pingsource/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/sources/pingsource/
-
-
-
- <p><img src="https://img.shields.io/badge/API_Version-v1beta2-red?style=flat-square" alt="version"></p>
-<p>A PingSource produces events with a fixed payload on a specified cron schedule.</p>
-<h2 id="installation">Installation</h2>
-<p>The PingSource source type is enabled by default when you install Knative Eventing.</p>
-<h2 id="example">Example</h2>
-<p>This example shows how to send an event every minute to a Event Display Service.</p>
-<h3 id="creating-a-namespace">Creating a namespace</h3>
-<p>Create a new namespace called <code>pingsource-example</code> by entering the following
-command:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create namespace pingsource-example
-</code></pre></div><h3 id="creating-the-event-display-service">Creating the Event Display Service</h3>
-<p>In this step, you create one event consumer, <code>event-display</code> to verify that
-<code>PingSource</code> is properly working.</p>
-<p>To deploy the <code>event-display</code> consumer to your cluster, run the following
-command:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n pingsource-example apply -f - <span style="color:#4e9a06"><< EOF
-</span><span style="color:#4e9a06">apiVersion: apps/v1
-</span><span style="color:#4e9a06">kind: Deployment
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> replicas: 1
-</span><span style="color:#4e9a06"> selector:
-</span><span style="color:#4e9a06"> matchLabels: &labels
-</span><span style="color:#4e9a06"> app: event-display
-</span><span style="color:#4e9a06"> template:
-</span><span style="color:#4e9a06"> metadata:
-</span><span style="color:#4e9a06"> labels: *labels
-</span><span style="color:#4e9a06"> spec:
-</span><span style="color:#4e9a06"> containers:
-</span><span style="color:#4e9a06"> - name: event-display
-</span><span style="color:#4e9a06"> image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display
-</span><span style="color:#4e9a06">
-</span><span style="color:#4e9a06">---
-</span><span style="color:#4e9a06">
-</span><span style="color:#4e9a06">kind: Service
-</span><span style="color:#4e9a06">apiVersion: v1
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> selector:
-</span><span style="color:#4e9a06"> app: event-display
-</span><span style="color:#4e9a06"> ports:
-</span><span style="color:#4e9a06"> - protocol: TCP
-</span><span style="color:#4e9a06"> port: 80
-</span><span style="color:#4e9a06"> targetPort: 8080
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div><h3 id="creating-the-pingsource">Creating the PingSource</h3>
-<p>You can now create the <code>PingSource</code> sending an event containing
-<code>{"message": "Hello world!"}</code> every minute.</p>
-
-
-
-
-
-<ul class="nav nav-tabs" id="create-source" role="tablist">
-
-
-
-
-
-
- <li class="nav-item active">
- <a class="nav-link active" id="create-source-0-tab" data-toggle="tab" href="#create-source-0" role="tab" aria-controls="create-source-0" aria-selected="true">YAML</a>
- </li>
-
-
-
-
- <li class="nav-item ">
- <a class="nav-link " id="create-source-1-tab" data-toggle="tab" href="#create-source-1" role="tab" aria-controls="create-source-1" aria-selected="true">kn</a>
- </li>
-
-</ul>
-
-<div class="tab-content" >
-
-
-
-
-
-
- <div class="tab-pane fade show active" id="create-source-0" role="tabpanel" aria-labelledby="create-source-0-tab">
-
- <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create -n pingsource-example -f - <span style="color:#4e9a06"><<EOF
-</span><span style="color:#4e9a06">apiVersion: sources.knative.dev/v1beta2
-</span><span style="color:#4e9a06">kind: PingSource
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: test-ping-source
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> schedule: "*/1 * * * *"
-</span><span style="color:#4e9a06"> contentType: "application/json"
-</span><span style="color:#4e9a06"> data: '{"message": "Hello world!"}'
-</span><span style="color:#4e9a06"> sink:
-</span><span style="color:#4e9a06"> ref:
-</span><span style="color:#4e9a06"> apiVersion: v1
-</span><span style="color:#4e9a06"> kind: Service
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div>
-
- </div>
-
-
-
-
- <div class="tab-pane fade " id="create-source-1" role="tabpanel" aria-labelledby="create-source-1-tab">
-
- <p>Notice that the namespace is specified in two places in the command in <code>--namespace</code> and the <code>--sink</code> hostname</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kn <span style="color:#204a87">source</span> ping create test-ping-source <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --namespace pingsource-example <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --schedule <span style="color:#4e9a06">"*/1 * * * *"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --data <span style="color:#4e9a06">'{"message": "Hello world!"}'</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --sink http://event-display.pingsource-example.svc.cluster.local
-</code></pre></div>
-
- </div>
-
-</div>
-
-<h2 id="optional-create-a-pingsource-with-binary-data">(Optional) Create a PingSource with binary data</h2>
-<p>Sometimes you may want to send binary data, which cannot be directly serialized in yaml, to downstream. This can be achieved by using <code>dataBase64</code> as the payload. As the name suggests, <code>dataBase64</code> should carry data that is base64 encoded.</p>
-<p>Please note that <code>data</code> and <code>dataBase64</code> cannot co-exist.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl create -n pingsource-example -f - <span style="color:#4e9a06"><<EOF
-</span><span style="color:#4e9a06">apiVersion: sources.knative.dev/v1beta2
-</span><span style="color:#4e9a06">kind: PingSource
-</span><span style="color:#4e9a06">metadata:
-</span><span style="color:#4e9a06"> name: test-ping-source-binary
-</span><span style="color:#4e9a06">spec:
-</span><span style="color:#4e9a06"> schedule: "*/1 * * * *"
-</span><span style="color:#4e9a06"> contentType: "text/plain"
-</span><span style="color:#4e9a06"> dataBase64: "ZGF0YQ=="
-</span><span style="color:#4e9a06"> sink:
-</span><span style="color:#4e9a06"> ref:
-</span><span style="color:#4e9a06"> apiVersion: v1
-</span><span style="color:#4e9a06"> kind: Service
-</span><span style="color:#4e9a06"> name: event-display
-</span><span style="color:#4e9a06">EOF</span>
-</code></pre></div><h3 id="verify">Verify</h3>
-<p>View the logs for the <code>event-display</code> event consumer by
-entering the following command:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl -n pingsource-example logs -l <span style="color:#000">app</span><span style="color:#ce5c00;font-weight:bold">=</span>event-display --tail<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#0000cf;font-weight:bold">100</span>
-</code></pre></div><p>This returns the <code>Attributes</code> and <code>Data</code> of the events that the PingSource sent to the <code>event-display</code> Service:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: dev.knative.sources.ping
- source: /apis/v1/namespaces/pingsource-example/pingsources/test-ping-source
- id: 49f04fe2-7708-453d-ae0a-5fbaca9586a8
- time: 2021-03-25T19:41:00.444508332Z
- datacontenttype: application/json
-Data,
- <span style="color:#ce5c00;font-weight:bold">{</span>
- <span style="color:#4e9a06">"message"</span>: <span style="color:#4e9a06">"Hello world!"</span>
- <span style="color:#ce5c00;font-weight:bold">}</span>
-</code></pre></div><p>If you created a PingSource with binary data, you should also see the following:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">☁️ cloudevents.Event
-Validation: valid
-Context Attributes,
- specversion: 1.0
- type: dev.knative.sources.ping
- source: /apis/v1/namespaces/pingsource-example/pingsources/test-ping-source-binary
- id: ddd7bad2-9b6a-42a7-8f9b-b64494a6ce43
- time: 2021-03-25T19:38:00.455013472Z
- datacontenttype: text/plain
-Data,
- data
-</code></pre></div><h3 id="cleanup">Cleanup</h3>
-<p>Delete the <code>pingsource-example</code> namespace and all of its resources from your
-cluster by entering the following command:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl delete namespace pingsource-example
-</code></pre></div><h2 id="reference-documentation">Reference Documentation</h2>
-<p>See the <a href="../../../reference/api/eventing/#sources.knative.dev/v1beta2.PingSource">PingSource specification</a>.</p>
-<h2 id="contact">Contact</h2>
-<p>For any inquiries about this source, please reach out on to the
-<a href="https://groups.google.com/forum/#!forum/knative-users">Knative users group</a>.</p>
-
-
-
-
-
- V0.22-Docs: Sink binding
- https://knative.dev/v0.22-docs/eventing/sources/sinkbinding/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/sources/sinkbinding/
-
-
-
- <p><img src="https://img.shields.io/badge/API_Version-v1-red?style=flat-square" alt="version"></p>
-<p>The <code>SinkBinding</code> custom object supports decoupling event production from delivery addressing.</p>
-<p>You can use sink binding to connect Kubernetes resources that embed a <code>PodSpec</code> and want to produce events, such as an event source, to an addressable Kubernetes object that can receive events, also known as an <em>event sink</em>.</p>
-<p>Sink binding can be used to create new event sources using any of the familiar compute objects that Kubernetes makes available.
-For example, <code>Deployment</code>, <code>Job</code>, <code>DaemonSet</code>, or <code>StatefulSet</code> objects, or Knative abstractions, such as <code>Service</code> or <code>Configuration</code> objects, can be used.</p>
-<p>Sink binding injects environment variables into the <code>PodTemplateSpec</code> of the event sink, so that the application code does not need to interact directly with the Kubernetes API to locate the event destination.</p>
-<p>Sink binding operates in one of two modes; <code>Inclusion</code> or <code>Exclusion</code>.
-You can set the mode by modifying the <code>SINK_BINDING_SELECTION_MODE</code> of the <code>eventing-webhook</code> deployment accordingly. The mode determines the default scope of the webhook.</p>
-<p>By default, the webhook is set to <code>exclusion</code> mode, which means that any namespace that does not have the label <code>bindings.knative.dev/exclude: true</code> will be subject to mutation evalutation.</p>
-<p>If <code>SINK_BINDING_SELECTION_MODE</code> is set to <code>inclusion</code>, only the resources in a namespace labelled with <code>bindings.knative.dev/include: true</code> will be considered. In <code>inclusion</code> mode, any SinkBinding resource created will automatically label the <code>subject</code> namespace with <code>bindings.knative.dev/include: true</code> for inclusion in the potential environment variable inclusions.</p>
-<h2 id="getting-started">Getting started</h2>
-<p>The following procedures show how you can create a sink binding and connect it to a service and event source in your cluster.</p>
-<h3 id="creating-a-namespace">Creating a namespace</h3>
-<p>Create a namespace called <code>sinkbinding-example</code>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl create namespace sinkbinding-example
-</code></pre></div><h3 id="creating-a-knative-service">Creating a Knative service</h3>
-<p>Create a Knative service if you do not have an existing event sink that you want to connect to the sink binding.</p>
-<h4 id="prerequisites">Prerequisites</h4>
-<ul>
-<li>You must have Knative Serving installed on your cluster.</li>
-<li>Optional: If you want to use <code>kn</code> commands with sink binding, you must install the <code>kn</code> CLI.</li>
-</ul>
-<h4 id="procedure">Procedure</h4>
-<p>Create a Knative service:</p>
-
-
-
-
-
-<ul class="nav nav-tabs" id="knative_service" role="tablist">
-
-
-
-
-
-
- <li class="nav-item active">
- <a class="nav-link active" id="knative_service-0-tab" data-toggle="tab" href="#knative_service-0" role="tab" aria-controls="knative_service-0" aria-selected="true">kn</a>
- </li>
-
-
-
-
- <li class="nav-item ">
- <a class="nav-link " id="knative_service-1-tab" data-toggle="tab" href="#knative_service-1" role="tab" aria-controls="knative_service-1" aria-selected="true">yaml</a>
- </li>
-
-</ul>
-
-<div class="tab-content" >
-
-
-
-
-
-
- <div class="tab-pane fade show active" id="knative_service-0" role="tabpanel" aria-labelledby="knative_service-0-tab">
-
- <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kn service create hello --image gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display --env <span style="color:#000">RESPONSE</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">"Hello Serverless!"</span>
-</code></pre></div>
-
- </div>
-
-
-
-
- <div class="tab-pane fade " id="knative_service-1" role="tabpanel" aria-labelledby="knative_service-1-tab">
-
- <ol>
-<li>Copy the sample YAML into a <code>service.yaml</code> file:
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>Apply the file:
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply --filename service.yaml
-</code></pre></div></li>
-</ol>
-
-
- </div>
-
-</div>
-
-<h3 id="creating-a-cron-job">Creating a cron job</h3>
-<p>Create a cron job if you do not have an existing event source that you want to connect to the sink binding.</p>
-<!-- TODO: Add kn command-->
-<p>Create a <code>CronJob</code> object:</p>
-<ol>
-<li>Copy the sample YAML into a <code>cronjob.yaml</code> file:
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">batch/v1beta1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">CronJob</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">heartbeat-cron</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#8f5902;font-style:italic"># Run every minute</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">schedule</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"*/1 * * * *"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">jobTemplate</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">labels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">heartbeat-cron</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">template</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">restartPolicy</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Never</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">containers</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">single-heartbeat</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">image</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/heartbeats</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">args</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- --<span style="color:#000">period=1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">env</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">ONE_SHOT</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">value</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#4e9a06">"true"</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">POD_NAME</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">valueFrom</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">fieldRef</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">fieldPath</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">metadata.name</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span>- <span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">POD_NAMESPACE</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">valueFrom</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">fieldRef</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">fieldPath</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">metadata.namespace</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>Apply the file:
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply --filename heartbeats-source.yaml
-</code></pre></div></li>
-</ol>
-<h4 id="cloning-a-sample-heartbeat-cron-job">Cloning a sample heartbeat cron job</h4>
-<p>Knative <a href="https://github.com/knative/eventing-contrib">event-contrib</a> contains a
-sample heartbeats event source.</p>
-<h5 id="prerequisites-1">Prerequisites</h5>
-<ul>
-<li>Ensure that <code>ko publish</code> is set up correctly:
-<ul>
-<li><a href="https://github.com/knative/serving/blob/main/DEVELOPMENT.md#environment-setup"><code>KO_DOCKER_REPO</code></a>
-must be set. For example, <code>gcr.io/[gcloud-project]</code> or <code>docker.io/<username></code>.</li>
-<li>You must have authenticated with your <code>KO_DOCKER_REPO</code>.</li>
-</ul>
-</li>
-</ul>
-<h5 id="procedure-1">Procedure</h5>
-<ol>
-<li>Clone the <code>event-contib</code> repository:
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">$ git clone -b <span style="color:#4e9a06">"release-0.22"</span> https://github.com/knative/eventing-contrib.git
-</code></pre></div></li>
-<li>Build a heartbeats image, and publish the image to your image repository:
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">$ ko publish knative.dev/eventing-contrib/cmd/heartbeats
-</code></pre></div></li>
-</ol>
-<!-- TODO: Add tabs if there are kn commands etc to do this also-->
-<h2 id="creating-a-sinkbinding-object">Creating a SinkBinding object</h2>
-<p>Create a <code>SinkBinding</code> object that directs events from your cron job to the event sink.</p>
-<h3 id="prerequisites-2">Prerequisites</h3>
-<ul>
-<li>You must have Knative Eventing installed on your cluster.</li>
-<li>Optional: If you want to use <code>kn</code> commands with sink binding, you must install the <code>kn</code> CLI.</li>
-</ul>
-<h3 id="procedure-2">Procedure</h3>
-<p>Create a sink binding:</p>
-
-
-
-
-
-<ul class="nav nav-tabs" id="sinkbinding" role="tablist">
-
-
-
-
-
-
- <li class="nav-item active">
- <a class="nav-link active" id="sinkbinding-0-tab" data-toggle="tab" href="#sinkbinding-0" role="tab" aria-controls="sinkbinding-0" aria-selected="true">kn</a>
- </li>
-
-
-
-
- <li class="nav-item ">
- <a class="nav-link " id="sinkbinding-1-tab" data-toggle="tab" href="#sinkbinding-1" role="tab" aria-controls="sinkbinding-1" aria-selected="true">yaml</a>
- </li>
-
-</ul>
-
-<div class="tab-content" >
-
-
-
-
-
-
- <div class="tab-pane fade show active" id="sinkbinding-0" role="tabpanel" aria-labelledby="sinkbinding-0-tab">
-
- <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kn <span style="color:#204a87">source</span> binding create bind-heartbeat <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --namespace sinkbinding-example <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --subject <span style="color:#4e9a06">"Job:batch/v1:app=heartbeat-cron"</span> <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --sink http://event-display.svc.cluster.local <span style="color:#4e9a06">\
-</span><span style="color:#4e9a06"></span> --ce-override <span style="color:#4e9a06">"sink=bound"</span>
-</code></pre></div>
-
- </div>
-
-
-
-
- <div class="tab-pane fade " id="sinkbinding-1" role="tabpanel" aria-labelledby="sinkbinding-1-tab">
-
- <ol>
-<li>Copy the sample YAML into a <code>cronjob.yaml</code> file:
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">sources.knative.dev/v1alpha1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">SinkBinding</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">metadata</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">bind-heartbeat</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"></span><span style="color:#204a87;font-weight:bold">spec</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">subject</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">batch/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Job</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">selector</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">matchLabels</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">app</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">heartbeat-cron</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">sink</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">ref</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">apiVersion</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">serving.knative.dev/v1</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">kind</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">Service</span><span style="color:#f8f8f8;text-decoration:underline">
-</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#204a87;font-weight:bold">name</span><span style="color:#000;font-weight:bold">:</span><span style="color:#f8f8f8;text-decoration:underline"> </span><span style="color:#000">event-display</span><span style="color:#f8f8f8;text-decoration:underline">
-</span></code></pre></div></li>
-<li>Apply the file:
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply --filename heartbeats-source.yaml
-</code></pre></div></li>
-</ol>
-
-
- </div>
-
-</div>
-
-<h2 id="verification-steps">Verification steps</h2>
-<ol>
-<li>Verify that a message was sent to the Knative eventing system by looking at the <code>event-display</code> service logs:
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl logs -l serving.knative.dev/service<span style="color:#ce5c00;font-weight:bold">=</span>event-display -c user-container --since<span style="color:#ce5c00;font-weight:bold">=</span>10m
-</code></pre></div></li>
-<li>Observe the lines showing the request headers and body of the event message, sent by the heartbeats source to the display function:
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash"> ☁️ cloudevents.Event
- Validation: valid
- Context Attributes,
- specversion: 1.0
- type: dev.knative.eventing.samples.heartbeat
- source: https://knative.dev/eventing-contrib/cmd/heartbeats/#default/heartbeat-cron-1582120020-75qrz
- id: 5f4122be-ac6f-4349-a94f-4bfc6eb3f687
- time: 2020-02-19T13:47:10.41428688Z
- datacontenttype: application/json
- Extensions,
- beats: <span style="color:#204a87">true</span>
- heart: yes
- the: <span style="color:#0000cf;font-weight:bold">42</span>
- Data,
- <span style="color:#ce5c00;font-weight:bold">{</span>
- <span style="color:#4e9a06">"id"</span>: 1,
- <span style="color:#4e9a06">"label"</span>: <span style="color:#4e9a06">""</span>
- <span style="color:#ce5c00;font-weight:bold">}</span>
-</code></pre></div></li>
-</ol>
-<h2 id="cleanup">Cleanup</h2>
-<p>Delete the <code>sinkbinding-example</code> namespace and all of its resources from your
-cluster:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl delete namespace sinkbinding-example
-</code></pre></div>
-
-
-
-
- V0.22-Docs: Apache Camel source
- https://knative.dev/v0.22-docs/eventing/sources/apache-camel-source/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/sources/apache-camel-source/
-
-
-
- <p>These samples show how to configure Camel Sources. These event sources are highly dynamic and allow you to
-generate events from a variety of systems (cloud platforms, social networks, datastores, message brokers, legacy systems, etc.),
-leveraging all the <a href="https://camel.apache.org/components/latest/">300+ components provided by Apache Camel</a>.</p>
-<p>All Camel Sources use <a href="https://github.com/apache/camel-k">Apache Camel K</a> as the runtime engine.</p>
-<h2 id="prerequisites">Prerequisites</h2>
-<ol>
-<li>
-<p><a href="../../../install">Install Knative Serving and Eventing</a>.</p>
-</li>
-<li>
-<p>Install the <a href="https://github.com/apache/camel-k">Apache Camel K</a> Operator in
-any namespace where you want to run Camel sources.</p>
-<p>The preferred version that is compatible with Camel sources is
-<a href="https://github.com/apache/camel-k/releases">Camel K v1.0.0-M4</a>.</p>
-<p>Installation instructions are provided in the
-<a href="https://camel.apache.org/camel-k/latest/installation/installation.html">Apache Camel K Manual</a>.
-Documentation includes specific instructions for common Kubernetes
-environments, including development clusters.</p>
-</li>
-<li>
-<p>Install the Camel Source from the <code>camel.yaml</code> in the
-<a href="https://github.com/knative-sandbox/eventing-camel/releases">Knative Eventing Camel release page</a>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply --filename camel.yaml
-</code></pre></div></li>
-</ol>
-<h3 id="create-test-resources">Create Test Resources</h3>
-<p>All the <code>CamelSource</code> examples use some test resources for the purpose of displaying the generated events.
-The following resources need to be created:</p>
-<ul>
-<li>a simple Knative event display service that prints incoming events to its log</li>
-<li>an in-memory channel named <code>camel-test</code> that buffers events created by the
-event source</li>
-<li>a subscription to direct events from the test channel to the event display
-service</li>
-</ul>
-<p>Deploy the <a href="./display_resources.yaml"><code>display_resources.yaml</code></a>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply --filename display_resources.yaml
-</code></pre></div><h3 id="run-a-timer-camelsource">Run a Timer CamelSource</h3>
-<p>The samples directory contains some sample sources that can be used to generate
-events.</p>
-<p>The simplest example of <code>CamelSource</code>, that does not require additional
-configuration, is the timer source.</p>
-<p>The timer source periodically generates “Hello world!” events and forwards them to the provided destination.</p>
-<p>If you want, you can customize the source behavior using options available in
-the Apache Camel documentation for the
-<a href="https://camel.apache.org/components/latest/timer-component.html">timer component</a>.
-All Camel components are documented in the
-<a href="https://camel.apache.org/components/latest/">Apache Camel Website</a>.</p>
-<p>Install the <a href="source_timer.yaml">timer CamelSource</a> from source:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply -f source_timer.yaml
-</code></pre></div><p>Verify that the published events were sent into the Knative eventing system by
-looking at what is downstream of the <code>CamelSource</code>.</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl logs --selector serving.knative.dev/service<span style="color:#ce5c00;font-weight:bold">=</span>camel-event-display -c user-container
-</code></pre></div><p>If you have deployed the timer source, you should see new log lines appearing every
-3 seconds.</p>
-<h3 id="run-a-mqtt-camelsource">Run a MQTT CamelSource</h3>
-<p>One of the 300+ Camel components that you can leverage is <a href="https://camel.apache.org/components/latest/paho-component.html">Camel-Paho</a>,
-based on the <a href="https://www.eclipse.org/paho/">Eclipse Paho</a> open source project.</p>
-<p>A source based on Paho (like the provided <a href="source_mqtt.yaml">MQTT CamelSource</a>) allows to bridge any MQTT broker to a Knative resource,
-automatically converting IoT messages to Cloudevents.</p>
-<p>To use the MQTT source, you need a MQTT broker running and reachable from your cluster.
-For example, it’s possible to run a <a href="https://mosquitto.org/">Mosquito MQTT Broker</a> for testing purposes.</p>
-<p>First, edit the <a href="source_mqtt.yaml">MQTT CamelSource</a> and put the
-correct address of the MQTT broker in the <code>brokerUrl</code> field.
-You also need to provide the name of the topic that you want to subscribe to: just change <code>paho:mytopic</code> to match
-the topic that you want to use.</p>
-<p>You can also scale this source out, in order to obtain more throughput, by changing the value of the <code>replicas</code> field.
-By default it creates <em>2</em> replicas for demonstration purposes.</p>
-<p>To reduce noise in the event display, you can remove all previously created
-CamelSources from the namespace:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl delete camelsource --all
-</code></pre></div><p>Install the <a href="source_mqtt.yaml">mqtt CamelSource</a>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply -f source_mqtt.yaml
-</code></pre></div><p>You can now send MQTT messages to your broker using your favourite client (you can even use Camel K for sending test events).</p>
-<p>Each message you send to the MQTT broker will be printed by the event display as a Cloudevent.</p>
-<p>You can verify that your messages reach the event display by checking its logs:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl logs --selector serving.knative.dev/service<span style="color:#ce5c00;font-weight:bold">=</span>camel-event-display -c user-container
-</code></pre></div><h3 id="run-a-telegram-camelsource">Run a Telegram CamelSource</h3>
-<p>Another useful component available with Camel is the Telegram component. It can
-be used to forward messages of a <a href="https://telegram.org/">Telegram</a> chat into
-Knative channels as events.</p>
-<p>Before using the provided Telegram <code>CamelSource</code> example, you need to follow the
-instructions on the Telegram website for creating a
-<a href="https://core.telegram.org/bots">Telegram Bot</a>. The quickest way to create a bot
-is to contact the <a href="https://telegram.me/botfather">Bot Father</a>, another Telegram
-Bot, using your preferred Telegram client (mobile or web). After you create the
-bot, you will receive an <strong>authorization token</strong> that is needed for the source
-to work.</p>
-<p>First, edit the <a href="source_telegram.yaml">telegram CamelSource</a> and put the
-authorization token, replacing the <code><put-your-token-here></code> placeholder.</p>
-<p>To reduce noise in the event display, you can remove all previously created
-CamelSources from the namespace:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl delete camelsource --all
-</code></pre></div><p>Install the <a href="source_telegram.yaml">telegram CamelSource</a>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply -f source_telegram.yaml
-</code></pre></div><p>Now, you can contact your bot with any Telegram client. Each message you send to
-the bot will be printed by the event display as a Cloudevent.</p>
-<p>You can verify that your messages reach the event display by checking its logs:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl logs --selector serving.knative.dev/service<span style="color:#ce5c00;font-weight:bold">=</span>camel-event-display -c user-container
-</code></pre></div><h3 id="run-an-http-poller-camelsource">Run an HTTP Poller CamelSource</h3>
-<p>CamelSources are not limited to using a single Camel component. For example,
-you can combine the <a href="https://camel.apache.org/components/latest/timer-component.html">Camel Timer component</a>
-with the <a href="https://camel.apache.org/components/latest/http-component.html">Camel HTTP component</a>
-to periodically fetch an external API, transform the result into a Cloudevent and forward it to a
-given destination.</p>
-<p>The example will retrieve a static JSON file from a remote URL, but you can edit the
-<a href="source_http_poller.yaml">HTTP poller CamelSource</a> to add your own API.</p>
-<p>If you have previously deployed other CamelSources, to reduce noise in the event
-display, you can remove them all from the namespace:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl delete camelsource --all
-</code></pre></div><p>Install the <a href="source_http_poller.yaml">HTTP poller CamelSource</a>:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl apply -f source_http_poller.yaml
-</code></pre></div><p>The event display will show some JSON data periodically pulled from the external
-REST API. To check the logs:</p>
-<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl logs --selector serving.knative.dev/service<span style="color:#ce5c00;font-weight:bold">=</span>camel-event-display -c user-container
-</code></pre></div>
-
-
-
-
- V0.22-Docs: Creating an event source
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/
- Mon, 01 Jan 0001 00:00:00 +0000
-
- https://knative.dev/v0.22-docs/eventing/sources/creating-event-sources/
-
-
-
- <p>You can create your own event source for use with Knative Eventing components by using the following methods:</p>
-<ul>
-<li>Build an event source in Javascript, and implement it using a ContainerSource or SinkBinding.</li>
-<li>By creating your own event source controller, receiver adapter, and custom resource definition (CRD).</li>
-</ul>
-
-
-
-
-
-
diff --git a/archived/v0.22-docs/eventing/sources/pingsource/index.html b/archived/v0.22-docs/eventing/sources/pingsource/index.html
deleted file mode 100644
index 4c0c4ea9e..000000000
--- a/archived/v0.22-docs/eventing/sources/pingsource/index.html
+++ /dev/null
@@ -1,2459 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-PingSource | Knative
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PingSource | Knative
-
-
-
-
-
-
-
-
-
Black lives matter.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Sometimes you may want to send binary data, which cannot be directly serialized in yaml, to downstream. This can be achieved by using dataBase64 as the payload. As the name suggests, dataBase64 should carry data that is base64 encoded.
-
Please note that data and dataBase64 cannot co-exist.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
The SinkBinding custom object supports decoupling event production from delivery addressing.
-
You can use sink binding to connect Kubernetes resources that embed a PodSpec and want to produce events, such as an event source, to an addressable Kubernetes object that can receive events, also known as an event sink.
-
Sink binding can be used to create new event sources using any of the familiar compute objects that Kubernetes makes available.
-For example, Deployment, Job, DaemonSet, or StatefulSet objects, or Knative abstractions, such as Service or Configuration objects, can be used.
-
Sink binding injects environment variables into the PodTemplateSpec of the event sink, so that the application code does not need to interact directly with the Kubernetes API to locate the event destination.
-
Sink binding operates in one of two modes; Inclusion or Exclusion.
-You can set the mode by modifying the SINK_BINDING_SELECTION_MODE of the eventing-webhook deployment accordingly. The mode determines the default scope of the webhook.
-
By default, the webhook is set to exclusion mode, which means that any namespace that does not have the label bindings.knative.dev/exclude: true will be subject to mutation evalutation.
-
If SINK_BINDING_SELECTION_MODE is set to inclusion, only the resources in a namespace labelled with bindings.knative.dev/include: true will be considered. In inclusion mode, any SinkBinding resource created will automatically label the subject namespace with bindings.knative.dev/include: true for inclusion in the potential environment variable inclusions.
-
Getting started
-
The following procedures show how you can create a sink binding and connect it to a service and event source in your cluster.
-
Creating a namespace
-
Create a namespace called sinkbinding-example:
-
kubectl create namespace sinkbinding-example
-
Creating a Knative service
-
Create a Knative service if you do not have an existing event sink that you want to connect to the sink binding.
-
Prerequisites
-
-
You must have Knative Serving installed on your cluster.
-
Optional: If you want to use kn commands with sink binding, you must install the kn CLI.
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Knative Eventing Sugar Controller will react to special labels and annotations
-to produce or control eventing resources in a cluster or namespace. This allows
-cluster operators and developers to focus on creating fewer resources, and the
-underlying eventing infrastructure is created on-demand, and cleaned up when no
-longer needed.
-
Installing
-
The following command installs the Eventing Sugar Controller:
There might be cases where automated Broker creation is desirable, such as on
-namespace creation, or on Trigger creation. The Sugar controller enables those
-use-cases:
-
-
When a Namespace is labeled with eventing.knative.dev/injection=enabled, the
-sugar controller will create a default Broker named “default” in that
-namespace.
-
When a Trigger is annotated with eventing.knative.dev/injection=enabled, the
-controller will create a Broker named by that Trigger in the Trigger’s
-Namespace.
-
-
When a Broker is deleted and the above labels or annotations are in-use, the
-Sugar Controller will automatically recreate a default Broker.
-
Namespace Examples
-
Creating a “default” Broker when creating a Namespace:
Note: If the named Broker already exists, the Sugar controller will do
-nothing, and the Trigger will not own the existing Broker.
-
-
This will make a Broker called “sugar” in the Namespace “hello”, and attempt to
-send events to the “event-display” service.
-
If the Broker of the given name already exists in the Namespace, the Sugar
-Controller will do nothing.
-
-
-
-
-
-
-
-
-
- Table of contents
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-
We stand in solidarity with the Black community.
- Racism is unacceptable.
- It conflicts with the core values of the Knative project and our community does not tolerate it.
Simple example which will receive all the events from the given (default) broker and
-deliver them to the custom path /my-custom-path for the Kubernetes service my-service:
Exact match filtering on any number of CloudEvents attributes as well as
-extensions are supported. If your filter sets multiple attributes, an event must
-have all of the attributes for the Trigger to filter it. Note that we only
-support exact matching on string values.
The example above filters events from the default Broker that are of type
-dev.knative.foo.bar AND have the extension myextension with the value
-my-extension-value.
-
-
-
-
-
-
-
-
-
- Table of contents
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
We use analytics and cookies to understand site traffic. Information about your use of
- our site is shared with Google for that purpose. Learn more.
-