From 5163852eae3e35beb60de9bc4bd7e321cf25b818 Mon Sep 17 00:00:00 2001 From: Samia Nneji Date: Mon, 5 Jul 2021 19:18:29 +0100 Subject: [PATCH 01/12] Update links --- ...ent-driven-image-bigquery-processing-pipelines.md | 2 +- blog/releases/announcing-knative-v0-3-release.html | 2 +- .../install/eventing/install-eventing-with-yaml.md | 12 ++++++------ docs/eventing/README.md | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/blog/articles/event-driven-image-bigquery-processing-pipelines.md b/blog/articles/event-driven-image-bigquery-processing-pipelines.md index 7f6596871dc..c994ebf42ec 100644 --- a/blog/articles/event-driven-image-bigquery-processing-pipelines.md +++ b/blog/articles/event-driven-image-bigquery-processing-pipelines.md @@ -20,7 +20,7 @@ instructions, as part of my [Knative Tutorial](https://github.com/meteatamel/kna When creating these example pipelines, I relied on a few Knative components that greatly simplified my development. More specifially: -1. [Event sources](https://knative.dev/docs/eventing/sources/) allow you to +1. [Event sources](https://knative.dev/docs/developer/eventing/sources/) allow you to read external events in your cluster. [Knative-GCP Sources](https://github.com/google/knative-gcp#knative-gcp-sources) provide a number of eventing sources ready to read events from various Google Cloud diff --git a/blog/releases/announcing-knative-v0-3-release.html b/blog/releases/announcing-knative-v0-3-release.html index 83b8a2fb693..ad6f57f0feb 100644 --- a/blog/releases/announcing-knative-v0-3-release.html +++ b/blog/releases/announcing-knative-v0-3-release.html @@ -47,7 +47,7 @@

Networking

A frequently-requested feature is the ability to deploy services which are not exposed externally and can only be accessed by other services in the cluster. In v0.3, Routes configured to use the `svc.cluster.local` domain will only be exposed to the cluster-local Istio gateway. The cluster-local gateway will keep the deployed service inaccessible from outside the cluster. Developers can also use the `serving.knative.dev/visibility=cluster-local` label on their Route or Service to enable this behaviour.

Knative is also deprecating its dedicated Istio gateway. In v0.3 release, Knative will still expose public routes to both the deprecated gateway and the default Istio gateway. Starting with next release however, Knative will remove the deprecated gateway to further reduce overhead and avoid the additional cost of public IP. (Note, you may have to update the gateway IP in your DNS mappings).

Eventing

-

With the inclusion of Eventing in the previous release, there has been a significant focus on extending the number of and documenting available external event sources which can be installed in Knative as Kubernetes Custom Resource Definitions (CRDs). The complete list of currently supported event sources can be found here.

+

With the inclusion of Eventing in the previous release, there has been a significant focus on extending the number of and documenting available external event sources which can be installed in Knative as Kubernetes Custom Resource Definitions (CRDs). The complete list of currently supported event sources can be found here.

Build

The Knative Build component can now support both single `source` and multiple input `sources`. If multiple sources are requested, each will be fetched in declared order and placed into a directory under `/workspace` named after the source’s name field. The Build controller is also now subject to the PodSecurityPolicy which enables cluster operators to specify further limitations.

Monitoring

diff --git a/docs/admin/install/eventing/install-eventing-with-yaml.md b/docs/admin/install/eventing/install-eventing-with-yaml.md index b59b3a18560..6d099289a85 100644 --- a/docs/admin/install/eventing/install-eventing-with-yaml.md +++ b/docs/admin/install/eventing/install-eventing-with-yaml.md @@ -261,7 +261,7 @@ The tabs below expand to show instructions for installing each Eventing extensio configuration yet. To learn more about the Github source, try - [our sample](../../../../eventing/sources/github-source/) + [our sample](../../../../developer/eventing/sources/github-source/) === "Apache Kafka Source" @@ -272,7 +272,7 @@ The tabs below expand to show instructions for installing each Eventing extensio ``` To learn more about the Apache Kafka source, try - [our sample](../../../../eventing/sources/kafka-source) + [our sample](../../../../developer/eventing/sources/kafka-source) === "GCP Sources" @@ -285,16 +285,16 @@ The tabs below expand to show instructions for installing each Eventing extensio ``` To learn more about the Cloud Pub/Sub source, try - [our sample](../../../../eventing/sources/cloud-pubsub-source). + [our sample](../../../../developer/eventing/sources/cloud-pubsub-source). To learn more about the Cloud Storage source, try - [our sample](../../../../eventing/sources/cloud-storage-source). + [our sample](../../../../developer/eventing/sources/cloud-storage-source). To learn more about the Cloud Scheduler source, try - [our sample](../../../../eventing/sources/cloud-scheduler-source). + [our sample](../../../../developer/eventing/sources/cloud-scheduler-source). To learn more about the Cloud Audit Logs source, try - [our sample](../../../../eventing/sources/cloud-audit-logs-source). + [our sample](../../../../developer/eventing/sources/cloud-audit-logs-source). === "Apache CouchDB Source" diff --git a/docs/eventing/README.md b/docs/eventing/README.md index ab2396c146c..152342933ed 100644 --- a/docs/eventing/README.md +++ b/docs/eventing/README.md @@ -2,7 +2,7 @@ Knative Eventing enables developers to use an [event-driven architecture](https://en.wikipedia.org/wiki/Event-driven_architecture) with serverless applications. An event-driven architecture is based on the concept of decoupled relationships between event producers that create events, and event consumers, or [_sinks_](../../developer/eventing/sinks), that receive events. -In a Knative Eventing deployment, event [Sources](../../eventing/sources) are the primary event producers, however you can also configure a sink or _subscriber_ to respond to HTTP requests by sending a response event. Examples of sinks in a Knative Eventing deployment include Knative Services, Channels and Brokers. +In a Knative Eventing deployment, event [Sources](../../developer/eventing/sources) are the primary event producers, however you can also configure a sink or _subscriber_ to respond to HTTP requests by sending a response event. Examples of sinks in a Knative Eventing deployment include Knative Services, Channels and Brokers. Knative Eventing uses standard HTTP POST requests to send and receive events between event producers and sinks. These events conform to the [CloudEvents specifications](https://cloudevents.io/), which enables creating, parsing, sending, and receiving events in any programming language. From f24bee4489201f10d2153ee86432894f1dd438b5 Mon Sep 17 00:00:00 2001 From: Samia Nneji Date: Mon, 5 Jul 2021 19:21:39 +0100 Subject: [PATCH 02/12] Update nav.yaml for event source move --- config/nav.yml | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/config/nav.yml b/config/nav.yml index d1f5c84dd39..2656e40a8a3 100644 --- a/config/nav.yml +++ b/config/nav.yml @@ -70,14 +70,34 @@ nav: - Troubleshooting: - Debugging application issues: developer/serving/troubleshooting/debugging-application-issues.md - Knative Eventing: + - Creating an event source: + - Overview: developer/eventing/sources/creating-event-sources/README.md + - Writing an event source using Javascript: developer/eventing/sources/creating-event-sources/writing-event-source-easy-way/README.md + - Using the sample event source: + - Overview: developer/eventing/sources/creating-event-sources/writing-event-source/README.md + - Design of an Event Source: developer/eventing/sources/creating-event-sources/writing-event-source/01-theory.md + - Lifecycle and Types: developer/eventing/sources/creating-event-sources/writing-event-source/02-lifecycle-and-types.md + - Controller Implemetation: developer/eventing/sources/creating-event-sources/writing-event-source/03-controller.md + - Reconciler Implementation: developer/eventing/sources/creating-event-sources/writing-event-source/04-reconciler.md + - Receive Adapter Implementation: developer/eventing/sources/creating-event-sources/writing-event-source/05-receive-adapter.md + - Publishing to your cluster: developer/eventing/sources/creating-event-sources/writing-event-source/06-yaml.md + - Moving to knative-sandbox: developer/eventing/sources/creating-event-sources/writing-event-source/07-knative-sandbox.md - Event sources: + - Overview: developer/eventing/sources/README.md - ApiServerSource: - Overview: developer/eventing/sources/apiserversource/README.md - Creating an ApiServerSource object: developer/eventing/sources/apiserversource/getting-started/README.md - ApiServerSource reference: developer/eventing/sources/apiserversource/reference.md + - Camel source: developer/eventing/sources/apache-camel-source/README.md - ContainerSource: - Creating a ContainerSource object: developer/eventing/sources/containersource/README.md - ContainerSource Reference: developer/eventing/sources/containersource/reference.md + - Kafka source: developer/eventing/sources/kafka-source/README.md + - PingSource: developer/eventing/sources/ping-source/README.md + - SinkBinding: + - Overview: developer/eventing/sources/sinkbinding/README.md + - Creating a SinkBinding object: developer/eventing/sources/sinkbinding/getting-started.md + - SinkBinding reference: developer/eventing/sources/sinkbinding/reference.md - Event delivery: developer/eventing/event-delivery.md - Event sinks: - About sinks: developer/eventing/sinks/README.md @@ -157,27 +177,6 @@ nav: - Knative Eventing: - Overview: eventing/README.md - Getting started: eventing/getting-started.md - - Event sources: - - Overview: eventing/sources/README.md - - PingSource: eventing/sources/ping-source/README.md - - SinkBinding: - - Overview: eventing/sources/sinkbinding/README.md - - Creating a SinkBinding object: eventing/sources/sinkbinding/getting-started.md - - SinkBinding reference: eventing/sources/sinkbinding/reference.md - - Camel source: eventing/sources/apache-camel-source/README.md - - Kafka source: eventing/sources/kafka-source/README.md - - Creating an event source: - - Overview: eventing/sources/creating-event-sources/README.md - - Writing an event source using Javascript: eventing/sources/creating-event-sources/writing-event-source-easy-way/README.md - - Using the sample event source: - - Overview: eventing/sources/creating-event-sources/writing-event-source/README.md - - Design of an Event Source: eventing/sources/creating-event-sources/writing-event-source/01-theory.md - - Lifecycle and Types: eventing/sources/creating-event-sources/writing-event-source/02-lifecycle-and-types.md - - Controller Implemetation: eventing/sources/creating-event-sources/writing-event-source/03-controller.md - - Reconciler Implementation: eventing/sources/creating-event-sources/writing-event-source/04-reconciler.md - - Receive Adapter Implementation: eventing/sources/creating-event-sources/writing-event-source/05-receive-adapter.md - - Publishing to your cluster: eventing/sources/creating-event-sources/writing-event-source/06-yaml.md - - Moving to knative-sandbox: eventing/sources/creating-event-sources/writing-event-source/07-knative-sandbox.md - Event registry: eventing/event-registry.md - Flows: - Overview: eventing/flows/README.md @@ -239,4 +238,3 @@ nav: - kn plugins: client/kn-plugins.md - "Join the Community ➠": /community/ - "Read the Blog ➠": /blog/ - From 205ceb8305c63d7b3a02089e1550c21954230b61 Mon Sep 17 00:00:00 2001 From: Samia Nneji Date: Mon, 5 Jul 2021 19:23:10 +0100 Subject: [PATCH 03/12] fix another link --- docs/getting-started/getting-started-eventing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started/getting-started-eventing.md b/docs/getting-started/getting-started-eventing.md index 83c0a77f815..9a64a29e834 100644 --- a/docs/getting-started/getting-started-eventing.md +++ b/docs/getting-started/getting-started-eventing.md @@ -10,7 +10,7 @@ With Knative Serving, we have a powerful tool which can take our containerized c ==**Knative Eventing acts as the "glue" between the disparate parts of your architecture**== and allows you to easily communicate between those parts in a fault-tolerant way. Some examples include: -:material-file-document: [Creating and responding to Kubernetes API events](../../eventing/sources/apiserversource/){target=blank} +:material-file-document: [Creating and responding to Kubernetes API events](../../developer/eventing/sources/apiserversource/){target=blank} --8<-- "YouTube_icon.svg" [Creating an image processing pipeline](https://www.youtube.com/watch?v=DrmOpjAunlQ){target=blank} From 2ce64c8ef554f8926b063891fe44dec5e8fc605b Mon Sep 17 00:00:00 2001 From: Samia Nneji Date: Mon, 5 Jul 2021 19:23:31 +0100 Subject: [PATCH 04/12] Move event source files to developer guide --- docs/{ => developer}/eventing/sources/OWNERS | 0 .../eventing/sources/README.md | 16 +- .../sources/apache-camel-source/README.md | 0 .../sources/cloud-audit-logs-source/README.md | 0 .../sources/cloud-pubsub-source/README.md | 0 .../sources/cloud-scheduler-source/README.md | 0 .../sources/cloud-storage-source/README.md | 0 .../sources/container-source/README.md | 0 .../container-source/heartbeats-source.yaml | 0 .../sources/container-source/service.yaml | 0 .../sources/creating-event-sources/README.md | 0 .../writing-event-source-easy-way/Dockerfile | 0 .../writing-event-source-easy-way/README.md | 0 .../writing-event-source-easy-way/index.js | 0 .../package.json | 0 .../writing-event-source/01-theory.md | 0 .../02-lifecycle-and-types.md | 0 .../writing-event-source/03-controller.md | 0 .../writing-event-source/04-reconciler.md | 0 .../05-receive-adapter.md | 0 .../writing-event-source/06-yaml.md | 0 .../07-knative-sandbox.md | 0 .../writing-event-source/README.md | 0 .../simplified-controller.png | Bin .../eventing/sources/github-source/README.md | 0 .../sources/github-source/github-source.yaml | 0 .../sources/github-source/githubsecret.yaml | 0 .../github-source/personal_access_token.png | Bin .../sources/github-source/service.yaml | 0 .../sources/github-source/webhook_created.png | Bin .../eventing/sources/gitlab-source/README.md | 0 .../eventing/sources/kafka-source/README.md | 0 .../sources/kafka-source/event-display.yaml | 0 .../sources/kafka-source/event-source.yaml | 0 .../sources/kafka-source/kafka-topic.yaml | 0 .../eventing/sources/ping-source/README.md | 0 .../ping-source/ping-source-binary.yaml | 0 .../sources/ping-source/ping-source.yaml | 0 .../eventing/sources/ping-source/service.yaml | 0 .../eventing/sources/sinkbinding/README.md | 0 .../sources/sinkbinding/getting-started.md | 0 .../eventing/sources/sinkbinding/reference.md | 0 .../sources/containersource/README.md | 224 ------------------ .../sources/containersource/reference.md | 149 ------------ 44 files changed, 8 insertions(+), 381 deletions(-) rename docs/{ => developer}/eventing/sources/OWNERS (100%) rename docs/{ => developer}/eventing/sources/README.md (79%) rename docs/{ => developer}/eventing/sources/apache-camel-source/README.md (100%) rename docs/{ => developer}/eventing/sources/cloud-audit-logs-source/README.md (100%) rename docs/{ => developer}/eventing/sources/cloud-pubsub-source/README.md (100%) rename docs/{ => developer}/eventing/sources/cloud-scheduler-source/README.md (100%) rename docs/{ => developer}/eventing/sources/cloud-storage-source/README.md (100%) rename docs/{ => developer}/eventing/sources/container-source/README.md (100%) rename docs/{ => developer}/eventing/sources/container-source/heartbeats-source.yaml (100%) rename docs/{ => developer}/eventing/sources/container-source/service.yaml (100%) rename docs/{ => developer}/eventing/sources/creating-event-sources/README.md (100%) rename docs/{ => developer}/eventing/sources/creating-event-sources/writing-event-source-easy-way/Dockerfile (100%) rename docs/{ => developer}/eventing/sources/creating-event-sources/writing-event-source-easy-way/README.md (100%) rename docs/{ => developer}/eventing/sources/creating-event-sources/writing-event-source-easy-way/index.js (100%) rename docs/{ => developer}/eventing/sources/creating-event-sources/writing-event-source-easy-way/package.json (100%) rename docs/{ => developer}/eventing/sources/creating-event-sources/writing-event-source/01-theory.md (100%) rename docs/{ => developer}/eventing/sources/creating-event-sources/writing-event-source/02-lifecycle-and-types.md (100%) rename docs/{ => developer}/eventing/sources/creating-event-sources/writing-event-source/03-controller.md (100%) rename docs/{ => developer}/eventing/sources/creating-event-sources/writing-event-source/04-reconciler.md (100%) rename docs/{ => developer}/eventing/sources/creating-event-sources/writing-event-source/05-receive-adapter.md (100%) rename docs/{ => developer}/eventing/sources/creating-event-sources/writing-event-source/06-yaml.md (100%) rename docs/{ => developer}/eventing/sources/creating-event-sources/writing-event-source/07-knative-sandbox.md (100%) rename docs/{ => developer}/eventing/sources/creating-event-sources/writing-event-source/README.md (100%) rename docs/{ => developer}/eventing/sources/creating-event-sources/writing-event-source/simplified-controller.png (100%) rename docs/{ => developer}/eventing/sources/github-source/README.md (100%) rename docs/{ => developer}/eventing/sources/github-source/github-source.yaml (100%) rename docs/{ => developer}/eventing/sources/github-source/githubsecret.yaml (100%) rename docs/{ => developer}/eventing/sources/github-source/personal_access_token.png (100%) rename docs/{ => developer}/eventing/sources/github-source/service.yaml (100%) rename docs/{ => developer}/eventing/sources/github-source/webhook_created.png (100%) rename docs/{ => developer}/eventing/sources/gitlab-source/README.md (100%) rename docs/{ => developer}/eventing/sources/kafka-source/README.md (100%) rename docs/{ => developer}/eventing/sources/kafka-source/event-display.yaml (100%) rename docs/{ => developer}/eventing/sources/kafka-source/event-source.yaml (100%) rename docs/{ => developer}/eventing/sources/kafka-source/kafka-topic.yaml (100%) rename docs/{ => developer}/eventing/sources/ping-source/README.md (100%) rename docs/{ => developer}/eventing/sources/ping-source/ping-source-binary.yaml (100%) rename docs/{ => developer}/eventing/sources/ping-source/ping-source.yaml (100%) rename docs/{ => developer}/eventing/sources/ping-source/service.yaml (100%) rename docs/{ => developer}/eventing/sources/sinkbinding/README.md (100%) rename docs/{ => developer}/eventing/sources/sinkbinding/getting-started.md (100%) rename docs/{ => developer}/eventing/sources/sinkbinding/reference.md (100%) delete mode 100644 docs/eventing/sources/containersource/README.md delete mode 100644 docs/eventing/sources/containersource/reference.md diff --git a/docs/eventing/sources/OWNERS b/docs/developer/eventing/sources/OWNERS similarity index 100% rename from docs/eventing/sources/OWNERS rename to docs/developer/eventing/sources/OWNERS diff --git a/docs/eventing/sources/README.md b/docs/developer/eventing/sources/README.md similarity index 79% rename from docs/eventing/sources/README.md rename to docs/developer/eventing/sources/README.md index 49ec1f28e6a..029528492ca 100644 --- a/docs/eventing/sources/README.md +++ b/docs/developer/eventing/sources/README.md @@ -37,18 +37,18 @@ All Sources are part of the `sources` category. | Name | API Version | Maintainer | Description | | -- | -- | -- | -- | -| [APIServerSource](./apiserversource) | v1 | Knative | Brings Kubernetes API server events into Knative. The APIServerSource fires a new event each time a Kubernetes resource is created, updated or deleted. | +| [APIServerSource](./apiserversource/README.md) | v1 | Knative | Brings Kubernetes API server events into Knative. The APIServerSource fires a new event each time a Kubernetes resource is created, updated or deleted. | | [AWS SQS](https://github.com/knative-sandbox/eventing-awssqs/tree/main/samples) | v1alpha1 | Knative | Brings [AWS Simple Queue Service](https://aws.amazon.com/sqs/) messages into Knative. The AwsSqsSource fires a new event each time an event is published on an [AWS SQS topic](https://aws.amazon.com/sqs/). | -| [Apache Camel](./apache-camel-source) | N/A | Apache Software Foundation | Enables use of [Apache Camel](https://github.com/apache/camel) components for pushing events into Knative. Camel sources are now provided via [Kamelets](https://camel.apache.org/camel-kamelets/latest/) as part of the [Apache Camel K](https://camel.apache.org/camel-k/latest/installation/installation.html) project. | +| [Apache Camel](./apache-camel-source/README.md) | N/A | Apache Software Foundation | Enables use of [Apache Camel](https://github.com/apache/camel) components for pushing events into Knative. Camel sources are now provided via [Kamelets](https://camel.apache.org/camel-kamelets/latest/) as part of the [Apache Camel K](https://camel.apache.org/camel-k/latest/installation/installation.html) project. | | [Apache CouchDB](https://github.com/knative-sandbox/eventing-couchdb/blob/main/source) | v1alpha1 | Knative | Brings [Apache CouchDB](https://couchdb.apache.org/) messages into Knative. | -| [Apache Kafka](../samples/kafka) | v1beta1 | Knative | Brings [Apache Kafka](https://kafka.apache.org/) 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](https://github.com/knative-sandbox/eventing-kafka/blob/main/pkg/source) example for more details. | -| [Container Source](./containersource/README.md) | v1 | Knative | 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](./container-source) example for more details. | -| [GitHub](./github-source) | v1alpha1 | Knative | 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](https://developer.github.com/v3/activity/events/types/). See the [GitHub Source](./github-source) example for more details. | -| [GitLab](./gitlab-source) | v1alpha1 | Knative | 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](https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#events), listens for incoming events, and passes them to a consumer. See the [GitLab Source](./gitlab-source) example for more details. | +| [Apache Kafka](../../../eventing/samples/kafka/) | v1beta1 | Knative | Brings [Apache Kafka](https://kafka.apache.org/) 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](https://github.com/knative-sandbox/eventing-kafka/blob/main/pkg/source) example for more details. | +| [Container Source](./containersource/README.md) | v1 | Knative | 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](./container-source/README.md) example for more details. | +| [GitHub](./github-source) | v1alpha1 | Knative | 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](https://developer.github.com/v3/activity/events/types/). See the [GitHub Source](./github-source/README.md) example for more details. | +| [GitLab](./gitlab-source/README.md) | v1alpha1 | Knative | 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](https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#events), listens for incoming events, and passes them to a consumer. See the [GitLab Source](./gitlab-source/README.md) example for more details. | | [Heartbeats](https://github.com/knative/eventing/tree/main/cmd/heartbeats) | N/A | Knative | Uses an in-memory timer to produce events at the specified interval. | -| [PingSource](./ping-source) | v1beta2 | Knative | Produces events with a fixed payload on a specified [Cron](https://en.wikipedia.org/wiki/Cron) schedule. See the [Ping Source](./ping-source) example for more details. | +| [PingSource](./ping-source/README.md) | v1beta2 | Knative | Produces events with a fixed payload on a specified [Cron](https://en.wikipedia.org/wiki/Cron) schedule. See the [Ping Source](./ping-source) example for more details. | | [RabbitMQ](https://github.com/knative-sandbox/eventing-rabbitmq) | Active development | None | Brings [RabbitMQ](https://www.rabbitmq.com/) messages into Knative. -| [SinkBinding](./sinkbinding/) | v1 | Knative | 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](./container-source) example for more details. | +| [SinkBinding](./sinkbinding/README.md) | v1 | Knative | 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](./sinkbinding/README.md) example for more details. | | [WebSocket](https://github.com/knative/eventing/tree/main/cmd/websocketsource) | N/A | Knative | Opens a WebSocket to the specified source and packages each received message as a Knative event. | ## Third-Party Sources diff --git a/docs/eventing/sources/apache-camel-source/README.md b/docs/developer/eventing/sources/apache-camel-source/README.md similarity index 100% rename from docs/eventing/sources/apache-camel-source/README.md rename to docs/developer/eventing/sources/apache-camel-source/README.md diff --git a/docs/eventing/sources/cloud-audit-logs-source/README.md b/docs/developer/eventing/sources/cloud-audit-logs-source/README.md similarity index 100% rename from docs/eventing/sources/cloud-audit-logs-source/README.md rename to docs/developer/eventing/sources/cloud-audit-logs-source/README.md diff --git a/docs/eventing/sources/cloud-pubsub-source/README.md b/docs/developer/eventing/sources/cloud-pubsub-source/README.md similarity index 100% rename from docs/eventing/sources/cloud-pubsub-source/README.md rename to docs/developer/eventing/sources/cloud-pubsub-source/README.md diff --git a/docs/eventing/sources/cloud-scheduler-source/README.md b/docs/developer/eventing/sources/cloud-scheduler-source/README.md similarity index 100% rename from docs/eventing/sources/cloud-scheduler-source/README.md rename to docs/developer/eventing/sources/cloud-scheduler-source/README.md diff --git a/docs/eventing/sources/cloud-storage-source/README.md b/docs/developer/eventing/sources/cloud-storage-source/README.md similarity index 100% rename from docs/eventing/sources/cloud-storage-source/README.md rename to docs/developer/eventing/sources/cloud-storage-source/README.md diff --git a/docs/eventing/sources/container-source/README.md b/docs/developer/eventing/sources/container-source/README.md similarity index 100% rename from docs/eventing/sources/container-source/README.md rename to docs/developer/eventing/sources/container-source/README.md diff --git a/docs/eventing/sources/container-source/heartbeats-source.yaml b/docs/developer/eventing/sources/container-source/heartbeats-source.yaml similarity index 100% rename from docs/eventing/sources/container-source/heartbeats-source.yaml rename to docs/developer/eventing/sources/container-source/heartbeats-source.yaml diff --git a/docs/eventing/sources/container-source/service.yaml b/docs/developer/eventing/sources/container-source/service.yaml similarity index 100% rename from docs/eventing/sources/container-source/service.yaml rename to docs/developer/eventing/sources/container-source/service.yaml diff --git a/docs/eventing/sources/creating-event-sources/README.md b/docs/developer/eventing/sources/creating-event-sources/README.md similarity index 100% rename from docs/eventing/sources/creating-event-sources/README.md rename to docs/developer/eventing/sources/creating-event-sources/README.md diff --git a/docs/eventing/sources/creating-event-sources/writing-event-source-easy-way/Dockerfile b/docs/developer/eventing/sources/creating-event-sources/writing-event-source-easy-way/Dockerfile similarity index 100% rename from docs/eventing/sources/creating-event-sources/writing-event-source-easy-way/Dockerfile rename to docs/developer/eventing/sources/creating-event-sources/writing-event-source-easy-way/Dockerfile diff --git a/docs/eventing/sources/creating-event-sources/writing-event-source-easy-way/README.md b/docs/developer/eventing/sources/creating-event-sources/writing-event-source-easy-way/README.md similarity index 100% rename from docs/eventing/sources/creating-event-sources/writing-event-source-easy-way/README.md rename to docs/developer/eventing/sources/creating-event-sources/writing-event-source-easy-way/README.md diff --git a/docs/eventing/sources/creating-event-sources/writing-event-source-easy-way/index.js b/docs/developer/eventing/sources/creating-event-sources/writing-event-source-easy-way/index.js similarity index 100% rename from docs/eventing/sources/creating-event-sources/writing-event-source-easy-way/index.js rename to docs/developer/eventing/sources/creating-event-sources/writing-event-source-easy-way/index.js diff --git a/docs/eventing/sources/creating-event-sources/writing-event-source-easy-way/package.json b/docs/developer/eventing/sources/creating-event-sources/writing-event-source-easy-way/package.json similarity index 100% rename from docs/eventing/sources/creating-event-sources/writing-event-source-easy-way/package.json rename to docs/developer/eventing/sources/creating-event-sources/writing-event-source-easy-way/package.json diff --git a/docs/eventing/sources/creating-event-sources/writing-event-source/01-theory.md b/docs/developer/eventing/sources/creating-event-sources/writing-event-source/01-theory.md similarity index 100% rename from docs/eventing/sources/creating-event-sources/writing-event-source/01-theory.md rename to docs/developer/eventing/sources/creating-event-sources/writing-event-source/01-theory.md diff --git a/docs/eventing/sources/creating-event-sources/writing-event-source/02-lifecycle-and-types.md b/docs/developer/eventing/sources/creating-event-sources/writing-event-source/02-lifecycle-and-types.md similarity index 100% rename from docs/eventing/sources/creating-event-sources/writing-event-source/02-lifecycle-and-types.md rename to docs/developer/eventing/sources/creating-event-sources/writing-event-source/02-lifecycle-and-types.md diff --git a/docs/eventing/sources/creating-event-sources/writing-event-source/03-controller.md b/docs/developer/eventing/sources/creating-event-sources/writing-event-source/03-controller.md similarity index 100% rename from docs/eventing/sources/creating-event-sources/writing-event-source/03-controller.md rename to docs/developer/eventing/sources/creating-event-sources/writing-event-source/03-controller.md diff --git a/docs/eventing/sources/creating-event-sources/writing-event-source/04-reconciler.md b/docs/developer/eventing/sources/creating-event-sources/writing-event-source/04-reconciler.md similarity index 100% rename from docs/eventing/sources/creating-event-sources/writing-event-source/04-reconciler.md rename to docs/developer/eventing/sources/creating-event-sources/writing-event-source/04-reconciler.md diff --git a/docs/eventing/sources/creating-event-sources/writing-event-source/05-receive-adapter.md b/docs/developer/eventing/sources/creating-event-sources/writing-event-source/05-receive-adapter.md similarity index 100% rename from docs/eventing/sources/creating-event-sources/writing-event-source/05-receive-adapter.md rename to docs/developer/eventing/sources/creating-event-sources/writing-event-source/05-receive-adapter.md diff --git a/docs/eventing/sources/creating-event-sources/writing-event-source/06-yaml.md b/docs/developer/eventing/sources/creating-event-sources/writing-event-source/06-yaml.md similarity index 100% rename from docs/eventing/sources/creating-event-sources/writing-event-source/06-yaml.md rename to docs/developer/eventing/sources/creating-event-sources/writing-event-source/06-yaml.md diff --git a/docs/eventing/sources/creating-event-sources/writing-event-source/07-knative-sandbox.md b/docs/developer/eventing/sources/creating-event-sources/writing-event-source/07-knative-sandbox.md similarity index 100% rename from docs/eventing/sources/creating-event-sources/writing-event-source/07-knative-sandbox.md rename to docs/developer/eventing/sources/creating-event-sources/writing-event-source/07-knative-sandbox.md diff --git a/docs/eventing/sources/creating-event-sources/writing-event-source/README.md b/docs/developer/eventing/sources/creating-event-sources/writing-event-source/README.md similarity index 100% rename from docs/eventing/sources/creating-event-sources/writing-event-source/README.md rename to docs/developer/eventing/sources/creating-event-sources/writing-event-source/README.md diff --git a/docs/eventing/sources/creating-event-sources/writing-event-source/simplified-controller.png b/docs/developer/eventing/sources/creating-event-sources/writing-event-source/simplified-controller.png similarity index 100% rename from docs/eventing/sources/creating-event-sources/writing-event-source/simplified-controller.png rename to docs/developer/eventing/sources/creating-event-sources/writing-event-source/simplified-controller.png diff --git a/docs/eventing/sources/github-source/README.md b/docs/developer/eventing/sources/github-source/README.md similarity index 100% rename from docs/eventing/sources/github-source/README.md rename to docs/developer/eventing/sources/github-source/README.md diff --git a/docs/eventing/sources/github-source/github-source.yaml b/docs/developer/eventing/sources/github-source/github-source.yaml similarity index 100% rename from docs/eventing/sources/github-source/github-source.yaml rename to docs/developer/eventing/sources/github-source/github-source.yaml diff --git a/docs/eventing/sources/github-source/githubsecret.yaml b/docs/developer/eventing/sources/github-source/githubsecret.yaml similarity index 100% rename from docs/eventing/sources/github-source/githubsecret.yaml rename to docs/developer/eventing/sources/github-source/githubsecret.yaml diff --git a/docs/eventing/sources/github-source/personal_access_token.png b/docs/developer/eventing/sources/github-source/personal_access_token.png similarity index 100% rename from docs/eventing/sources/github-source/personal_access_token.png rename to docs/developer/eventing/sources/github-source/personal_access_token.png diff --git a/docs/eventing/sources/github-source/service.yaml b/docs/developer/eventing/sources/github-source/service.yaml similarity index 100% rename from docs/eventing/sources/github-source/service.yaml rename to docs/developer/eventing/sources/github-source/service.yaml diff --git a/docs/eventing/sources/github-source/webhook_created.png b/docs/developer/eventing/sources/github-source/webhook_created.png similarity index 100% rename from docs/eventing/sources/github-source/webhook_created.png rename to docs/developer/eventing/sources/github-source/webhook_created.png diff --git a/docs/eventing/sources/gitlab-source/README.md b/docs/developer/eventing/sources/gitlab-source/README.md similarity index 100% rename from docs/eventing/sources/gitlab-source/README.md rename to docs/developer/eventing/sources/gitlab-source/README.md diff --git a/docs/eventing/sources/kafka-source/README.md b/docs/developer/eventing/sources/kafka-source/README.md similarity index 100% rename from docs/eventing/sources/kafka-source/README.md rename to docs/developer/eventing/sources/kafka-source/README.md diff --git a/docs/eventing/sources/kafka-source/event-display.yaml b/docs/developer/eventing/sources/kafka-source/event-display.yaml similarity index 100% rename from docs/eventing/sources/kafka-source/event-display.yaml rename to docs/developer/eventing/sources/kafka-source/event-display.yaml diff --git a/docs/eventing/sources/kafka-source/event-source.yaml b/docs/developer/eventing/sources/kafka-source/event-source.yaml similarity index 100% rename from docs/eventing/sources/kafka-source/event-source.yaml rename to docs/developer/eventing/sources/kafka-source/event-source.yaml diff --git a/docs/eventing/sources/kafka-source/kafka-topic.yaml b/docs/developer/eventing/sources/kafka-source/kafka-topic.yaml similarity index 100% rename from docs/eventing/sources/kafka-source/kafka-topic.yaml rename to docs/developer/eventing/sources/kafka-source/kafka-topic.yaml diff --git a/docs/eventing/sources/ping-source/README.md b/docs/developer/eventing/sources/ping-source/README.md similarity index 100% rename from docs/eventing/sources/ping-source/README.md rename to docs/developer/eventing/sources/ping-source/README.md diff --git a/docs/eventing/sources/ping-source/ping-source-binary.yaml b/docs/developer/eventing/sources/ping-source/ping-source-binary.yaml similarity index 100% rename from docs/eventing/sources/ping-source/ping-source-binary.yaml rename to docs/developer/eventing/sources/ping-source/ping-source-binary.yaml diff --git a/docs/eventing/sources/ping-source/ping-source.yaml b/docs/developer/eventing/sources/ping-source/ping-source.yaml similarity index 100% rename from docs/eventing/sources/ping-source/ping-source.yaml rename to docs/developer/eventing/sources/ping-source/ping-source.yaml diff --git a/docs/eventing/sources/ping-source/service.yaml b/docs/developer/eventing/sources/ping-source/service.yaml similarity index 100% rename from docs/eventing/sources/ping-source/service.yaml rename to docs/developer/eventing/sources/ping-source/service.yaml diff --git a/docs/eventing/sources/sinkbinding/README.md b/docs/developer/eventing/sources/sinkbinding/README.md similarity index 100% rename from docs/eventing/sources/sinkbinding/README.md rename to docs/developer/eventing/sources/sinkbinding/README.md diff --git a/docs/eventing/sources/sinkbinding/getting-started.md b/docs/developer/eventing/sources/sinkbinding/getting-started.md similarity index 100% rename from docs/eventing/sources/sinkbinding/getting-started.md rename to docs/developer/eventing/sources/sinkbinding/getting-started.md diff --git a/docs/eventing/sources/sinkbinding/reference.md b/docs/developer/eventing/sources/sinkbinding/reference.md similarity index 100% rename from docs/eventing/sources/sinkbinding/reference.md rename to docs/developer/eventing/sources/sinkbinding/reference.md diff --git a/docs/eventing/sources/containersource/README.md b/docs/eventing/sources/containersource/README.md deleted file mode 100644 index 8769a595b7b..00000000000 --- a/docs/eventing/sources/containersource/README.md +++ /dev/null @@ -1,224 +0,0 @@ -# Creating a ContainerSource object - -![API version v1](https://img.shields.io/badge/API_Version-v1-red?style=flat-square) - -This topic describes how to configure ContainerSource as an event source for -functions. - -The ContainerSource object starts a container image that generates events and -sends messages to a sink URI. You can also use ContainerSource to support your -own event sources in Knative. - -In the examples below, the event source is a heartbeats container and the sink -is a Knative Service. -If you have an existing event source and sink, you can replace the examples with -your own values. - -## Before you begin - -Before you can create a ContainerSource object: - -- You must have [Knative Eventing](../../../admin/install/install-eventing-with-yaml) -installed on your cluster. -- If you want to use the example heartbeats event source below, you must also: - - Install [ko](https://github.com/google/ko) - - Set `KO_DOCKER_REPO`. For example, `gcr.io/[gcloud-project]` or `docker.io/` - - Authenticate with your `KO_DOCKER_REPO` - - Install [`docker`](https://docs.docker.com/install/) - -## Create a ContainerSource object - -1. Build an image of your event source and publish it to your image repository. -Your image must read the environment variable `K_SINK` and post messages to the -URL specified in `K_SINK`. If you do not already have an image, you can use -the following example heartbeats event source by running the commands: - - ```bash - git clone -b "{{ branch }}" https://github.com/knative/eventing.git - ``` - - ```bash - ko publish ko://knative.dev/eventing/cmd/heartbeats - ``` - -1. Create a namespace for your ContainerSource by running the command: - - ```bash - kubectl create namespace - ``` - - Where `` is the namespace that you want your ContainerSource to use. - For example, `containersource-example`. - -1. Create a sink. If you do not already have a sink, you can use the following Knative -Service, which dumps incoming messages into its log, by running the command: - - !!! note - To create a Knative service you must have Knative Serving installed on your cluster. - - === "kn" - - ```bash - kn service create event-display --port 8080 --image gcr.io/knative-releases/knative.dev/eventing/cmd/event_display - ``` - - === "YAML" - - ```yaml - kubectl -n containersource-example apply -f - < --image --sink - ``` - Where: - - - `` is the name you want for your ContainerSource object, - for example, `test-heartbeats`. - - `` corresponds to the image URI you built and published - in step 1, for example, `gcr.io/[gcloud-project]/knative.dev/eventing/cmd/heartbeats`. - - `` is the name of your sink, for example ``. - - For a list of available options, see the [Knative client documentation](https://github.com/knative/client/blob/main/docs/cmd/kn_source_container_create.md#kn-source-container-create). - - === "YAML" - - ```yaml - kubectl -n apply -f - < - spec: - template: - spec: - containers: - - image: - name: - env: - - name: POD_NAME - value: "" - - name: POD_NAMESPACE - value: "" - sink: - ref: - apiVersion: v1 - kind: Service - name: - EOF - ``` - Where: - - - `` is the namespace you created for your ContainerSource, - for example, `containersource-example`. - - `` is the name you want for your ContainerSource, - for example, `test-heartbeats`. - - `` corresponds to the image URI you built and published - in step 1, for example, `gcr.io/[gcloud-project]/knative.dev/eventing/cmd/heartbeats`. - - `` is the name of your event source, for example, `heartbeats`. - - `` is the name of the Pod that the container runs in, for example, `mypod`. - - `` is the namespace that the Pod runs in, for example, `event-test`. - - `` is the name of your sink, for example, `event-display`. - - For more information about the fields you can configure for the ContainerSource - object, see [ContainerSource Reference](reference.md). - - !!! note - Arguments and environment variables are set and are passed to the container. - -## Verify the ContainerSource object - -1. View the logs for your event consumer by running the command: - - ```shell - kubectl -n logs -l --tail=200 - ``` - Where: - - - `` is the namespace that contains the ContainerSource object. - - `` is the name of the Pod that the container runs in. - - For example: - - ```shell - $ kubectl -n containersource-example logs -l app=event-display --tail=200 - ``` - -1. Verify that the output returns the properties of the events that your -ContainerSource sent to your sink. -In the example below, the command has returned the `Attributes` and `Data` properties -of the events that the ContainerSource sent to the `event-display` Service: - - ``` - ☁️ cloudevents.Event - Validation: valid - Context Attributes, - specversion: 1.0 - type: dev.knative.eventing.samples.heartbeat - source: https://knative.dev/eventing/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": "" - } - ``` - -## Cleanup - -To delete the ContainerSource object and all of the related resources in the -namespace: - -- Delete the namespace by running the command: - - ```shell - kubectl delete namespace - ``` - - Where `` is the namespace that contains the ContainerSource object. - -## Reference Documentation - -See the [ContainerSource specification](../../../reference/api/eventing/eventing/#sources.knative.dev/v1.ContainerSource). diff --git a/docs/eventing/sources/containersource/reference.md b/docs/eventing/sources/containersource/reference.md deleted file mode 100644 index 23a8c5d5ab3..00000000000 --- a/docs/eventing/sources/containersource/reference.md +++ /dev/null @@ -1,149 +0,0 @@ -# ContainerSource reference - -This topic provides reference information about the configurable fields for the -ContainerSource object. - - -## ContainerSource - -A ContainerSource definition supports the following fields: - -| Field | Description | Required or optional | -|-------|-------------|----------------------| -| [`apiVersion`][kubernetes-overview] | Specifies the API version, for example `sources.knative.dev/v1`. | Required | -| [`kind`][kubernetes-overview] | Identifies this resource object as a ContainerSource object. | Required | -| [`metadata`][kubernetes-overview] | Specifies metadata that uniquely identifies the ContainerSource object. For example, a `name`. | Required | -| [`spec`][kubernetes-overview] | Specifies the configuration information for this ContainerSource object. | Required | -| [`spec.sink`](#sink-parameter) | A reference to an object that resolves to a URI to use as the sink. | Required | -| [`spec.template`](#template-parameter) | A `template` in the shape of `Deployment.spec.template` to be used for this ContainerSource. | Required | -| [`spec.ceOverrides`](#cloudevent-overrides) | Defines overrides to control the output format and modifications to the event sent to the sink. | Optional | - - -### Sink parameter - -The `sink` parameter is a reference to an object that resolves to a URI to use as the sink. - -A `sink` definition supports the following fields: - -| Field | Description | Required or optional | -|-------|-------------|----------------------| -| `ref` | This points to an Addressable. | Required if _not_ using `uri` | -| `ref.apiVersion` | API version of the referent. | Required if using `ref` | -| [`ref.kind`][kubernetes-kinds] | Kind of the referent. | Required if using `ref` | -| [`ref.name`][kubernetes-names] | Name of the referent. | Required if using `ref` | -| [`ref.namespace`][kubernetes-namespaces] | Namespace of the referent. If omitted this defaults to the object holding it. | Optional | -| `uri` | This can be an absolute URL with a non-empty scheme and non-empty host that points to the target or a relative URI. Relative URIs are resolved using the base URI retrieved from Ref. | Required if _not_ using `ref` | - -!!! note - At least one of `ref` or `uri` is required. If both are specified, `uri` is - resolved into the URL from the Addressable `ref` result. - -#### Example: sink parameter - -Given the following YAML, if `ref` resolves into -`"http://mysink.default.svc.cluster.local"`, then `uri` is added to this -resulting in `"http://mysink.default.svc.cluster.local/extra/path"`. - - - -```yaml -apiVersion: sources.knative.dev/v1 -kind: ContainerSource -metadata: - name: test-heartbeats -spec: - ... - sink: - ref: - apiVersion: v1 - kind: Service - namespace: default - name: mysink - uri: /extra/path -``` - -!!! contract - This results in the `K_SINK` environment variable being set as - `"http://mysink.default.svc.cluster.local/extra/path"`. - - -### Template parameter - -This is a `template` in the shape of `Deployment.spec.template` to use for the ContainerSource. -For more information, see the [Kubernetes Documentation](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/). - - - -#### Example: template parameter - -```yaml -apiVersion: sources.knative.dev/v1 -kind: ContainerSource -metadata: - name: test-heartbeats -spec: - template: - spec: - containers: - - image: gcr.io/[gcloud-project]/knative.dev/eventing/cmd/heartbeats - name: heartbeats - args: - - --period=1 - env: - - name: POD_NAME - value: "mypod" - - name: POD_NAMESPACE - value: "event-test" - ... -``` - - -### CloudEvent Overrides - -CloudEvent Overrides defines overrides to control the output format and -modifications of the event sent to the sink. - -A `ceOverrides` definition supports the following fields: - -| Field | Description | Required or optional | -|-------|-------------|----------------------| -| `extensions` | Specifies which attributes are added or overridden on the outbound event. Each `extensions` key-value pair is set independently on the event as an attribute extension. | Optional | - -!!! note - Only valid [CloudEvent attribute names][cloudevents-attribute-naming] - are allowed as extensions. You cannot set the spec defined attributes from - the extensions override configuration. For example, you can not modify the - `type` attribute. - -#### Example: CloudEvent Overrides - -```yaml -apiVersion: sources.knative.dev/v1 -kind: ContainerSource -metadata: - name: test-heartbeats -spec: - ... - ceOverrides: - extensions: - extra: this is an extra attribute - additional: 42 -``` - -!!! contract - This results in the `K_CE_OVERRIDES` environment variable being set on the - `subject` as follows: - ```{ .json .no-copy } - { "extensions": { "extra": "this is an extra attribute", "additional": "42" } } - ``` - -[kubernetes-overview]: - https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/#required-fields -[kubernetes-kinds]: - https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds -[kubernetes-names]: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names -[kubernetes-namespaces]: - https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ -[cloudevents-attribute-naming]: - https://github.com/cloudevents/spec/blob/v1.0.1/spec.md#attribute-naming-convention From 63c783e901a84098804f3f2d4046b59a395c95ca Mon Sep 17 00:00:00 2001 From: Samia Nneji Date: Tue, 6 Jul 2021 12:09:21 +0100 Subject: [PATCH 05/12] Move event samples to samples folder --- config/nav.yml | 14 +- docs/developer/eventing/sources/README.md | 25 +-- .../sources/cloud-audit-logs-source/README.md | 10 - .../sources/cloud-pubsub-source/README.md | 12 -- .../sources/cloud-scheduler-source/README.md | 10 - .../sources/cloud-storage-source/README.md | 10 - .../sources/container-source/README.md | 180 ---------------- .../container-source/heartbeats-source.yaml | 24 --- .../sources/container-source/service.yaml | 23 --- .../eventing/sources/github-source/README.md | 186 ----------------- .../sources/github-source/github-source.yaml | 23 --- .../sources/github-source/githubsecret.yaml | 8 - .../sources/github-source/service.yaml | 10 - .../eventing/sources/gitlab-source/README.md | 195 ------------------ 14 files changed, 17 insertions(+), 713 deletions(-) delete mode 100644 docs/developer/eventing/sources/cloud-audit-logs-source/README.md delete mode 100644 docs/developer/eventing/sources/cloud-pubsub-source/README.md delete mode 100644 docs/developer/eventing/sources/cloud-scheduler-source/README.md delete mode 100644 docs/developer/eventing/sources/cloud-storage-source/README.md delete mode 100644 docs/developer/eventing/sources/container-source/README.md delete mode 100644 docs/developer/eventing/sources/container-source/heartbeats-source.yaml delete mode 100644 docs/developer/eventing/sources/container-source/service.yaml delete mode 100644 docs/developer/eventing/sources/github-source/README.md delete mode 100644 docs/developer/eventing/sources/github-source/github-source.yaml delete mode 100644 docs/developer/eventing/sources/github-source/githubsecret.yaml delete mode 100644 docs/developer/eventing/sources/github-source/service.yaml delete mode 100644 docs/developer/eventing/sources/gitlab-source/README.md diff --git a/config/nav.yml b/config/nav.yml index 2656e40a8a3..92b6835c407 100644 --- a/config/nav.yml +++ b/config/nav.yml @@ -206,7 +206,7 @@ nav: - Experimental Features: eventing/experimental-features.md - Code samples: - Overview: eventing/samples/README.md - - Container source: eventing/sources/container-source/README.md + - Container source: eventing/samples/container-source/README.md - Hello World: - Overview: eventing/samples/helloworld/README.md - GO: eventing/samples/helloworld/helloworld-go/README.md @@ -219,12 +219,12 @@ nav: - Overview: eventing/samples/parallel/README.md - Multiple Cases: eventing/samples/parallel/multiple-branches/README.md - Mutual Exclusivity: eventing/samples/parallel/mutual-exclusivity/README.md - - CloudAuditLogsSource: eventing/sources/cloud-audit-logs-source/README.md - - CloudPubSubSource: eventing/sources/cloud-pubsub-source/README.md - - CloudSchedulerSource: eventing/sources/cloud-scheduler-source/README.md - - CloudStorageSource: eventing/sources/cloud-storage-source/README.md - - GitHub source: eventing/sources/github-source/README.md - - GitLab source: eventing/sources/gitlab-source/README.md + - CloudAuditLogsSource: eventing/samples/cloud-audit-logs-source/README.md + - CloudPubSubSource: eventing/samples/cloud-pubsub-source/README.md + - CloudSchedulerSource: eventing/samples/cloud-scheduler-source/README.md + - CloudStorageSource: eventing/samples/cloud-storage-source/README.md + - GitHub source: eventing/samples/github-source/README.md + - GitLab source: eventing/samples/gitlab-source/README.md - IoT core: eventing/samples/iot-core/README.md # Reference docs - Reference: diff --git a/docs/developer/eventing/sources/README.md b/docs/developer/eventing/sources/README.md index 029528492ca..56b4ce5aa7d 100644 --- a/docs/developer/eventing/sources/README.md +++ b/docs/developer/eventing/sources/README.md @@ -28,11 +28,6 @@ All Sources are part of the `sources` category. kubectl get sources ``` - - - - - ## Knative Sources | Name | API Version | Maintainer | Description | @@ -41,12 +36,12 @@ All Sources are part of the `sources` category. | [AWS SQS](https://github.com/knative-sandbox/eventing-awssqs/tree/main/samples) | v1alpha1 | Knative | Brings [AWS Simple Queue Service](https://aws.amazon.com/sqs/) messages into Knative. The AwsSqsSource fires a new event each time an event is published on an [AWS SQS topic](https://aws.amazon.com/sqs/). | | [Apache Camel](./apache-camel-source/README.md) | N/A | Apache Software Foundation | Enables use of [Apache Camel](https://github.com/apache/camel) components for pushing events into Knative. Camel sources are now provided via [Kamelets](https://camel.apache.org/camel-kamelets/latest/) as part of the [Apache Camel K](https://camel.apache.org/camel-k/latest/installation/installation.html) project. | | [Apache CouchDB](https://github.com/knative-sandbox/eventing-couchdb/blob/main/source) | v1alpha1 | Knative | Brings [Apache CouchDB](https://couchdb.apache.org/) messages into Knative. | -| [Apache Kafka](../../../eventing/samples/kafka/) | v1beta1 | Knative | Brings [Apache Kafka](https://kafka.apache.org/) 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](https://github.com/knative-sandbox/eventing-kafka/blob/main/pkg/source) example for more details. | -| [Container Source](./containersource/README.md) | v1 | Knative | 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](./container-source/README.md) example for more details. | -| [GitHub](./github-source) | v1alpha1 | Knative | 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](https://developer.github.com/v3/activity/events/types/). See the [GitHub Source](./github-source/README.md) example for more details. | -| [GitLab](./gitlab-source/README.md) | v1alpha1 | Knative | 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](https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#events), listens for incoming events, and passes them to a consumer. See the [GitLab Source](./gitlab-source/README.md) example for more details. | +| [Apache Kafka](../../../eventing/samples/kafka/README.md) | v1beta1 | Knative | Brings [Apache Kafka](https://kafka.apache.org/) 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](https://github.com/knative-sandbox/eventing-kafka/blob/main/pkg/source) example for more details. | +| [ContainerSource](./containersource/README.md) | v1 | Knative | 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](../../../eventing/samples/container-source/README.md) example for more details. | +| [GitHub](../../../eventing/samples/github-source/README.md) | v1alpha1 | Knative | 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](https://developer.github.com/v3/activity/events/types/). See the [GitHub Source](../../../eventing/samples/github-source/README.md) example for more details. | +| [GitLab](../../../eventing/samples/gitlab-source/README.md) | v1alpha1 | Knative | 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](https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#events), listens for incoming events, and passes them to a consumer. See the [GitLab Source](../../../eventing/samples/gitlab-source/README.md) example for more details. | | [Heartbeats](https://github.com/knative/eventing/tree/main/cmd/heartbeats) | N/A | Knative | Uses an in-memory timer to produce events at the specified interval. | -| [PingSource](./ping-source/README.md) | v1beta2 | Knative | Produces events with a fixed payload on a specified [Cron](https://en.wikipedia.org/wiki/Cron) schedule. See the [Ping Source](./ping-source) example for more details. | +| [PingSource](./ping-source/README.md) | v1beta2 | Knative | Produces events with a fixed payload on a specified [Cron](https://en.wikipedia.org/wiki/Cron) schedule. See the [Ping Source](./ping-source/README.md) example for more details. | | [RabbitMQ](https://github.com/knative-sandbox/eventing-rabbitmq) | Active development | None | Brings [RabbitMQ](https://www.rabbitmq.com/) messages into Knative. | [SinkBinding](./sinkbinding/README.md) | v1 | Knative | 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](./sinkbinding/README.md) example for more details. | | [WebSocket](https://github.com/knative/eventing/tree/main/cmd/websocketsource) | N/A | Knative | Opens a WebSocket to the specified source and packages each received message as a Knative event. | @@ -66,10 +61,10 @@ All Sources are part of the `sources` category. [Amazon SNS](https://github.com/triggermesh/aws-event-sources/tree/master/cmd/awssnssource/README.md) | Supported | TriggerMesh | Subscribes to messages from an [Amazon SNS](https://aws.amazon.com/sns/) topic. [Amazon SQS](https://github.com/triggermesh/aws-event-sources/tree/master/cmd/awssqssource/README.md) | Supported | TriggerMesh | Consumes messages from an [Amazon SQS](https://aws.amazon.com/sqs/) queue. [BitBucket](https://github.com/nachocano/bitbucket-source) | Proof of Concept | None | Registers for events of the specified types on the specified BitBucket organization/repository. Brings those events into Knative. -[CloudAuditLogsSource](https://github.com/google/knative-gcp/blob/main/docs/examples/cloudauditlogssource/README.md) | v1 | Google | Registers for events of the specified types on the specified [Google Cloud Audit Logs](https://cloud.google.com/logging/docs/audit/). Brings those events into Knative. Refer to the [CloudAuditLogsSource](./cloud-audit-logs-source) example for more details. -[CloudPubSubSource](https://github.com/google/knative-gcp/blob/main/docs/examples/cloudpubsubsource/README.md) | v1 | Google | Brings [Cloud Pub/Sub](https://cloud.google.com/pubsub/) messages into Knative. The CloudPubSubSource fires a new event each time a message is published on a [Google Cloud Platform PubSub topic](https://cloud.google.com/pubsub/). See the [CloudPubSubSource](./cloud-pubsub-source) example for more details. -[CloudSchedulerSource](https://github.com/google/knative-gcp/blob/main/docs/examples/cloudschedulersource/README.md) | v1 | Google | Create, update, and delete [Google Cloud Scheduler](https://cloud.google.com/scheduler/) Jobs. When those jobs are triggered, receive the event inside Knative. See the [CloudSchedulerSource](./cloud-scheduler-source) example for further details. -[CloudStorageSource](https://github.com/google/knative-gcp/blob/main/docs/examples/cloudstoragesource/README.md) | v1 | Google | Registers for events of the specified types on the specified [Google Cloud Storage](https://cloud.google.com/storage/) bucket and optional object prefix. Brings those events into Knative. See the [CloudStorageSource](./cloud-storage-source) example. +[CloudAuditLogsSource](https://github.com/google/knative-gcp/blob/main/docs/examples/cloudauditlogssource/README.md) | v1 | Google | Registers for events of the specified types on the specified [Google Cloud Audit Logs](https://cloud.google.com/logging/docs/audit/). Brings those events into Knative. Refer to the [CloudAuditLogsSource](../../../eventing/samples/cloud-audit-logs-source/README.md) example for more details. +[CloudPubSubSource](https://github.com/google/knative-gcp/blob/main/docs/examples/cloudpubsubsource/README.md) | v1 | Google | Brings [Cloud Pub/Sub](https://cloud.google.com/pubsub/) messages into Knative. The CloudPubSubSource fires a new event each time a message is published on a [Google Cloud Platform PubSub topic](https://cloud.google.com/pubsub/). See the [CloudPubSubSource](../../../eventing/samples/cloud-pubsub-source/README.md) example for more details. +[CloudSchedulerSource](https://github.com/google/knative-gcp/blob/main/docs/examples/cloudschedulersource/README.md) | v1 | Google | Create, update, and delete [Google Cloud Scheduler](https://cloud.google.com/scheduler/) Jobs. When those jobs are triggered, receive the event inside Knative. See the [CloudSchedulerSource](../../../eventing/samples/cloud-scheduler-source/README.md) example for further details. +[CloudStorageSource](https://github.com/google/knative-gcp/blob/main/docs/examples/cloudstoragesource/README.md) | v1 | Google | Registers for events of the specified types on the specified [Google Cloud Storage](https://cloud.google.com/storage/) bucket and optional object prefix. Brings those events into Knative. See the [CloudStorageSource](../../../eventing/samples/cloud-storage-source/README.md) example. [DockerHubSource](https://github.com/tom24d/eventing-dockerhub) | v1alpha1 | None | Retrieves events from [Docker Hub Webhooks](https://docs.docker.com/docker-hub/webhooks/) and transforms them into CloudEvents for consumption in Knative. [FTP / SFTP](https://github.com/vaikas-google/ftp) | Proof of concept | None | Watches for files being uploaded into a FTP/SFTP and generates events for those. [GitHub Issue Comments](https://github.com/BrianMMcClain/github-issue-comment-source)| Proof of Concept | None | Polls a specific GitHub issue for new comments. @@ -83,6 +78,6 @@ All Sources are part of the `sources` category. ## Additional resources -- For information about creating your own Source type, see the [tutorial on writing a Source with a Receive Adapter](./creating-event-sources/writing-event-source). +- For information about creating your own Source type, see the [tutorial on writing a Source with a Receive Adapter](./creating-event-sources/writing-event-source/README.md). - If your code needs to send events as part of its business logic and doesn't fit the model of a Source, consider [feeding events directly to a Broker](https://knative.dev/docs/eventing/broker/). - For more information about using `kn` Source related commands, see the [`kn source` reference documentation](https://github.com/knative/client/blob/main/docs/cmd/kn_source.md). diff --git a/docs/developer/eventing/sources/cloud-audit-logs-source/README.md b/docs/developer/eventing/sources/cloud-audit-logs-source/README.md deleted file mode 100644 index 50169e82369..00000000000 --- a/docs/developer/eventing/sources/cloud-audit-logs-source/README.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "CloudAuditLogsSource" -linkTitle: "CloudAuditLogsSource" -weight: 20 -type: "docs" ---- - -# CloudAuditLogsSource - -Please refer to the [example](https://github.com/google/knative-gcp/blob/master/docs/examples/cloudauditlogssource/README.md) in knative-gcp. diff --git a/docs/developer/eventing/sources/cloud-pubsub-source/README.md b/docs/developer/eventing/sources/cloud-pubsub-source/README.md deleted file mode 100644 index acea30aea01..00000000000 --- a/docs/developer/eventing/sources/cloud-pubsub-source/README.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "CloudPubSubSource" -linkTitle: "CloudPubSubSource" -weight: 20 -type: "docs" -aliases: - - /docs/eventing/samples/gcp-pubsub-source/README.md ---- - -# CloudPubSubSource - -Please refer to the [example](https://github.com/google/knative-gcp/blob/master/docs/examples/cloudpubsubsource/README.md) in knative-gcp. diff --git a/docs/developer/eventing/sources/cloud-scheduler-source/README.md b/docs/developer/eventing/sources/cloud-scheduler-source/README.md deleted file mode 100644 index 33178a45823..00000000000 --- a/docs/developer/eventing/sources/cloud-scheduler-source/README.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "CloudSchedulerSource" -linkTitle: "CloudSchedulerSource" -weight: 20 -type: "docs" ---- - -# CloudSchedulerSource - -Please refer to the [example](https://github.com/google/knative-gcp/blob/master/docs/examples/cloudschedulersource/README.md) in knative-gcp. diff --git a/docs/developer/eventing/sources/cloud-storage-source/README.md b/docs/developer/eventing/sources/cloud-storage-source/README.md deleted file mode 100644 index 2a66861f74a..00000000000 --- a/docs/developer/eventing/sources/cloud-storage-source/README.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "CloudStorageSource" -linkTitle: "CloudStorageSource" -weight: 20 -type: "docs" ---- - -# CloudStorageSource - -Please refer to the [example](https://github.com/google/knative-gcp/blob/master/docs/examples/cloudstoragesource/README.md) in knative-gcp. diff --git a/docs/developer/eventing/sources/container-source/README.md b/docs/developer/eventing/sources/container-source/README.md deleted file mode 100644 index f38c89a0fa8..00000000000 --- a/docs/developer/eventing/sources/container-source/README.md +++ /dev/null @@ -1,180 +0,0 @@ ---- -title: "Container Source Example" -linkTitle: "Container source" -weight: 10 -type: "docs" ---- - -# Container Source Example - -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 heartbeats ContainerSource - -### Prerequisites - -1. Setup [Knative Serving](../../../serving). -1. Setup [Knative Eventing and Sources](../../../eventing). - -### Prepare the heartbeats image - -Knative [event-sources](https://github.com/knative/eventing) has a -sample of heartbeats event source. You could clone the source code by - -``` -git clone -b "{{ branch }}" https://github.com/knative/eventing.git -``` - -And then build a heartbeats image and publish to your image repo with - -``` -ko publish knative.dev/eventing/cmd/heartbeats -``` - -**Note**: `ko publish` requires: - -- [`KO_DOCKER_REPO`](https://github.com/knative/serving/blob/main/DEVELOPMENT.md#environment-setup) - to be set. (e.g. `gcr.io/[gcloud-project]` or `docker.io/`) -- you to be authenticated with your `KO_DOCKER_REPO` -- [`docker`](https://docs.docker.com/install/) to be installed - -### Create a Knative Service - -In order to verify `ContainerSource` is working, we will create a Event Display -Service that dumps incoming messages to its log. - -```yaml -apiVersion: serving.knative.dev/v1 -kind: Service -metadata: - name: event-display -spec: - template: - spec: - containers: - - image: gcr.io/knative-releases/knative.dev/eventing/cmd/event_display -``` - -Use following command to create the service from `service.yaml`: - -```bash -kubectl apply --filename service.yaml -``` - -The status of the created service can be seen using: - -```bash -kubectl get ksvc - -NAME URL LATESTCREATED LATESTREADY READY REASON -event-display http://event-display.default.1.2.3.4.sslip.io event-display-gqjbw event-display-gqjbw True -``` - -### 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](./heartbeats-source.yaml) -file. Note that arguments and environment variables are set and will be passed -to the container. - -```yaml -apiVersion: sources.knative.dev/v1 -kind: ContainerSource -metadata: - name: test-heartbeats -spec: - template: - spec: - containers: - - image: - name: heartbeats - args: - - --period=1 - env: - - name: POD_NAME - value: "mypod" - - name: POD_NAMESPACE - value: "event-test" - sink: - ref: - apiVersion: serving.knative.dev/v1 - kind: Service - name: event-display -``` - -Use the following command to create the event source from -`heartbeats-source.yaml`: - -```bash -kubectl apply --filename heartbeats-source.yaml -``` - -### Verify - -We will verify that the message was sent to the Knative eventing system by -looking at event-display service logs. - -```bash -kubectl logs -l serving.knative.dev/service=event-display -c user-container --since=10m -``` - -You should see log lines showing the request headers and body of the event -message sent by the heartbeats source to the display function: - -``` -☁️ cloudevents.Event -Validation: valid -Context Attributes, - specversion: 1.0 - type: dev.knative.eventing.samples.heartbeat - source: https://knative.dev/eventing/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": "" - } -``` - -## Create a new event source using ContainerSource - -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](https://github.com/cloudevents/spec/blob/master/spec.md#design-goals) - format is recommended. - -[heartbeats](https://github.com/knative/eventing/blob/main/cmd/heartbeats/main.go) -event source is a sample for your reference. - -### Create the ContainerSource using this container image - -When the container image is ready, a YAML file will be used to create a concrete -`ContainerSource`. Use [heartbeats-source.yaml](./heartbeats-source.yaml) as a -sample for reference. [Learn more about the ContainerSource -specification](../../../eventing#containersource). diff --git a/docs/developer/eventing/sources/container-source/heartbeats-source.yaml b/docs/developer/eventing/sources/container-source/heartbeats-source.yaml deleted file mode 100644 index a9abb2d6174..00000000000 --- a/docs/developer/eventing/sources/container-source/heartbeats-source.yaml +++ /dev/null @@ -1,24 +0,0 @@ -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, - # e.g. gcr.io/[gcloud-project]/knative.dev/eventing/cmd/heartbeats - - image: gcr.io/knative-releases/knative.dev/eventing/cmd/heartbeats - name: heartbeats - args: - - --period=1 - env: - - name: POD_NAME - value: "mypod" - - name: POD_NAMESPACE - value: "event-test" - sink: - ref: - apiVersion: serving.knative.dev/v1 - kind: Service - name: event-display diff --git a/docs/developer/eventing/sources/container-source/service.yaml b/docs/developer/eventing/sources/container-source/service.yaml deleted file mode 100644 index a0246a5940e..00000000000 --- a/docs/developer/eventing/sources/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/cmd/event_display diff --git a/docs/developer/eventing/sources/github-source/README.md b/docs/developer/eventing/sources/github-source/README.md deleted file mode 100644 index 60ab64f541d..00000000000 --- a/docs/developer/eventing/sources/github-source/README.md +++ /dev/null @@ -1,186 +0,0 @@ -# GitHub source - -GitHub Source example shows how to wire GitHub events for consumption -by a Knative Service. - -## Before you begin - -1. Set up [Knative Serving](../../../serving). -1. Ensure Knative Serving is [configured with a domain - name](../../../serving/using-a-custom-domain.md) - that allows GitHub to call into the cluster. -1. You must ensure that your Knative cluster uses a static IP address refer to your provider's documentation. -1. Set up [Knative Eventing](../../../eventing) with the GitHub source. - -### Create a Knative Service - -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. - -```yaml -apiVersion: serving.knative.dev/v1 -kind: Service -metadata: - name: github-message-dumper -spec: - template: - spec: - containers: - - image: gcr.io/knative-releases/knative.dev/eventing/cmd/event_display -``` - -Enter the following command to create the service from `service.yaml`: - -```bash -kubectl --namespace default apply --filename service.yaml -``` - -### Create GitHub Tokens - -Create a [personal access token](https://github.com/settings/tokens) -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: - -![GitHub UI](personal_access_token.png "GitHub personal access token screenshot") - -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: - -```yaml -apiVersion: v1 -kind: Secret -metadata: - name: githubsecret -type: Opaque -stringData: - accessToken: personal_access_token_value - secretToken: asdfasfdsaf -``` - -Hint: you can makeup a random _secretToken_ with: - -```bash -head -c 8 /dev/urandom | base64 -``` - -Then, apply the githubsecret using `kubectl`: - -```bash -kubectl --namespace default apply --filename githubsecret.yaml -``` - -### Create Event Source for GitHub Events - -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](../../README.md#githubsource) - -```yaml -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 -``` - -Then, apply that yaml using `kubectl`: - -```bash -kubectl --namespace default apply --filename github-source.yaml -``` - -### Verify - -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. - -![GitHub Webhook](webhook_created.png "GitHub webhook screenshot") - -### 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. - -```bash -kubectl --namespace default get pods -kubectl --namespace default logs github-event-display-XXXX user-container -``` - -You should log lines similar to: - -``` -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": ...} -``` - -### Cleanup - -You can remove the Github webhook by deleting the Github source: - -```bash -kubectl --namespace default delete --filename github-source.yaml -``` - -Similarly, you can remove the Service and Secret via: - -```bash -kubectl --namespace default delete --filename service.yaml -kubectl --namespace default delete --filename githubsecret.yaml - -``` diff --git a/docs/developer/eventing/sources/github-source/github-source.yaml b/docs/developer/eventing/sources/github-source/github-source.yaml deleted file mode 100644 index 4059b97b483..00000000000 --- a/docs/developer/eventing/sources/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/docs/developer/eventing/sources/github-source/githubsecret.yaml b/docs/developer/eventing/sources/github-source/githubsecret.yaml deleted file mode 100644 index 9d733e4304c..00000000000 --- a/docs/developer/eventing/sources/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/docs/developer/eventing/sources/github-source/service.yaml b/docs/developer/eventing/sources/github-source/service.yaml deleted file mode 100644 index 360c6495524..00000000000 --- a/docs/developer/eventing/sources/github-source/service.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# This is a very simple Knative Service that writes the input request to its log. -apiVersion: serving.knative.dev/v1 -kind: Service -metadata: - name: github-message-dumper -spec: - template: - spec: - containers: - - image: gcr.io/knative-releases/knative.dev/eventing/cmd/event_display diff --git a/docs/developer/eventing/sources/gitlab-source/README.md b/docs/developer/eventing/sources/gitlab-source/README.md deleted file mode 100644 index 98006cf92e8..00000000000 --- a/docs/developer/eventing/sources/gitlab-source/README.md +++ /dev/null @@ -1,195 +0,0 @@ -# GitLab source - -GitLab Source example shows how to wire GitLab events for consumption by a -Knative Service. - -## Gitlab source deployment - -### Prerequisites - -You will need: - -1. An internet-accessible Kubernetes cluster with Knative Serving installed. - Follow the [installation instructions](../../../install/) if you - need to create one. -1. Ensure Knative Serving is - [configured with a domain name](../../../serving/using-a-custom-domain.md) -1. You must ensure that your Knative cluster uses a static IP address refer to your provider's documentation. - that allows GitLab to call into the cluster. -1. Install [Knative Eventing](../../../eventing). - -### Install GitLab Event Source - -GitLab Event source lives in the [knative-sandbox/eventing-gitlab](https://github.com/knative-sandbox/eventing-gitlab). Head to the releases page, find the latest release with `gitlab.yaml` -artifact and replace the `` with version tag: - -```bash -kubectl apply -f https://github.com/knative-sandbox/eventing-gitlab/releases/download//gitlab.yaml -``` - -Check that the manager is running: - -```bash -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. - -```yaml -apiVersion: serving.knative.dev/v1 -kind: Service -metadata: - name: gitlab-event-display -spec: - template: - spec: - containers: - - image: gcr.io/knative-releases/knative.dev/eventing/cmd/event_display -``` - -Create the service: - -```bash -kubectl -n default apply -f event-display.yaml -``` - -### Create GitLab Tokens - -1. Create a - [personal access token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html) - 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. - -1. 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. - - Hint: you can generate a random _secretToken_ with: - - ```bash - head -c 8 /dev/urandom | base64 - ``` - - `secret.yaml`: - - ```yaml - apiVersion: v1 - kind: Secret - metadata: - name: gitlabsecret - type: Opaque - stringData: - accessToken: - secretToken: - ``` - -1. Create the secret using `kubectl`. - - ```bash - kubectl -n default apply -f secret.yaml - ``` - -### Create Event Source for GitLab Events - -1. 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`. - - `gitlabsource.yaml`: - - ```yaml - apiVersion: sources.knative.dev/v1alpha1 - kind: GitLabSource - metadata: - name: gitlabsource-sample - spec: - eventTypes: - - push_events - - issues_events - projectUrl: - accessToken: - secretKeyRef: - name: gitlabsecret - key: accessToken - secretToken: - secretKeyRef: - name: gitlabsecret - key: secretToken - sink: - ref: - apiVersion: serving.knative.dev/v1 - kind: Service - name: gitlab-event-display - ``` - -1. Apply the yaml file using `kubectl`: - - ```bash - kubectl -n default apply -f gitlabsource.yaml - ``` - -### Verify - -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: - -``` -☁️ cloudevents.Event -Validation: valid -Context Attributes, - specversion: 0.3 - type: dev.knative.sources.gitlabsource.Push Hook - source: https://gitlab.com// - id: f83c080f-c2af-48ff-8d8b-fd5b21c5938e - time: 2020-03-12T11:08:41.414572482Z - datacontenttype: application/json -Data, - { - - } -``` - -### Cleanup - -You can remove the GitLab webhook by deleting the GitLab source: - -```bash -kubectl --namespace default delete --filename gitlabsource.yaml -``` - -Similarly, you can remove the Service and Secret via: - -```bash -kubectl --namespace default delete --filename event-display.yaml -kubectl --namespace default delete --filename secret.yaml - -``` From 343fc623499c3f49e171f9f157b3e46dbbfc0393 Mon Sep 17 00:00:00 2001 From: Samia Nneji Date: Tue, 6 Jul 2021 12:14:04 +0100 Subject: [PATCH 06/12] Move event samples to samples folder --- .../samples/cloud-audit-logs-source/README.md | 10 + .../samples/cloud-pubsub-source/README.md | 12 ++ .../samples/cloud-scheduler-source/README.md | 10 + .../samples/cloud-storage-source/README.md | 10 + .../samples/container-source/README.md | 180 ++++++++++++++++ .../container-source/heartbeats-source.yaml | 24 +++ .../samples/container-source/service.yaml | 23 +++ docs/eventing/samples/github-source/README.md | 186 +++++++++++++++++ .../samples/github-source/github-source.yaml | 23 +++ .../samples/github-source/githubsecret.yaml | 8 + .../github-source/personal_access_token.png | Bin .../samples/github-source/service.yaml | 10 + .../github-source/webhook_created.png | Bin docs/eventing/samples/gitlab-source/README.md | 195 ++++++++++++++++++ 14 files changed, 691 insertions(+) create mode 100644 docs/eventing/samples/cloud-audit-logs-source/README.md create mode 100644 docs/eventing/samples/cloud-pubsub-source/README.md create mode 100644 docs/eventing/samples/cloud-scheduler-source/README.md create mode 100644 docs/eventing/samples/cloud-storage-source/README.md create mode 100644 docs/eventing/samples/container-source/README.md create mode 100644 docs/eventing/samples/container-source/heartbeats-source.yaml create mode 100644 docs/eventing/samples/container-source/service.yaml create mode 100644 docs/eventing/samples/github-source/README.md create mode 100644 docs/eventing/samples/github-source/github-source.yaml create mode 100644 docs/eventing/samples/github-source/githubsecret.yaml rename docs/{developer/eventing/sources => eventing/samples}/github-source/personal_access_token.png (100%) create mode 100644 docs/eventing/samples/github-source/service.yaml rename docs/{developer/eventing/sources => eventing/samples}/github-source/webhook_created.png (100%) create mode 100644 docs/eventing/samples/gitlab-source/README.md diff --git a/docs/eventing/samples/cloud-audit-logs-source/README.md b/docs/eventing/samples/cloud-audit-logs-source/README.md new file mode 100644 index 00000000000..50169e82369 --- /dev/null +++ b/docs/eventing/samples/cloud-audit-logs-source/README.md @@ -0,0 +1,10 @@ +--- +title: "CloudAuditLogsSource" +linkTitle: "CloudAuditLogsSource" +weight: 20 +type: "docs" +--- + +# CloudAuditLogsSource + +Please refer to the [example](https://github.com/google/knative-gcp/blob/master/docs/examples/cloudauditlogssource/README.md) in knative-gcp. diff --git a/docs/eventing/samples/cloud-pubsub-source/README.md b/docs/eventing/samples/cloud-pubsub-source/README.md new file mode 100644 index 00000000000..acea30aea01 --- /dev/null +++ b/docs/eventing/samples/cloud-pubsub-source/README.md @@ -0,0 +1,12 @@ +--- +title: "CloudPubSubSource" +linkTitle: "CloudPubSubSource" +weight: 20 +type: "docs" +aliases: + - /docs/eventing/samples/gcp-pubsub-source/README.md +--- + +# CloudPubSubSource + +Please refer to the [example](https://github.com/google/knative-gcp/blob/master/docs/examples/cloudpubsubsource/README.md) in knative-gcp. diff --git a/docs/eventing/samples/cloud-scheduler-source/README.md b/docs/eventing/samples/cloud-scheduler-source/README.md new file mode 100644 index 00000000000..33178a45823 --- /dev/null +++ b/docs/eventing/samples/cloud-scheduler-source/README.md @@ -0,0 +1,10 @@ +--- +title: "CloudSchedulerSource" +linkTitle: "CloudSchedulerSource" +weight: 20 +type: "docs" +--- + +# CloudSchedulerSource + +Please refer to the [example](https://github.com/google/knative-gcp/blob/master/docs/examples/cloudschedulersource/README.md) in knative-gcp. diff --git a/docs/eventing/samples/cloud-storage-source/README.md b/docs/eventing/samples/cloud-storage-source/README.md new file mode 100644 index 00000000000..2a66861f74a --- /dev/null +++ b/docs/eventing/samples/cloud-storage-source/README.md @@ -0,0 +1,10 @@ +--- +title: "CloudStorageSource" +linkTitle: "CloudStorageSource" +weight: 20 +type: "docs" +--- + +# CloudStorageSource + +Please refer to the [example](https://github.com/google/knative-gcp/blob/master/docs/examples/cloudstoragesource/README.md) in knative-gcp. diff --git a/docs/eventing/samples/container-source/README.md b/docs/eventing/samples/container-source/README.md new file mode 100644 index 00000000000..f38c89a0fa8 --- /dev/null +++ b/docs/eventing/samples/container-source/README.md @@ -0,0 +1,180 @@ +--- +title: "Container Source Example" +linkTitle: "Container source" +weight: 10 +type: "docs" +--- + +# Container Source Example + +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 heartbeats ContainerSource + +### Prerequisites + +1. Setup [Knative Serving](../../../serving). +1. Setup [Knative Eventing and Sources](../../../eventing). + +### Prepare the heartbeats image + +Knative [event-sources](https://github.com/knative/eventing) has a +sample of heartbeats event source. You could clone the source code by + +``` +git clone -b "{{ branch }}" https://github.com/knative/eventing.git +``` + +And then build a heartbeats image and publish to your image repo with + +``` +ko publish knative.dev/eventing/cmd/heartbeats +``` + +**Note**: `ko publish` requires: + +- [`KO_DOCKER_REPO`](https://github.com/knative/serving/blob/main/DEVELOPMENT.md#environment-setup) + to be set. (e.g. `gcr.io/[gcloud-project]` or `docker.io/`) +- you to be authenticated with your `KO_DOCKER_REPO` +- [`docker`](https://docs.docker.com/install/) to be installed + +### Create a Knative Service + +In order to verify `ContainerSource` is working, we will create a Event Display +Service that dumps incoming messages to its log. + +```yaml +apiVersion: serving.knative.dev/v1 +kind: Service +metadata: + name: event-display +spec: + template: + spec: + containers: + - image: gcr.io/knative-releases/knative.dev/eventing/cmd/event_display +``` + +Use following command to create the service from `service.yaml`: + +```bash +kubectl apply --filename service.yaml +``` + +The status of the created service can be seen using: + +```bash +kubectl get ksvc + +NAME URL LATESTCREATED LATESTREADY READY REASON +event-display http://event-display.default.1.2.3.4.sslip.io event-display-gqjbw event-display-gqjbw True +``` + +### 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](./heartbeats-source.yaml) +file. Note that arguments and environment variables are set and will be passed +to the container. + +```yaml +apiVersion: sources.knative.dev/v1 +kind: ContainerSource +metadata: + name: test-heartbeats +spec: + template: + spec: + containers: + - image: + name: heartbeats + args: + - --period=1 + env: + - name: POD_NAME + value: "mypod" + - name: POD_NAMESPACE + value: "event-test" + sink: + ref: + apiVersion: serving.knative.dev/v1 + kind: Service + name: event-display +``` + +Use the following command to create the event source from +`heartbeats-source.yaml`: + +```bash +kubectl apply --filename heartbeats-source.yaml +``` + +### Verify + +We will verify that the message was sent to the Knative eventing system by +looking at event-display service logs. + +```bash +kubectl logs -l serving.knative.dev/service=event-display -c user-container --since=10m +``` + +You should see log lines showing the request headers and body of the event +message sent by the heartbeats source to the display function: + +``` +☁️ cloudevents.Event +Validation: valid +Context Attributes, + specversion: 1.0 + type: dev.knative.eventing.samples.heartbeat + source: https://knative.dev/eventing/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": "" + } +``` + +## Create a new event source using ContainerSource + +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](https://github.com/cloudevents/spec/blob/master/spec.md#design-goals) + format is recommended. + +[heartbeats](https://github.com/knative/eventing/blob/main/cmd/heartbeats/main.go) +event source is a sample for your reference. + +### Create the ContainerSource using this container image + +When the container image is ready, a YAML file will be used to create a concrete +`ContainerSource`. Use [heartbeats-source.yaml](./heartbeats-source.yaml) as a +sample for reference. [Learn more about the ContainerSource +specification](../../../eventing#containersource). diff --git a/docs/eventing/samples/container-source/heartbeats-source.yaml b/docs/eventing/samples/container-source/heartbeats-source.yaml new file mode 100644 index 00000000000..a9abb2d6174 --- /dev/null +++ b/docs/eventing/samples/container-source/heartbeats-source.yaml @@ -0,0 +1,24 @@ +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, + # e.g. gcr.io/[gcloud-project]/knative.dev/eventing/cmd/heartbeats + - image: gcr.io/knative-releases/knative.dev/eventing/cmd/heartbeats + name: heartbeats + args: + - --period=1 + env: + - name: POD_NAME + value: "mypod" + - name: POD_NAMESPACE + value: "event-test" + sink: + ref: + apiVersion: serving.knative.dev/v1 + kind: Service + name: event-display diff --git a/docs/eventing/samples/container-source/service.yaml b/docs/eventing/samples/container-source/service.yaml new file mode 100644 index 00000000000..a0246a5940e --- /dev/null +++ b/docs/eventing/samples/container-source/service.yaml @@ -0,0 +1,23 @@ +# 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/cmd/event_display diff --git a/docs/eventing/samples/github-source/README.md b/docs/eventing/samples/github-source/README.md new file mode 100644 index 00000000000..60ab64f541d --- /dev/null +++ b/docs/eventing/samples/github-source/README.md @@ -0,0 +1,186 @@ +# GitHub source + +GitHub Source example shows how to wire GitHub events for consumption +by a Knative Service. + +## Before you begin + +1. Set up [Knative Serving](../../../serving). +1. Ensure Knative Serving is [configured with a domain + name](../../../serving/using-a-custom-domain.md) + that allows GitHub to call into the cluster. +1. You must ensure that your Knative cluster uses a static IP address refer to your provider's documentation. +1. Set up [Knative Eventing](../../../eventing) with the GitHub source. + +### Create a Knative Service + +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. + +```yaml +apiVersion: serving.knative.dev/v1 +kind: Service +metadata: + name: github-message-dumper +spec: + template: + spec: + containers: + - image: gcr.io/knative-releases/knative.dev/eventing/cmd/event_display +``` + +Enter the following command to create the service from `service.yaml`: + +```bash +kubectl --namespace default apply --filename service.yaml +``` + +### Create GitHub Tokens + +Create a [personal access token](https://github.com/settings/tokens) +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: + +![GitHub UI](personal_access_token.png "GitHub personal access token screenshot") + +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: + +```yaml +apiVersion: v1 +kind: Secret +metadata: + name: githubsecret +type: Opaque +stringData: + accessToken: personal_access_token_value + secretToken: asdfasfdsaf +``` + +Hint: you can makeup a random _secretToken_ with: + +```bash +head -c 8 /dev/urandom | base64 +``` + +Then, apply the githubsecret using `kubectl`: + +```bash +kubectl --namespace default apply --filename githubsecret.yaml +``` + +### Create Event Source for GitHub Events + +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](../../README.md#githubsource) + +```yaml +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 +``` + +Then, apply that yaml using `kubectl`: + +```bash +kubectl --namespace default apply --filename github-source.yaml +``` + +### Verify + +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. + +![GitHub Webhook](webhook_created.png "GitHub webhook screenshot") + +### 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. + +```bash +kubectl --namespace default get pods +kubectl --namespace default logs github-event-display-XXXX user-container +``` + +You should log lines similar to: + +``` +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": ...} +``` + +### Cleanup + +You can remove the Github webhook by deleting the Github source: + +```bash +kubectl --namespace default delete --filename github-source.yaml +``` + +Similarly, you can remove the Service and Secret via: + +```bash +kubectl --namespace default delete --filename service.yaml +kubectl --namespace default delete --filename githubsecret.yaml + +``` diff --git a/docs/eventing/samples/github-source/github-source.yaml b/docs/eventing/samples/github-source/github-source.yaml new file mode 100644 index 00000000000..4059b97b483 --- /dev/null +++ b/docs/eventing/samples/github-source/github-source.yaml @@ -0,0 +1,23 @@ +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/docs/eventing/samples/github-source/githubsecret.yaml b/docs/eventing/samples/github-source/githubsecret.yaml new file mode 100644 index 00000000000..9d733e4304c --- /dev/null +++ b/docs/eventing/samples/github-source/githubsecret.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Secret +metadata: + name: githubsecret +type: Opaque +stringData: + accessToken: + secretToken: diff --git a/docs/developer/eventing/sources/github-source/personal_access_token.png b/docs/eventing/samples/github-source/personal_access_token.png similarity index 100% rename from docs/developer/eventing/sources/github-source/personal_access_token.png rename to docs/eventing/samples/github-source/personal_access_token.png diff --git a/docs/eventing/samples/github-source/service.yaml b/docs/eventing/samples/github-source/service.yaml new file mode 100644 index 00000000000..360c6495524 --- /dev/null +++ b/docs/eventing/samples/github-source/service.yaml @@ -0,0 +1,10 @@ +# This is a very simple Knative Service that writes the input request to its log. +apiVersion: serving.knative.dev/v1 +kind: Service +metadata: + name: github-message-dumper +spec: + template: + spec: + containers: + - image: gcr.io/knative-releases/knative.dev/eventing/cmd/event_display diff --git a/docs/developer/eventing/sources/github-source/webhook_created.png b/docs/eventing/samples/github-source/webhook_created.png similarity index 100% rename from docs/developer/eventing/sources/github-source/webhook_created.png rename to docs/eventing/samples/github-source/webhook_created.png diff --git a/docs/eventing/samples/gitlab-source/README.md b/docs/eventing/samples/gitlab-source/README.md new file mode 100644 index 00000000000..98006cf92e8 --- /dev/null +++ b/docs/eventing/samples/gitlab-source/README.md @@ -0,0 +1,195 @@ +# GitLab source + +GitLab Source example shows how to wire GitLab events for consumption by a +Knative Service. + +## Gitlab source deployment + +### Prerequisites + +You will need: + +1. An internet-accessible Kubernetes cluster with Knative Serving installed. + Follow the [installation instructions](../../../install/) if you + need to create one. +1. Ensure Knative Serving is + [configured with a domain name](../../../serving/using-a-custom-domain.md) +1. You must ensure that your Knative cluster uses a static IP address refer to your provider's documentation. + that allows GitLab to call into the cluster. +1. Install [Knative Eventing](../../../eventing). + +### Install GitLab Event Source + +GitLab Event source lives in the [knative-sandbox/eventing-gitlab](https://github.com/knative-sandbox/eventing-gitlab). Head to the releases page, find the latest release with `gitlab.yaml` +artifact and replace the `` with version tag: + +```bash +kubectl apply -f https://github.com/knative-sandbox/eventing-gitlab/releases/download//gitlab.yaml +``` + +Check that the manager is running: + +```bash +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. + +```yaml +apiVersion: serving.knative.dev/v1 +kind: Service +metadata: + name: gitlab-event-display +spec: + template: + spec: + containers: + - image: gcr.io/knative-releases/knative.dev/eventing/cmd/event_display +``` + +Create the service: + +```bash +kubectl -n default apply -f event-display.yaml +``` + +### Create GitLab Tokens + +1. Create a + [personal access token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html) + 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. + +1. 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. + + Hint: you can generate a random _secretToken_ with: + + ```bash + head -c 8 /dev/urandom | base64 + ``` + + `secret.yaml`: + + ```yaml + apiVersion: v1 + kind: Secret + metadata: + name: gitlabsecret + type: Opaque + stringData: + accessToken: + secretToken: + ``` + +1. Create the secret using `kubectl`. + + ```bash + kubectl -n default apply -f secret.yaml + ``` + +### Create Event Source for GitLab Events + +1. 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`. + + `gitlabsource.yaml`: + + ```yaml + apiVersion: sources.knative.dev/v1alpha1 + kind: GitLabSource + metadata: + name: gitlabsource-sample + spec: + eventTypes: + - push_events + - issues_events + projectUrl: + accessToken: + secretKeyRef: + name: gitlabsecret + key: accessToken + secretToken: + secretKeyRef: + name: gitlabsecret + key: secretToken + sink: + ref: + apiVersion: serving.knative.dev/v1 + kind: Service + name: gitlab-event-display + ``` + +1. Apply the yaml file using `kubectl`: + + ```bash + kubectl -n default apply -f gitlabsource.yaml + ``` + +### Verify + +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: + +``` +☁️ cloudevents.Event +Validation: valid +Context Attributes, + specversion: 0.3 + type: dev.knative.sources.gitlabsource.Push Hook + source: https://gitlab.com// + id: f83c080f-c2af-48ff-8d8b-fd5b21c5938e + time: 2020-03-12T11:08:41.414572482Z + datacontenttype: application/json +Data, + { + + } +``` + +### Cleanup + +You can remove the GitLab webhook by deleting the GitLab source: + +```bash +kubectl --namespace default delete --filename gitlabsource.yaml +``` + +Similarly, you can remove the Service and Secret via: + +```bash +kubectl --namespace default delete --filename event-display.yaml +kubectl --namespace default delete --filename secret.yaml + +``` From 8dc6d4b388e29c6a5a849f401e2a3e25b3c2f3d1 Mon Sep 17 00:00:00 2001 From: Samia Nneji Date: Tue, 6 Jul 2021 13:24:37 +0100 Subject: [PATCH 07/12] link fixes and improvements --- .../eventing/install-eventing-with-yaml.md | 36 +++++++------------ 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/docs/admin/install/eventing/install-eventing-with-yaml.md b/docs/admin/install/eventing/install-eventing-with-yaml.md index 6d099289a85..d108875dafe 100644 --- a/docs/admin/install/eventing/install-eventing-with-yaml.md +++ b/docs/admin/install/eventing/install-eventing-with-yaml.md @@ -42,7 +42,7 @@ Follow the procedure for the channel of your choice: === "Apache Kafka Channel" 1. First, - [Install Apache Kafka for Kubernetes](../../../../eventing/samples/kafka) + [Install Apache Kafka for Kubernetes](../../../eventing/samples/kafka/README.md) 1. Then install the Apache Kafka Channel: @@ -53,8 +53,7 @@ Follow the procedure for the channel of your choice: ``` !!! tip - To learn more about the Apache Kafka channel, try - [our sample](../../../../eventing/samples/kafka/channel/) + To learn more, try the [Apache Kafka channel sample](../../../eventing/samples/kafka/channel/README.md). === "Google Cloud Pub/Sub Channel" @@ -66,8 +65,7 @@ Follow the procedure for the channel of your choice: ``` !!! tip - To learn more about the Google Cloud Pub/Sub channel, try - [our sample](https://github.com/google/knative-gcp/blob/master/docs/examples/channel/README.md) + To learn more, try the [Google Cloud Pub/Sub channel sample](https://github.com/google/knative-gcp/blob/master/docs/examples/channel/README.md). === "In-Memory (standalone)" @@ -115,7 +113,7 @@ Follow the procedure for the broker of your choice: kubectl apply -f {{ artifact(org="knative-sandbox",repo="eventing-kafka-broker",file="eventing-kafka-broker.yaml")}} ``` - For more information, see the [Kafka broker](../../../../eventing/broker/kafka-broker/) documentation. + For more information, see the [Kafka broker](../../../eventing/broker/kafka-broker/README.md) documentation. === "MT-Channel-based" @@ -260,8 +258,7 @@ The tabs below expand to show instructions for installing each Eventing extensio GitHub sources in the cluster. This source does not support logging or tracing configuration yet. - To learn more about the Github source, try - [our sample](../../../../developer/eventing/sources/github-source/) + To learn more, try the [Github source sample](../../../eventing/samples/github-source/README.md) === "Apache Kafka Source" @@ -271,8 +268,7 @@ The tabs below expand to show instructions for installing each Eventing extensio kubectl apply -f {{ artifact(org="knative-sandbox",repo="eventing-kafka",file="source.yaml")}} ``` - To learn more about the Apache Kafka source, try - [our sample](../../../../developer/eventing/sources/kafka-source) + To learn more, try the [Apache Kafka source sample](../../../developer/eventing/sources/kafka-source/README.md). === "GCP Sources" @@ -284,17 +280,12 @@ The tabs below expand to show instructions for installing each Eventing extensio kubectl apply -f {{ artifact(org="google",repo="knative-gcp",file="cloud-run-events.yaml")}} ``` - To learn more about the Cloud Pub/Sub source, try - [our sample](../../../../developer/eventing/sources/cloud-pubsub-source). + To learn more, try the following: - To learn more about the Cloud Storage source, try - [our sample](../../../../developer/eventing/sources/cloud-storage-source). - - To learn more about the Cloud Scheduler source, try - [our sample](../../../../developer/eventing/sources/cloud-scheduler-source). - - To learn more about the Cloud Audit Logs source, try - [our sample](../../../../developer/eventing/sources/cloud-audit-logs-source). + - [Cloud Pub/Sub source sample](../../../eventing/samples/cloud-pubsub-source/README.md) + - [Cloud Storage source sample](../../../eventing/samples/cloud-storage-source/README.md) + - [Cloud Scheduler source sample](../../../eventing/samples/cloud-scheduler-source/README.md) + - [Cloud Audit Logs source sample](../../../eventing/samples/cloud-audit-logs-source/README.md) === "Apache CouchDB Source" @@ -305,7 +296,7 @@ The tabs below expand to show instructions for installing each Eventing extensio kubectl apply -f {{ artifact(org="knative-sandbox",repo="eventing-couchdb",file="couchdb.yaml")}} ``` - To learn more about the Apache CouchDB source, read the [documentation](https://github.com/knative-sandbox/eventing-couchdb/blob/main/source/README.md). + To learn more, read the [Apache CouchDB source](https://github.com/knative-sandbox/eventing-couchdb/blob/main/source/README.md) documentation. === "VMware Sources and Bindings" @@ -315,5 +306,4 @@ The tabs below expand to show instructions for installing each Eventing extensio kubectl apply -f {{ artifact(org="vmware-tanzu",repo="sources-for-knative",file="release.yaml")}} ``` - To learn more about the VMware sources and bindings, try - [our samples](https://github.com/vmware-tanzu/sources-for-knative/tree/master/samples/README.md). + To learn more, try the [VMware sources and bindings samples](https://github.com/vmware-tanzu/sources-for-knative/tree/master/samples/README.md). From 7bc943cf80525e66a06bcd2c484ed32426634ce5 Mon Sep 17 00:00:00 2001 From: Samia Nneji Date: Tue, 6 Jul 2021 14:39:13 +0100 Subject: [PATCH 08/12] tweak some more links --- docs/eventing/README.md | 8 ++++---- docs/eventing/samples/README.md | 2 +- docs/getting-started/getting-started-eventing.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/eventing/README.md b/docs/eventing/README.md index 152342933ed..37c133a8dfd 100644 --- a/docs/eventing/README.md +++ b/docs/eventing/README.md @@ -1,8 +1,8 @@ # Knative Eventing -Knative Eventing enables developers to use an [event-driven architecture](https://en.wikipedia.org/wiki/Event-driven_architecture) with serverless applications. An event-driven architecture is based on the concept of decoupled relationships between event producers that create events, and event consumers, or [_sinks_](../../developer/eventing/sinks), that receive events. +Knative Eventing enables developers to use an [event-driven architecture](https://en.wikipedia.org/wiki/Event-driven_architecture) with serverless applications. An event-driven architecture is based on the concept of decoupled relationships between event producers that create events, and event consumers, or [_sinks_](../developer/eventing/sinks/README.md), that receive events. -In a Knative Eventing deployment, event [Sources](../../developer/eventing/sources) are the primary event producers, however you can also configure a sink or _subscriber_ to respond to HTTP requests by sending a response event. Examples of sinks in a Knative Eventing deployment include Knative Services, Channels and Brokers. +In a Knative Eventing deployment, event [Sources](../developer/eventing/sources/README.md) are the primary event producers, however you can also configure a sink or _subscriber_ to respond to HTTP requests by sending a response event. Examples of sinks in a Knative Eventing deployment include Knative Services, Channels and Brokers. Knative Eventing uses standard HTTP POST requests to send and receive events between event producers and sinks. These events conform to the [CloudEvents specifications](https://cloudevents.io/), which enables creating, parsing, sending, and receiving events in any programming language. @@ -18,7 +18,7 @@ Consume an event without creating a publisher : You can use a trigger to consume events from a broker based on event attributes. The application receives events as an HTTP POST. !!! tip - Multiple event producers and sinks can be used together to create more advanced [Knative Eventing flows](../../eventing/flows/) to solve complex use cases. + Multiple event producers and sinks can be used together to create more advanced [Knative Eventing flows](./flows/README.md) to solve complex use cases. @@ -43,4 +43,4 @@ the registry contain (all) the required information for a consumer to create a Trigger without resorting to some other out-of-band mechanism. To learn how to use the registry, see the -[Event Registry documentation](../../eventing/event-registry). +[Event Registry documentation](./event-registry.md). diff --git a/docs/eventing/samples/README.md b/docs/eventing/samples/README.md index 2b2d7c9b198..c495f057620 100644 --- a/docs/eventing/samples/README.md +++ b/docs/eventing/samples/README.md @@ -10,6 +10,6 @@ showlandingtoc: "true" Use the following code samples to help you understand the various use cases for Knative Eventing and Event Sources. -[Learn more about Knative Eventing and Eventing Sources](../). +[Learn more about Knative Eventing and Eventing Sources](../README.md). [**See all Knative code samples**](../../samples.md) diff --git a/docs/getting-started/getting-started-eventing.md b/docs/getting-started/getting-started-eventing.md index 9a64a29e834..7fae62286c4 100644 --- a/docs/getting-started/getting-started-eventing.md +++ b/docs/getting-started/getting-started-eventing.md @@ -10,7 +10,7 @@ With Knative Serving, we have a powerful tool which can take our containerized c ==**Knative Eventing acts as the "glue" between the disparate parts of your architecture**== and allows you to easily communicate between those parts in a fault-tolerant way. Some examples include: -:material-file-document: [Creating and responding to Kubernetes API events](../../developer/eventing/sources/apiserversource/){target=blank} +:material-file-document: [Creating and responding to Kubernetes API events](../developer/eventing/sources/apiserversource/README.md){target=blank} --8<-- "YouTube_icon.svg" [Creating an image processing pipeline](https://www.youtube.com/watch?v=DrmOpjAunlQ){target=blank} From 6b2feae5a73ee5eef88c65c5e3e827d084dec58a Mon Sep 17 00:00:00 2001 From: Samia Nneji Date: Tue, 6 Jul 2021 16:06:37 +0100 Subject: [PATCH 09/12] Update redirects --- config/redirects.yml | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/config/redirects.yml b/config/redirects.yml index 779ad3f71ef..6de6e21911d 100644 --- a/config/redirects.yml +++ b/config/redirects.yml @@ -14,30 +14,30 @@ plugins: eventing/event-delivery.md: developer/eventing/event-delivery.md eventing/metrics.md: admin/collecting-metrics/eventing-metrics/metrics.md eventing/parallel.md: eventing/flows/parallel.md - eventing/samples/apache-camel-source/index.md: eventing/sources/apache-camel-source/README.md - eventing/samples/gcp-pubsub-source/README.md: eventing/sources/cloud-pubsub-source/README.md - eventing/samples/kubernetes-event-source/index.md: developer/eventing/sources/apiserversource/getting-started/README.md - eventing/samples/ping-source/index.md: eventing/sources/ping-source/README.md + eventing/samples/apache-camel-source/index.md: developer/eventing/sources/apache-camel-source/README.md + eventing/samples/gcp-pubsub-source/README.md: eventing/samples/cloud-pubsub-source/README.md + eventing/samples/kubernetes-event-source/index.md: developer/eventing/sources/apiserversource/README.md + eventing/samples/ping-source/index.md: developer/eventing/sources/ping-source/README.md eventing/samples/sequence/index.md: eventing/flows/sequence/README.md eventing/samples/sequence/sequence-replay-to-event-display/index.md: eventing/flows/sequence/sequence-reply-to-event-display/README.md eventing/samples/sequence/sequence-reply-to-sequence/index.md: eventing/flows/sequence/sequence-reply-to-sequence/README.md eventing/samples/sequence/sequence-terminal/index.md: eventing/flows/sequence/sequence-terminal/README.md eventing/samples/sequence/sequence-with-broker-trigger/index.md: eventing/flows/sequence/sequence-with-broker-trigger/README.md - eventing/samples/sinkbinding/README.md: eventing/sources/sinkbinding/README.md - eventing/samples/writing-event-source-easy-way/index.md: eventing/sources/creating-event-sources/writing-event-source-easy-way/README.md - eventing/samples/writing-event-source/01-theory/index.md: eventing/sources/creating-event-sources/writing-event-source/01-theory.md - eventing/samples/writing-event-source/02-lifecycle-and-types/index.md: eventing/sources/creating-event-sources/writing-event-source/02-lifecycle-and-types.md - eventing/samples/writing-event-source/03-controller/index.md: eventing/sources/creating-event-sources/writing-event-source/03-controller.md - eventing/samples/writing-event-source/04-reconciler/index.md: eventing/sources/creating-event-sources/writing-event-source/04-reconciler.md - eventing/samples/writing-event-source/05-receive-adapter/index.md: eventing/sources/creating-event-sources/writing-event-source/05-receive-adapter.md - eventing/samples/writing-event-source/06-yaml/index.md: eventing/sources/creating-event-sources/writing-event-source/06-yaml.md - eventing/samples/writing-event-source/07-knative-sandbox/index.md: eventing/sources/creating-event-sources/writing-event-source/07-knative-sandbox.md - eventing/samples/writing-event-source/index.md: eventing/sources/creating-event-sources/writing-event-source/README.md + eventing/samples/sinkbinding/README.md: developer/eventing/sources/sinkbinding/README.md + eventing/samples/writing-event-source-easy-way/index.md: developer/eventing/sources/creating-event-sources/writing-event-source-easy-way/README.md + eventing/samples/writing-event-source/01-theory/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/01-theory.md + eventing/samples/writing-event-source/02-lifecycle-and-types/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/02-lifecycle-and-types.md + eventing/samples/writing-event-source/03-controller/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/03-controller.md + eventing/samples/writing-event-source/04-reconciler/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/04-reconciler.md + eventing/samples/writing-event-source/05-receive-adapter/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/05-receive-adapter.md + eventing/samples/writing-event-source/06-yaml/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/06-yaml.md + eventing/samples/writing-event-source/07-knative-sandbox/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/07-knative-sandbox.md + eventing/samples/writing-event-source/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/README.md eventing/sequence.md: eventing/flows/sequence/README.md eventing/sink/README.md: developer/eventing/sinks/README.md eventing/sink/kafka-sink.md: developer/eventing/sinks/kafka-sink.md eventing/sources/apiserversource/index.md: developer/eventing/sources/apiserversource/README.md - eventing/sources/pingsource/index.md: eventing/sources/ping-source/README.md + eventing/sources/pingsource/index.md: developer/eventing/sources/ping-source/README.md eventing/sources/containersource.md: developer/eventing/sources/containersource/README.md eventing/triggers/index.md: eventing/broker/triggers/README.md help/README.md: help/contributor/README.md @@ -77,5 +77,3 @@ plugins: upgrade/index.md: admin/upgrade/README.md upgrade/upgrade-installation-with-operator.md: admin/upgrade/upgrade-installation-with-operator.md upgrade/upgrade-installation.md: admin/upgrade/upgrade-installation.md - - From ba3b38794c76849072d6ca8f0ce199df6e68b8bc Mon Sep 17 00:00:00 2001 From: Samia Nneji Date: Tue, 6 Jul 2021 16:20:52 +0100 Subject: [PATCH 10/12] Rebase redirects --- config/redirects.yml | 156 +++++++++++++++++++++---------------------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/config/redirects.yml b/config/redirects.yml index 6de6e21911d..359ad4d8bfa 100644 --- a/config/redirects.yml +++ b/config/redirects.yml @@ -1,79 +1,79 @@ plugins: - - redirects: - redirect_maps: - admin/install/install-eventing-with-yaml.md: admin/install/eventing/install-eventing-with-yaml.md - admin/install/install-serving-with-yaml.md: admin/install/serving/install-serving-with-yaml.md - client/connecting-kn-to-your-cluster/index.md: client/README.md - concepts/overview.md: _index.md - eventing/broker/alternate/index.md: eventing/broker/README.md - eventing/broker/broker-event-delivery.md: developer/eventing/event-delivery.md - eventing/broker/configmaps/README.md: admin/eventing/broker-configuration.md - eventing/broker/kafka-broker/index.md: eventing/broker/kafka-broker/README.md - eventing/broker/kafka-broker/kafka-configmap.md: admin/eventing/kafka-channel-configuration.md - eventing/channels/default-channels/index.md: eventing/channels/README.md - eventing/event-delivery.md: developer/eventing/event-delivery.md - eventing/metrics.md: admin/collecting-metrics/eventing-metrics/metrics.md - eventing/parallel.md: eventing/flows/parallel.md - eventing/samples/apache-camel-source/index.md: developer/eventing/sources/apache-camel-source/README.md - eventing/samples/gcp-pubsub-source/README.md: eventing/samples/cloud-pubsub-source/README.md - eventing/samples/kubernetes-event-source/index.md: developer/eventing/sources/apiserversource/README.md - eventing/samples/ping-source/index.md: developer/eventing/sources/ping-source/README.md - eventing/samples/sequence/index.md: eventing/flows/sequence/README.md - eventing/samples/sequence/sequence-replay-to-event-display/index.md: eventing/flows/sequence/sequence-reply-to-event-display/README.md - eventing/samples/sequence/sequence-reply-to-sequence/index.md: eventing/flows/sequence/sequence-reply-to-sequence/README.md - eventing/samples/sequence/sequence-terminal/index.md: eventing/flows/sequence/sequence-terminal/README.md - eventing/samples/sequence/sequence-with-broker-trigger/index.md: eventing/flows/sequence/sequence-with-broker-trigger/README.md - eventing/samples/sinkbinding/README.md: developer/eventing/sources/sinkbinding/README.md - eventing/samples/writing-event-source-easy-way/index.md: developer/eventing/sources/creating-event-sources/writing-event-source-easy-way/README.md - eventing/samples/writing-event-source/01-theory/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/01-theory.md - eventing/samples/writing-event-source/02-lifecycle-and-types/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/02-lifecycle-and-types.md - eventing/samples/writing-event-source/03-controller/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/03-controller.md - eventing/samples/writing-event-source/04-reconciler/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/04-reconciler.md - eventing/samples/writing-event-source/05-receive-adapter/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/05-receive-adapter.md - eventing/samples/writing-event-source/06-yaml/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/06-yaml.md - eventing/samples/writing-event-source/07-knative-sandbox/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/07-knative-sandbox.md - eventing/samples/writing-event-source/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/README.md - eventing/sequence.md: eventing/flows/sequence/README.md - eventing/sink/README.md: developer/eventing/sinks/README.md - eventing/sink/kafka-sink.md: developer/eventing/sinks/kafka-sink.md - eventing/sources/apiserversource/index.md: developer/eventing/sources/apiserversource/README.md - eventing/sources/pingsource/index.md: developer/eventing/sources/ping-source/README.md - eventing/sources/containersource.md: developer/eventing/sources/containersource/README.md - eventing/triggers/index.md: eventing/broker/triggers/README.md - help/README.md: help/contributor/README.md - install/README.md: admin/install/README.md - install/check-install-version.md: check-install-version.md - install/collecting-logs/index.md: admin/collecting-logs/README.md - install/collecting-metrics/index.md: admin/collecting-metrics/README.md - install/getting-started-knative-app/index.md: serving/getting-started-knative-app.md - install/install-eventing-with-yaml.md: admin/install/eventing/install-eventing-with-yaml.md - # This doesn't exist anymore, we should probably replace it - install/install-extensions.md: admin/install/README.md - install/install-kn/index.md: client/install-kn.md - install/install-serving-with-yaml.md: admin/install/serving/install-serving-with-yaml.md - install/installation-files.md: admin/install/README.md - install/installing-istio.md: admin/install/installing-istio.md - install/knative-offerings.md: admin/install/knative-offerings.md - install/knative-with-operators.md: admin/install/knative-with-operators.md - install/operator/configuring-eventing-cr.md: admin/install/operator/configuring-eventing-cr.md - install/operator/configuring-serving-cr.md: admin/install/operator/configuring-serving-cr.md - install/prerequisites.md: admin/install/README.md - operator/configuring-eventing-cr/index.md: admin/install/operator/configuring-eventing-cr.md - operator/configuring-serving-cr/index.md: admin/install/operator/configuring-serving-cr.md - reference/resources/index.md: client/README.md - serving/autoscaling/autoscaling-concepts.md: serving/autoscaling/autoscaler-types.md - serving/autoscaling/target-burst-capacity/index.md: serving/load-balancing/target-burst-capacity.md - serving/configuring-autoscaling/index.md: serving/autoscaling/README.md - serving/creating-domain-mappings.md: developer/serving/services/custom-domains.md - serving/debugging-application-issues.md: developer/serving/troubleshooting/debugging-application-issues.md - serving/metrics.md: admin/collecting-metrics/serving-metrics/metrics.md - serving/samples/autoscale-go/index.md: serving/autoscaling/autoscale-go/README.md - serving/services/README.md: developer/serving/services/README.md - serving/services/creating-services.md: developer/serving/services/creating-services.md - serving/services/deployment.md: admin/serving/deployment.md - serving/services/private-services.md: developer/serving/services/private-services.md - serving/using-an-ssl-cert/index.md: serving/using-a-tls-cert.md - uninstall.md: admin/install/uninstall.md - upgrade/index.md: admin/upgrade/README.md - upgrade/upgrade-installation-with-operator.md: admin/upgrade/upgrade-installation-with-operator.md - upgrade/upgrade-installation.md: admin/upgrade/upgrade-installation.md + redirects: + redirect_maps: + admin/install/install-eventing-with-yaml.md: admin/install/eventing/install-eventing-with-yaml.md + admin/install/install-serving-with-yaml.md: admin/install/serving/install-serving-with-yaml.md + client/connecting-kn-to-your-cluster/index.md: client/README.md + concepts/overview.md: _index.md + eventing/broker/alternate/index.md: eventing/broker/README.md + eventing/broker/broker-event-delivery.md: developer/eventing/event-delivery.md + eventing/broker/configmaps/README.md: admin/eventing/broker-configuration.md + eventing/broker/kafka-broker/index.md: eventing/broker/kafka-broker/README.md + eventing/broker/kafka-broker/kafka-configmap.md: admin/eventing/kafka-channel-configuration.md + eventing/channels/default-channels/index.md: eventing/channels/README.md + eventing/event-delivery.md: developer/eventing/event-delivery.md + eventing/metrics.md: admin/collecting-metrics/eventing-metrics/metrics.md + eventing/parallel.md: eventing/flows/parallel.md + eventing/samples/apache-camel-source/index.md: developer/eventing/sources/apache-camel-source/README.md + eventing/samples/gcp-pubsub-source/README.md: eventing/samples/cloud-pubsub-source/README.md + eventing/samples/kubernetes-event-source/index.md: developer/eventing/sources/apiserversource/README.md + eventing/samples/ping-source/index.md: developer/eventing/sources/ping-source/README.md + eventing/samples/sequence/index.md: eventing/flows/sequence/README.md + eventing/samples/sequence/sequence-replay-to-event-display/index.md: eventing/flows/sequence/sequence-reply-to-event-display/README.md + eventing/samples/sequence/sequence-reply-to-sequence/index.md: eventing/flows/sequence/sequence-reply-to-sequence/README.md + eventing/samples/sequence/sequence-terminal/index.md: eventing/flows/sequence/sequence-terminal/README.md + eventing/samples/sequence/sequence-with-broker-trigger/index.md: eventing/flows/sequence/sequence-with-broker-trigger/README.md + eventing/samples/sinkbinding/README.md: developer/eventing/sources/sinkbinding/README.md + eventing/samples/writing-event-source-easy-way/index.md: developer/eventing/sources/creating-event-sources/writing-event-source-easy-way/README.md + eventing/samples/writing-event-source/01-theory/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/01-theory.md + eventing/samples/writing-event-source/02-lifecycle-and-types/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/02-lifecycle-and-types.md + eventing/samples/writing-event-source/03-controller/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/03-controller.md + eventing/samples/writing-event-source/04-reconciler/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/04-reconciler.md + eventing/samples/writing-event-source/05-receive-adapter/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/05-receive-adapter.md + eventing/samples/writing-event-source/06-yaml/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/06-yaml.md + eventing/samples/writing-event-source/07-knative-sandbox/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/07-knative-sandbox.md + eventing/samples/writing-event-source/index.md: developer/eventing/sources/creating-event-sources/writing-event-source/README.md + eventing/sequence.md: eventing/flows/sequence/README.md + eventing/sink/README.md: developer/eventing/sinks/README.md + eventing/sink/kafka-sink.md: developer/eventing/sinks/kafka-sink.md + eventing/sources/apiserversource/index.md: developer/eventing/sources/apiserversource/README.md + eventing/sources/pingsource/index.md: developer/eventing/sources/ping-source/README.md + eventing/sources/containersource.md: developer/eventing/sources/containersource/README.md + eventing/triggers/index.md: eventing/broker/triggers/README.md + help/README.md: help/contributor/README.md + install/README.md: admin/install/README.md + install/check-install-version.md: check-install-version.md + install/collecting-logs/index.md: admin/collecting-logs/README.md + install/collecting-metrics/index.md: admin/collecting-metrics/README.md + install/getting-started-knative-app/index.md: serving/getting-started-knative-app.md + install/install-eventing-with-yaml.md: admin/install/eventing/install-eventing-with-yaml.md + # This doesn't exist anymore, we should probably replace it + install/install-extensions.md: admin/install/README.md + install/install-kn/index.md: client/install-kn.md + install/install-serving-with-yaml.md: admin/install/serving/install-serving-with-yaml.md + install/installation-files.md: admin/install/README.md + install/installing-istio.md: admin/install/installing-istio.md + install/knative-offerings.md: admin/install/knative-offerings.md + install/knative-with-operators.md: admin/install/knative-with-operators.md + install/operator/configuring-eventing-cr.md: admin/install/operator/configuring-eventing-cr.md + install/operator/configuring-serving-cr.md: admin/install/operator/configuring-serving-cr.md + install/prerequisites.md: admin/install/README.md + operator/configuring-eventing-cr/index.md: admin/install/operator/configuring-eventing-cr.md + operator/configuring-serving-cr/index.md: admin/install/operator/configuring-serving-cr.md + reference/resources/index.md: client/README.md + serving/autoscaling/autoscaling-concepts.md: serving/autoscaling/autoscaler-types.md + serving/autoscaling/target-burst-capacity/index.md: serving/load-balancing/target-burst-capacity.md + serving/configuring-autoscaling/index.md: serving/autoscaling/README.md + serving/creating-domain-mappings.md: developer/serving/services/custom-domains.md + serving/debugging-application-issues.md: developer/serving/troubleshooting/debugging-application-issues.md + serving/metrics.md: admin/collecting-metrics/serving-metrics/metrics.md + serving/samples/autoscale-go/index.md: serving/autoscaling/autoscale-go/README.md + serving/services/README.md: developer/serving/services/README.md + serving/services/creating-services.md: developer/serving/services/creating-services.md + serving/services/deployment.md: admin/serving/deployment.md + serving/services/private-services.md: developer/serving/services/private-services.md + serving/using-an-ssl-cert/index.md: serving/using-a-tls-cert.md + uninstall.md: admin/install/uninstall.md + upgrade/index.md: admin/upgrade/README.md + upgrade/upgrade-installation-with-operator.md: admin/upgrade/upgrade-installation-with-operator.md + upgrade/upgrade-installation.md: admin/upgrade/upgrade-installation.md From 605a30f81613b25e5f51ea4c8c4a60633f0cb89a Mon Sep 17 00:00:00 2001 From: Omer B Date: Wed, 7 Jul 2021 09:57:11 -0400 Subject: [PATCH 11/12] fixing infinite redirect bug --- config/redirects.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/config/redirects.yml b/config/redirects.yml index 359ad4d8bfa..804a5579759 100644 --- a/config/redirects.yml +++ b/config/redirects.yml @@ -8,7 +8,6 @@ plugins: eventing/broker/alternate/index.md: eventing/broker/README.md eventing/broker/broker-event-delivery.md: developer/eventing/event-delivery.md eventing/broker/configmaps/README.md: admin/eventing/broker-configuration.md - eventing/broker/kafka-broker/index.md: eventing/broker/kafka-broker/README.md eventing/broker/kafka-broker/kafka-configmap.md: admin/eventing/kafka-channel-configuration.md eventing/channels/default-channels/index.md: eventing/channels/README.md eventing/event-delivery.md: developer/eventing/event-delivery.md From 2a83dedfbc8f4394e9df68889b29650427b53b0d Mon Sep 17 00:00:00 2001 From: Samia Nneji Date: Wed, 7 Jul 2021 15:08:14 +0100 Subject: [PATCH 12/12] Move creating event sources --- config/nav.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/config/nav.yml b/config/nav.yml index 92b6835c407..0b11c78c577 100644 --- a/config/nav.yml +++ b/config/nav.yml @@ -70,20 +70,20 @@ nav: - Troubleshooting: - Debugging application issues: developer/serving/troubleshooting/debugging-application-issues.md - Knative Eventing: - - Creating an event source: - - Overview: developer/eventing/sources/creating-event-sources/README.md - - Writing an event source using Javascript: developer/eventing/sources/creating-event-sources/writing-event-source-easy-way/README.md - - Using the sample event source: - - Overview: developer/eventing/sources/creating-event-sources/writing-event-source/README.md - - Design of an Event Source: developer/eventing/sources/creating-event-sources/writing-event-source/01-theory.md - - Lifecycle and Types: developer/eventing/sources/creating-event-sources/writing-event-source/02-lifecycle-and-types.md - - Controller Implemetation: developer/eventing/sources/creating-event-sources/writing-event-source/03-controller.md - - Reconciler Implementation: developer/eventing/sources/creating-event-sources/writing-event-source/04-reconciler.md - - Receive Adapter Implementation: developer/eventing/sources/creating-event-sources/writing-event-source/05-receive-adapter.md - - Publishing to your cluster: developer/eventing/sources/creating-event-sources/writing-event-source/06-yaml.md - - Moving to knative-sandbox: developer/eventing/sources/creating-event-sources/writing-event-source/07-knative-sandbox.md - Event sources: - Overview: developer/eventing/sources/README.md + - Creating an event source: + - Overview: developer/eventing/sources/creating-event-sources/README.md + - Writing an event source using Javascript: developer/eventing/sources/creating-event-sources/writing-event-source-easy-way/README.md + - Using the sample event source: + - Overview: developer/eventing/sources/creating-event-sources/writing-event-source/README.md + - Design of an Event Source: developer/eventing/sources/creating-event-sources/writing-event-source/01-theory.md + - Lifecycle and Types: developer/eventing/sources/creating-event-sources/writing-event-source/02-lifecycle-and-types.md + - Controller Implemetation: developer/eventing/sources/creating-event-sources/writing-event-source/03-controller.md + - Reconciler Implementation: developer/eventing/sources/creating-event-sources/writing-event-source/04-reconciler.md + - Receive Adapter Implementation: developer/eventing/sources/creating-event-sources/writing-event-source/05-receive-adapter.md + - Publishing to your cluster: developer/eventing/sources/creating-event-sources/writing-event-source/06-yaml.md + - Moving to knative-sandbox: developer/eventing/sources/creating-event-sources/writing-event-source/07-knative-sandbox.md - ApiServerSource: - Overview: developer/eventing/sources/apiserversource/README.md - Creating an ApiServerSource object: developer/eventing/sources/apiserversource/getting-started/README.md