From 9282b5d964e376b4f2f9e8ed6552cd53281b4c2a Mon Sep 17 00:00:00 2001 From: Ali Ok Date: Fri, 8 Mar 2024 23:18:11 +0300 Subject: [PATCH 1/5] Case studies index page and link from homepage (#5869) * Link to case studies Signed-off-by: Ali Ok * Add a case studies page to link from homepage Signed-off-by: Ali Ok * change the styling, and make the whole table row clickable --------- Signed-off-by: Ali Ok Co-authored-by: Leo Li --- config/nav.yml | 3 ++- config/redirects.yml | 1 - docs/about/case-studies/README.md | 28 ++++++++++++++++++++++++++++ hack/docker/run.sh | 2 +- overrides/home.html | 4 +++- 5 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 docs/about/case-studies/README.md diff --git a/config/nav.yml b/config/nav.yml index c1fdaf850f..83e0b78ee2 100644 --- a/config/nav.yml +++ b/config/nav.yml @@ -192,7 +192,7 @@ nav: - Available Broker types: eventing/brokers/broker-types/README.md # add default IMC broker page, page explaining broker types - Channel based Broker: eventing/brokers/broker-types/channel-based-broker/README.md - - Apache Kafka: + - Apache Kafka: - About Apache Kafka Broker: eventing/brokers/broker-types/kafka-broker/README.md - Configuring Kafka features: eventing/brokers/broker-types/kafka-broker/configuring-kafka-features.md - Creating a Broker: eventing/brokers/create-broker.md @@ -309,6 +309,7 @@ nav: - About: - Testimonials: about/testimonials.md - Case studies: + - List of Case Studies: about/case-studies/README.md - deepc: about/case-studies/deepc.md - Outfit7: about/case-studies/outfit7.md - Puppet: about/case-studies/puppet.md diff --git a/config/redirects.yml b/config/redirects.yml index 0512a86065..bd15298fdd 100644 --- a/config/redirects.yml +++ b/config/redirects.yml @@ -209,6 +209,5 @@ plugins: serving/spec/knative-api-specification-1.0.md: https://github.com/knative/specs/blob/main/specs/serving/knative-api-specification-1.0.md serving/using-an-ssl-cert/index.md: serving/encryption/using-certificates-in-networking-layer.md serving/using-subroutes.md: serving/traffic-management.md - about/case-studies/README.md: about/case-studies/deepc.md eventing/brokers/create-mtbroker.md: eventing/brokers/create-broker.md eventing/brokers/broker-admin-config-options.md: eventing/configuration/broker-configuration.md diff --git a/docs/about/case-studies/README.md b/docs/about/case-studies/README.md new file mode 100644 index 0000000000..8d9e45aad9 --- /dev/null +++ b/docs/about/case-studies/README.md @@ -0,0 +1,28 @@ +--- +hide: + - toc +--- + +# Knative Case Studies + + + + + + + + + + + + + + + + + + + + + +
AI Startup deepc Connects Researchers to Radiologists with Knative Eventing
Game maker Outfit7 automates high performance ad bidding with Knative Serving
PNC Bank automated software supply chain compliance
Relay by Puppet Brings Workflows to Everything using Knative
SVA uses Knative to kickstart cloud native adoption and patterns
diff --git a/hack/docker/run.sh b/hack/docker/run.sh index 5266d98fba..84a8e2e8d3 100755 --- a/hack/docker/run.sh +++ b/hack/docker/run.sh @@ -6,6 +6,6 @@ IMAGE=${3:-ghcr.io/knative/knative-docs:latest} set -x -docker pull ${IMAGE} +docker pull ${IMAGE} --platform linux/amd64 docker run --rm -p "${PORT}:8000" -v "${SCRIPT_DIR}/../../:/site" ${IMAGE} serve --dirtyreload --dev-addr=0.0.0.0:8000 diff --git a/overrides/home.html b/overrides/home.html index de103a0259..c635f39915 100644 --- a/overrides/home.html +++ b/overrides/home.html @@ -217,7 +217,9 @@

Cloud agnostic

-

Case Studies

+

+ Case Studies +

From d187c5a14579e367877a74ba933587a22b995908 Mon Sep 17 00:00:00 2001 From: Kaiz Date: Mon, 11 Mar 2024 15:47:12 +0900 Subject: [PATCH 2/5] Fix hard-coded version (#5902) * fix hard-coded version of serving-core.yaml's url to env artifact * change --8<-- to {% include %} for calling define_env --- docs/install/operator/knative-with-operators.md | 2 +- .../yaml-install/eventing/install-eventing-with-yaml.md | 2 +- .../install/yaml-install/serving/install-serving-with-yaml.md | 2 +- docs/snippets/security-prereqs-images.md | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/install/operator/knative-with-operators.md b/docs/install/operator/knative-with-operators.md index 46b627c34e..a810cedc32 100644 --- a/docs/install/operator/knative-with-operators.md +++ b/docs/install/operator/knative-with-operators.md @@ -10,7 +10,7 @@ The following table describes the supported versions of Serving and Eventing for | v1.13 | v1.13.0
v1.12.0, v1.12.1, v1.12.2 and v1.12.3
v1.11.0, v1.1.1, v1.11.2, v1.11.3, v1.11.6, v1.11.5 and v1.11.6
v1.10.0, v1.10.1 and v1.10.2 | v1.13.0
v1.12.0, v1.12.1, v1.12.2 and v1.12.3
v1.11.0, v1.11.1, v1.11.2, v1.11.3, v1.11.4, v1.11.5 and v1.11.6
v1.10.0, v1.10.1, v1.10.2, v1.10.3, v1.10.4, v1.10.5 and v1.10.6 | --8<-- "prerequisites.md" ---8<-- "security-prereqs-images.md" +{% include "security-prereqs-images.md" %} ## Install the Knative Operator diff --git a/docs/install/yaml-install/eventing/install-eventing-with-yaml.md b/docs/install/yaml-install/eventing/install-eventing-with-yaml.md index 274bcd9d0a..f33389632f 100644 --- a/docs/install/yaml-install/eventing/install-eventing-with-yaml.md +++ b/docs/install/yaml-install/eventing/install-eventing-with-yaml.md @@ -3,7 +3,7 @@ This topic describes how to install Knative Eventing by applying YAML files using the `kubectl` CLI. --8<-- "prerequisites.md" ---8<-- "security-prereqs-images.md" +{% include "security-prereqs-images.md" %} ## Install Knative Eventing diff --git a/docs/install/yaml-install/serving/install-serving-with-yaml.md b/docs/install/yaml-install/serving/install-serving-with-yaml.md index 2aac45d76a..1b072bf290 100644 --- a/docs/install/yaml-install/serving/install-serving-with-yaml.md +++ b/docs/install/yaml-install/serving/install-serving-with-yaml.md @@ -3,7 +3,7 @@ This topic describes how to install Knative Serving by applying YAML files using the `kubectl` CLI. --8<-- "prerequisites.md" ---8<-- "security-prereqs-images.md" +{% include "security-prereqs-images.md" %} ## Install the Knative Serving component diff --git a/docs/snippets/security-prereqs-images.md b/docs/snippets/security-prereqs-images.md index 93f47594f2..75aacaf778 100644 --- a/docs/snippets/security-prereqs-images.md +++ b/docs/snippets/security-prereqs-images.md @@ -6,8 +6,8 @@ Knative releases from 1.9 onwards are signed with [cosign](https://docs.sigstore 1. Extract the images from a manifeset and verify the signatures. -``` -curl -sSL https://github.com/knative/serving/releases/download/knative-v1.10.1/serving-core.yaml \ +```bash +curl -sSL {{ artifact(repo="serving",file="serving-core.yaml") }} \ | grep 'gcr.io/' | awk '{print $2}' | sort | uniq \ | xargs -n 1 \ cosign verify -o text \ From 5e094593e7611f848900618f4e9116b13386220f Mon Sep 17 00:00:00 2001 From: Knative Automation Date: Thu, 14 Mar 2024 02:37:45 -0400 Subject: [PATCH 3/5] upgrade to latest dependencies (#5906) bumping knative.dev/hack e6dedc7...b9f6bf0: > b9f6bf0 switch default region to avoid instability (# 373) Signed-off-by: Knative Automation --- go.mod | 2 +- go.sum | 4 ++-- vendor/knative.dev/hack/infra-library.sh | 2 +- vendor/modules.txt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index c4c68ddaa4..63bb3e18cb 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( google.golang.org/grpc v1.36.0 gopkg.in/go-playground/webhooks.v3 v3.13.0 gopkg.in/yaml.v2 v2.3.0 - knative.dev/hack v0.0.0-20240302114326-e6dedc74dc47 + knative.dev/hack v0.0.0-20240313135155-b9f6bf0b323b ) require ( diff --git a/go.sum b/go.sum index d202d669e3..4ace1fe3fe 100644 --- a/go.sum +++ b/go.sum @@ -517,8 +517,8 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k= honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -knative.dev/hack v0.0.0-20240302114326-e6dedc74dc47 h1:ob3nmyZw8vJbvnHQdnDTG/5RDeUKBj5erjTdef/Mpew= -knative.dev/hack v0.0.0-20240302114326-e6dedc74dc47/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= +knative.dev/hack v0.0.0-20240313135155-b9f6bf0b323b h1:u2D/mdleFeMwjlnMG4ni7vIcaWio8NeYWYtBJe8C6xE= +knative.dev/hack v0.0.0-20240313135155-b9f6bf0b323b/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/vendor/knative.dev/hack/infra-library.sh b/vendor/knative.dev/hack/infra-library.sh index 0b8f36916c..83eacfa66c 100644 --- a/vendor/knative.dev/hack/infra-library.sh +++ b/vendor/knative.dev/hack/infra-library.sh @@ -164,7 +164,7 @@ function create_gke_test_cluster() { --v=1 \ --network=e2e-network \ --boskos-acquire-timeout-seconds=1200 \ - --region="${E2E_CLUSTER_REGION:-us-central1},us-east1,us-west1" \ + --region="${E2E_CLUSTER_REGION:-us-east1},us-central1,us-west1" \ --gcloud-extra-flags="${_extra_gcloud_flags[*]}" \ --retryable-error-patterns='.*does not have enough resources available to fulfill.*,.*only \\d+ nodes out of \\d+ have registered; this is likely due to Nodes failing to start correctly.*,.*All cluster resources were brought up.+ but: component .+ from endpoint .+ is unhealthy.*' \ --test=exec \ diff --git a/vendor/modules.txt b/vendor/modules.txt index c1f507ad80..a770af289c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -295,7 +295,7 @@ gopkg.in/go-playground/webhooks.v3/github gopkg.in/yaml.v2 # honnef.co/go/tools v0.0.1-2020.1.5 ## explicit; go 1.11 -# knative.dev/hack v0.0.0-20240302114326-e6dedc74dc47 +# knative.dev/hack v0.0.0-20240313135155-b9f6bf0b323b ## explicit; go 1.18 knative.dev/hack # go.opencensus.io => go.opencensus.io v0.20.2 From d8d932bf8d60f19cbeeab6d100a1993d2aed9ec5 Mon Sep 17 00:00:00 2001 From: Iliia Khaprov - VMware by Broadcom Date: Fri, 15 Mar 2024 11:28:04 +0100 Subject: [PATCH 4/5] Revert "drop eventing-rabbitmq (#5861)" (#5910) This reverts commit a0d137bc6681cf957bcb580f3bcb522dd50f3ca0. --- config/nav.yml | 2 + config/redirects.yml | 1 + .../broker-developer-config-options.md | 2 +- docs/eventing/brokers/broker-types/README.md | 5 + .../channel-based-broker/README.md | 2 +- .../broker-types/rabbitmq-broker/README.md | 114 +++++++++++++++ docs/eventing/sources/README.md | 1 + .../sources/rabbitmq-source/README.md | 132 ++++++++++++++++++ .../operator/knative-with-operator-cli.md | 8 ++ .../operator/knative-with-operators.md | 27 ++++ .../eventing/install-eventing-with-yaml.md | 7 + 11 files changed, 299 insertions(+), 2 deletions(-) create mode 100644 docs/eventing/brokers/broker-types/rabbitmq-broker/README.md create mode 100644 docs/eventing/sources/rabbitmq-source/README.md diff --git a/config/nav.yml b/config/nav.yml index 83e0b78ee2..5aada7b34c 100644 --- a/config/nav.yml +++ b/config/nav.yml @@ -195,6 +195,7 @@ nav: - Apache Kafka: - About Apache Kafka Broker: eventing/brokers/broker-types/kafka-broker/README.md - Configuring Kafka features: eventing/brokers/broker-types/kafka-broker/configuring-kafka-features.md + - RabbitMQ Broker: eventing/brokers/broker-types/rabbitmq-broker/README.md - Creating a Broker: eventing/brokers/create-broker.md - Developer configuration options: eventing/brokers/broker-developer-config-options.md - Triggers: @@ -214,6 +215,7 @@ nav: - PingSource: - Creating a PingSource object: eventing/sources/ping-source/README.md - PingSource reference: eventing/sources/ping-source/reference.md + - RabbitMQSource: eventing/sources/rabbitmq-source/README.md - RedisStreamSource: - About RedisStreamSource: eventing/sources/redis/README.md - Creating a RedisStreamSource object: eventing/sources/redis/getting-started.md diff --git a/config/redirects.yml b/config/redirects.yml index bd15298fdd..a9aed39e7c 100644 --- a/config/redirects.yml +++ b/config/redirects.yml @@ -6,6 +6,7 @@ plugins: eventing/broker/create-mtbroker.md: eventing/brokers/create-broker.md eventing/broker/example-mtbroker.md: eventing/brokers/broker-developer-config-options.md eventing/broker/kafka-broker/README.md: eventing/brokers/broker-types/kafka-broker/README.md + eventing/broker/rabbitmq-broker/README.md: eventing/brokers/broker-types/rabbitmq-broker/README.md eventing/broker/README.md: eventing/brokers/README.md concepts/resources/revisions.md: concepts/serving-resources/revisions.md serving/revision-gc.md: serving/revisions/revision-developer-config-options.md diff --git a/docs/eventing/brokers/broker-developer-config-options.md b/docs/eventing/brokers/broker-developer-config-options.md index 1cfc881710..20fa119217 100644 --- a/docs/eventing/brokers/broker-developer-config-options.md +++ b/docs/eventing/brokers/broker-developer-config-options.md @@ -33,6 +33,6 @@ spec: - You can specify any valid `name` for your broker. Using `default` will create a broker named `default`. - The `namespace` must be an existing namespace in your cluster. Using `default` will create the broker in the `default` namespace. -- You can set the `eventing.knative.dev/broker.class` annotation to change the class of the broker. The default broker class is `MTChannelBasedBroker`, but Knative also supports use of the `Kafka`. For more information see the [Apache Kafka Broker](../brokers/broker-types/kafka-broker/README.md) documentation. +- You can set the `eventing.knative.dev/broker.class` annotation to change the class of the broker. The default broker class is `MTChannelBasedBroker`, but Knative also supports use of the `Kafka` and `RabbitMQBroker` broker class. For more information see the [Apache Kafka Broker](../brokers/broker-types/kafka-broker/README.md) or [RabbitMQ Broker](../brokers/broker-types/rabbitmq-broker/README.md) documentation. - `spec.config` is used to specify the default backing channel configuration for Channel based Broker implementations. For more information on configuring the default channel type, see the documentation on [Configure Broker defaults](../configuration/broker-configuration.md). - `spec.delivery` is used to configure event delivery options. Event delivery options specify what happens to an event that fails to be delivered to an event sink. For more information, see the documentation on [Event delivery](../event-delivery.md). diff --git a/docs/eventing/brokers/broker-types/README.md b/docs/eventing/brokers/broker-types/README.md index 7bdad52b9e..0782aaa436 100644 --- a/docs/eventing/brokers/broker-types/README.md +++ b/docs/eventing/brokers/broker-types/README.md @@ -17,3 +17,8 @@ The following is a list of Brokers provided by the community or vendors: ### Knative Broker for Apache Kafka This Broker implementation uses [Apache Kafka](https://kafka.apache.org/) as its backing technology. For more information, see the [Knative Broker for Apache Kafka](./kafka-broker/README.md) documentation. + +### RabbitMQ broker + +The RabbitMQ Broker uses [RabbitMQ](https://www.rabbitmq.com/) for its underlying implementation. +For more information, see [RabbitMQ Broker](./rabbitmq-broker/README.md) or [the docs available on GitHub](https://github.com/knative-extensions/eventing-rabbitmq). diff --git a/docs/eventing/brokers/broker-types/channel-based-broker/README.md b/docs/eventing/brokers/broker-types/channel-based-broker/README.md index a7005d65fd..c26d030228 100644 --- a/docs/eventing/brokers/broker-types/channel-based-broker/README.md +++ b/docs/eventing/brokers/broker-types/channel-based-broker/README.md @@ -1,7 +1,7 @@ # Channel based Broker The Channel based Broker (`MTChannelBasedBroker`) uses [Channels](../../../channels) for event routing. It is shipped by default with Knative Eventing. -Users should prefer native Broker implementations (like [Knative Broker for Apache Kafka](../kafka-broker/README.md) over the MTChannelBasedBroker and Channel combination because it is usually more efficient as they reduce network hops for example. +Users should prefer native Broker implementations (like [Knative Broker for Apache Kafka](../kafka-broker/README.md) or [RabbitMQ Broker](../rabbitmq-broker/README.md)) over the MTChannelBasedBroker and Channel combination because it is usually more efficient as they reduce network hops for example. ## Prerequisites * You have Knative Eventing installed. diff --git a/docs/eventing/brokers/broker-types/rabbitmq-broker/README.md b/docs/eventing/brokers/broker-types/rabbitmq-broker/README.md new file mode 100644 index 0000000000..6223e067f8 --- /dev/null +++ b/docs/eventing/brokers/broker-types/rabbitmq-broker/README.md @@ -0,0 +1,114 @@ +# Creating a RabbitMQ Broker + +This topic describes how to create a RabbitMQ Broker. + +## Prerequisites + +1. You have installed Knative Eventing. +1. You have installed [CertManager v1.5.4](https://github.com/jetstack/cert-manager/releases/tag/v1.5.4) - easiest integration with RabbitMQ Messaging Topology Operator +1. You have installed [RabbitMQ Messaging Topology Operator](https://github.com/rabbitmq/messaging-topology-operator) - our recommendation is [latest release](https://github.com/rabbitmq/messaging-topology-operator/releases/latest) with CertManager +1. You have access to a working RabbitMQ instance. You can create a RabbitMQ instance by using the [RabbitMQ Cluster Kubernetes Operator](https://github.com/rabbitmq/cluster-operator). For more information see the [RabbitMQ website](https://www.rabbitmq.com/kubernetes/operator/using-operator.html). + +## Install the RabbitMQ controller + +1. Install the RabbitMQ controller by running the command: + + ```bash + kubectl apply -f {{ artifact(org="knative-extensions", repo="eventing-rabbitmq", file="rabbitmq-broker.yaml") }} + ``` + +1. Verify that `rabbitmq-broker-controller` and `rabbitmq-broker-webhook` are running: + + ```bash + kubectl get deployments.apps -n knative-eventing + ``` + + Example output: + + ```{ .bash .no-copy } + NAME READY UP-TO-DATE AVAILABLE AGE + eventing-controller 1/1 1 1 10s + eventing-webhook 1/1 1 1 9s + rabbitmq-broker-controller 1/1 1 1 3s + rabbitmq-broker-webhook 1/1 1 1 4s + ``` + +## Create a RabbitMQBrokerConfig object + +1. Create a YAML file using the following template: + ```yaml + apiVersion: eventing.knative.dev/v1alpha1 + kind: RabbitmqBrokerConfig + metadata: + name: + spec: + rabbitmqClusterReference: + # Configure name if a RabbitMQ Cluster Operator is being used. + name: + # Configure connectionSecret if an external RabbitMQ cluster is being used. + connectionSecret: + name: rabbitmq-secret-credentials + queueType: quorum + ``` + Where: + + - is the name you want for your RabbitMQBrokerConfig object. + - is the name of the RabbitMQ cluster you created earlier. + + !!! note + You cannot set `name` and `connectionSecret` at the same time, since `name` is for a RabbitMQ Cluster Operator instance running in the same cluster as the Broker, and `connectionSecret` is for an external RabbitMQ server. + +1. Apply the YAML file by running the command: + + ```bash + kubectl create -f + ``` + Where `` is the name of the file you created in the previous step. + +## Create a RabbitMQBroker object + +1. Create a YAML file using the following template: + + ```yaml + apiVersion: eventing.knative.dev/v1 + kind: Broker + metadata: + annotations: + eventing.knative.dev/broker.class: RabbitMQBroker + name: + spec: + config: + apiVersion: eventing.knative.dev/v1alpha1 + kind: RabbitmqBrokerConfig + name: + ``` + Where `` is the name you gave your RabbitMQBrokerConfig in the step above. + +1. Apply the YAML file by running the command: + + ```bash + kubectl apply -f + ``` + Where `` is the name of the file you created in the previous step. + +## Configure message ordering + +By default, Triggers will consume messages one at a time to preserve ordering. If ordering of events isn't important and higher performance is desired, you can configure this by using the +`parallelism` annotation. Setting `parallelism` to `n` creates `n` workers for the Trigger that will all consume messages in parallel. + +The following YAML shows an example of a Trigger with parallelism set to `10`: + +```yaml +apiVersion: eventing.knative.dev/v1 +kind: Trigger +metadata: + name: high-throughput-trigger + annotations: + rabbitmq.eventing.knative.dev/parallelism: "10" +... +``` + +## Additional information + +- For more samples visit the [`eventing-rabbitmq` Github repository samples directory](https://github.com/knative-extensions/eventing-rabbitmq/tree/main/samples) +- To report a bug or request a feature, open an issue in the [`eventing-rabbitmq` Github repository](https://github.com/knative-extensions/eventing-rabbitmq). diff --git a/docs/eventing/sources/README.md b/docs/eventing/sources/README.md index f2c13a7dcb..63bf74e8ad 100644 --- a/docs/eventing/sources/README.md +++ b/docs/eventing/sources/README.md @@ -37,6 +37,7 @@ All Sources are part of the `sources` category. | [GitLab](https://github.com/knative/docs/tree/main/code-samples/eventing/gitlab-source) | Beta | 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](https://github.com/knative/docs/tree/main/code-samples/eventing/gitlab-source) example for more details. | | [KogitoSource](https://github.com/knative-extensions/eventing-kogito) | Alpha | Knative | An implementation of the [Kogito Runtime](https://docs.jboss.org/kogito/release/latest/html_single/#proc-kogito-deploying-on-kubernetes_kogito-deploying-on-openshift) custom resource managed by the [Kogito Operator](https://github.com/kiegroup/kogito-operator). | | [PingSource](ping-source/README.md) | Stable | 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-extensions/eventing-rabbitmq) | Stable | Knative | Brings [RabbitMQ](https://www.rabbitmq.com/) messages into Knative. [RedisSource](https://github.com/knative-extensions/eventing-redis/tree/{{version}}/source) | Alpha | Knative | Brings Redis Stream into Knative. | [SinkBinding](../custom-event-source/sinkbinding/README.md) | Stable | 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](../custom-event-source/sinkbinding/README.md) example for more details. | diff --git a/docs/eventing/sources/rabbitmq-source/README.md b/docs/eventing/sources/rabbitmq-source/README.md new file mode 100644 index 0000000000..f1213c9c70 --- /dev/null +++ b/docs/eventing/sources/rabbitmq-source/README.md @@ -0,0 +1,132 @@ +# Creating a RabbitMQSource + +![stage](https://img.shields.io/badge/Stage-stable-green?style=flat-square) +![version](https://img.shields.io/badge/API_Version-v1alpha1-red?style=flat-square) + +This topic describes how to create a RabbitMQSource. + +## Prerequisites + +1. You have installed [Knative Eventing](../../../install/yaml-install/eventing/install-eventing-with-yaml.md) +1. You have installed [CertManager v1.5.4](https://github.com/jetstack/cert-manager/releases/tag/v1.5.4) - easiest integration with RabbitMQ Messaging Topology Operator +1. You have installed [RabbitMQ Messaging Topology Operator](https://github.com/rabbitmq/messaging-topology-operator) - our recommendation is [latest release](https://github.com/rabbitmq/messaging-topology-operator/releases/latest) with CertManager +1. A working RabbitMQ Instance, we recommend to create one Using the [RabbitMQ Cluster Operator](https://github.com/rabbitmq/cluster-operator). +For more information about configuring the `RabbitmqCluster` CRD, see the [RabbitMQ website](https://www.rabbitmq.com/kubernetes/operator/using-operator.html) + +## Install the RabbitMQ controller + +1. Install the RabbitMQSource controller by running the command: + + ```bash + kubectl apply -f {{ artifact(org="knative-extensions", repo="eventing-rabbitmq", file="rabbitmq-source.yaml") }} + ``` + +1. Verify that `rabbitmq-controller-manager` and `rabbitmq-webhook` are running: + + ```bash + kubectl get deployments.apps -n knative-sources + ``` + + Example output: + + ```{ .bash .no-copy } + NAME READY UP-TO-DATE AVAILABLE AGE + rabbitmq-controller-manager 1/1 1 1 3s + rabbitmq-webhook 1/1 1 1 4s + ``` + +{% include "event-display.md" %} + +## Create a RabbitMQSource object + +1. Create a YAML file using the following template: + + ```yaml + apiVersion: sources.knative.dev/v1alpha1 + kind: RabbitmqSource + metadata: + name: + spec: + rabbitmqClusterReference: + # Configure name if a RabbitMQ Cluster Operator is being used. + name: + # Configure connectionSecret if an external RabbitMQ cluster is being used. + connectionSecret: + name: rabbitmq-secret-credentials + rabbitmqResourcesConfig: + parallelism: 10 + exchangeName: "eventing-rabbitmq-source" + queueName: "eventing-rabbitmq-source" + delivery: + retry: 5 + backoffPolicy: "linear" + backoffDelay: "PT1S" + sink: + ref: + apiVersion: serving.knative.dev/v1 + kind: Service + name: event-display + ``` + Where: + + - `` is the name you want for your RabbitMQSource object. + - `` is the name of the RabbitMQ cluster you created earlier. + + !!! note + You cannot set `name` and `connectionSecret` at the same time, since `name` is for a RabbitMQ Cluster Operator instance running in the same cluster as the Source, and `connectionSecret` is for an external RabbitMQ server. + +1. Apply the YAML file by running the command: + + ```bash + kubectl apply -f + ``` + Where `` is the name of the file you created in the previous step. + +### Verify + +Check the event-display Service to see if it is receiving events. +It might take a while for the Source to start sending events to the Sink. + +```sh + kubectl -l='serving.knative.dev/service=event-display' logs -c user-container + ☁️ cloudevents.Event + Context Attributes, + specversion: 1.0 + type: dev.knative.rabbitmq.event + source: /apis/v1/namespaces/default/rabbitmqsources/ + subject: f147099d-c64d-41f7-b8eb-a2e53b228349 + id: f147099d-c64d-41f7-b8eb-a2e53b228349 + time: 2021-12-16T20:11:39.052276498Z + datacontenttype: application/json + Data, + { + ... + Random Data + ... + } +``` + +### Cleanup + +1. Delete the RabbitMQSource: + + ```sh + kubectl delete -f + ``` + +1. Delete the RabbitMQ credentials secret: + + ```sh + kubectl delete -f + ``` + +1. Delete the event display Service: + + ```sh + kubectl delete -f + ``` + +## Additional information + +- For more samples visit the [`eventing-rabbitmq` Github repository samples directory](https://github.com/knative-extensions/eventing-rabbitmq/tree/main/samples) +- To report a bug or request a feature, open an issue in the [`eventing-rabbitmq` Github repository](https://github.com/knative-extensions/eventing-rabbitmq). diff --git a/docs/install/operator/knative-with-operator-cli.md b/docs/install/operator/knative-with-operator-cli.md index 1973b0d7db..a4382ea5ec 100644 --- a/docs/install/operator/knative-with-operator-cli.md +++ b/docs/install/operator/knative-with-operator-cli.md @@ -218,6 +218,14 @@ see how you can configure Knative Eventing with different event sources: kn operator enable eventing-source --kafka --namespace knative-eventing ``` +=== "RabbitMQ" + + 1. To install the eventing source RabbitMQ, run the following command: + + ```bash + kn operator enable eventing-source --rabbitmq --namespace knative-eventing + ``` + === "Redis" 1. To install the eventing source Redis, run the following command: diff --git a/docs/install/operator/knative-with-operators.md b/docs/install/operator/knative-with-operators.md index a810cedc32..359757bed1 100644 --- a/docs/install/operator/knative-with-operators.md +++ b/docs/install/operator/knative-with-operators.md @@ -526,6 +526,33 @@ see how you can configure Knative Eventing with different event sources: Where `` is the name of the file you created in the previous step. +=== "RabbitMQ" + + To configure Knative Eventing to install RabbitMQ as the event source, + + 1. Add `spec.source.rabbitmq` to your Eventing CR YAML file as follows: + + ```yaml + apiVersion: operator.knative.dev/v1beta1 + kind: KnativeEventing + metadata: + name: knative-eventing + namespace: knative-eventing + spec: + # ... + source: + rabbitmq: + enabled: true + ``` + + 1. Apply the YAML file by running the command: + + ```bash + kubectl apply -f .yaml + ``` + + Where `` is the name of the file you created in the previous step. + === "Redis" To configure Knative Eventing to install Redis as the event source: diff --git a/docs/install/yaml-install/eventing/install-eventing-with-yaml.md b/docs/install/yaml-install/eventing/install-eventing-with-yaml.md index f33389632f..68ad99dd66 100644 --- a/docs/install/yaml-install/eventing/install-eventing-with-yaml.md +++ b/docs/install/yaml-install/eventing/install-eventing-with-yaml.md @@ -200,6 +200,13 @@ Follow the procedure for the Broker of your choice: !!! warning In order to use the KafkaChannel, ensure that it is installed on your cluster, as mentioned previously in this topic. +=== "RabbitMQ Broker" + + * Install the RabbitMQ Broker by following the instructions in the + [RabbitMQ Knative Eventing Broker README](https://github.com/knative-extensions/eventing-rabbitmq/tree/main/broker). + + For more information, see the [RabbitMQ Broker](https://github.com/knative-extensions/eventing-rabbitmq) in GitHub. + ## Install optional Eventing extensions The following tabs expand to show instructions for installing each Eventing extension. From b9474dfc2ce4597d9d1608dac1c3c20718809511 Mon Sep 17 00:00:00 2001 From: Leo Li Date: Fri, 15 Mar 2024 11:29:53 -0400 Subject: [PATCH 5/5] Sample App: Notification Service: camel slack sink (#5888) * Adding the yaml file that create the Camel Pipe, connecting the Knative Broker and the slack sink * Adding the first draft of the documentation for notification service * Update the Camel-Kamelets Version * Update the tutorial * Fix the review comments by rearranging the sections, fix the wordings * Compile the web pages * Trying to add some styling * Fix the styling * Fix the styling * Test how things look with modified code block * Return to the original. Will do the web page compiling in another PR when the content is ready * Update code-samples/eventing/bookstore-sample-app/slack-sink/README.md Co-authored-by: Calum Murray * Make the yaml file consistent with the one in the README file --------- Co-authored-by: Calum Murray --- .../bookstore-sample-app/slack-sink/README.md | 181 ++++++++++++++++++ .../slack-sink/slack-sink-camel-pipe.yaml | 20 ++ 2 files changed, 201 insertions(+) create mode 100644 code-samples/eventing/bookstore-sample-app/slack-sink/README.md create mode 100644 code-samples/eventing/bookstore-sample-app/slack-sink/slack-sink-camel-pipe.yaml diff --git a/code-samples/eventing/bookstore-sample-app/slack-sink/README.md b/code-samples/eventing/bookstore-sample-app/slack-sink/README.md new file mode 100644 index 0000000000..737e6cf59c --- /dev/null +++ b/code-samples/eventing/bookstore-sample-app/slack-sink/README.md @@ -0,0 +1,181 @@ +# Bookstore Notification Service: with Apache Camel K and Knative Eventing + + +As a bookstore owner, you aim to receive instant notifications in a Slack channel whenever a customer submits a new review comment. By leveraging Knative Eventing and Apache Camel K, you can set up an event-driven service that automates these notifications, ensuring you're always informed. +## What Knative features will we learn about? +- Knative's ability to connect with third-party services, such as Slack, through event-driven integration using Apache Camel K. + +## What does the final deliverable look like? +When a CloudEvent with the type `new-review-comment` is sent to the Knative Eventing Broker, it triggers a message to be sent in a designated Slack channel. + +## Install prerequisites + +### Prerequisite 1: Install Camel CLI +Install the Camel K CLI (`kamel`) on your local machine. You can find the installation instructions [here](https://camel.apache.org/camel-k/2.2.x/cli/cli.html). + +**Troubleshot**: If after installation you run `kamel version` and you get an error message, you may need to add the `kamel` binary to your system's PATH. You can do this by moving the `kamel` binary to a directory that is already in your PATH, or by adding the directory where `kamel` is located to your PATH. + +```bash +$ export PATH=$PATH: +``` + + +### Prerequisite 2: Install Apache Camel-Kamelets +Next, install Camel K on your cluster using the Camel K CLI: + +```bash +$ kamel install --registry docker.io --organization --registry-auth-username --registry-auth-password +``` + +Replace the placeholders with your actual Docker registry information. + +If you are using other container registries, you may need to read more [here](https://camel.apache.org/camel-k/2.2.x/installation/registry/registry.html) for the installation. + +You will see this message if the installation is successful: + +``` +OLM is not available in the cluster. Fallback to regular installation. +Camel K installed in namespace default +``` +### Prerequisite 3: Create a Slack App and Generate an Incoming Webhook URL +Follow the instruction here on how to create the slack workspace and generate an incoming webhook URL for your designated channel where notifications will be sent. + +## Implementation +### Step 1: Create the Broker + +This broker is created solely for testing purposes and is intended for temporary use during this part of the tutorial only. + +**Method 1**: Initialize a broker within your Kubernetes cluster using the Knative CLI: + +```bash +$ kn broker create book-review-broker +``` +You will see this message if the broker is created successfully: + +``` +Broker ‘book-review-broker’ successfully created in namespace ‘default’. +``` +**Method 2**: You can create a new YAML file to create the broker: + +*new-knative-broker.yaml* +```yaml +apiVersion: eventing.knative.dev/v1 +kind: Broker +metadata: + name: book-review-broker + namespace: default +``` +After you saved the file, you can apply the configuration to your Kubernetes cluster: + +```bash +$ kubectl apply -f new-knative-broker.yaml +``` +You will see this message if the broker is created successfully: + +``` +broker.eventing.knative.dev/book-review-broker created +``` + + +### Step 2: Configure the Slack Sink + +We use a feature called "Pipe" in Camel K to link event sources and destinations. Specifically, the Pipe connects events from a Broker, our source, to a Slack channel through a Slack sink Kamelet, our destination. This setup automatically sends notifications to Slack whenever new events occur, streamlining the flow of information. + + +1. Create a Slack app and generate an incoming webhook URL for your designated channel where notifications will be sent. Refer to Slack documentation for how to do this. + +2. Prepare the YAML configuration for the Slack sink, which will forward events to your Slack channel: + +*slack-sink.yaml* +```yaml +apiVersion: camel.apache.org/v1 # Specifies the API version of Camel K. +kind: Pipe # This resource type is a Pipe, a custom Camel K resource for defining integration flows. +metadata: + name: bookstore-notification-service # The name of the Pipe, which identifies this particular integration flow. +spec: + source: # Defines the source of events for the Pipe. + ref: + kind: Broker # Specifies the kind of source, in this case, a Knative Eventing Broker. + apiVersion: eventing.knative.dev/v1 # The API version of the Knative Eventing Broker. + name: book-review-broker # The name of the Broker, "book-review-broker" in this case + properties: + type: new-review-comment # A filter that specifies the type of events this Pipe will listen for, here it's listening for events of type "new-review-comment". You have to have this type specified. + sink: # Defines the destination for events processed by this Pipe. + ref: + kind: Kamelet # Specifies that the sink is a Kamelet, a Camel K component for connecting to external services. + apiVersion: camel.apache.org/v1 # The API version for Kamelet. + name: slack-sink # The name of the Kamelet to use as the sink, in this case, a predefined "slack-sink" Kamelet. + properties: + channel: “#bookstore-owner” # The Slack channel where notifications will be sent. + webhookUrl: "https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK" # The Webhook URL provided by Slack for posting messages to a specific channel. + +``` + +Make sure to replace the `webhookUrl` with your actual Slack channel name and webhook URL. + + +3. Apply the configuration to your Kubernetes cluster: + +```bash +$ kubectl apply -f slack-sink.yaml +``` +You will see this message if the configuration is created successfully: + +``` +pipe.camel.apache.org/slack-sink-pipe created +``` +But this process will take a few seconds to complete. You can check the status of the pipe by running the following command: + +```bash +$ kubectl get pipe slack-sink-pipe + +NAME PHASE REPLICAS +slack-sink-pipe Ready 1 +``` + + + +### Step 3: Testing by Triggering Notifications + +To trigger notifications, you'll need to simulate an event that matches the criteria set in your Slack sink configuration. For example, submitting a book review could be an event of type `new-review-comment`. + +Directly sending CloudEvents to a broker using curl from an external machine (like your local computer) is typically **constrained** due to the networking and security configurations of Kubernetes clusters. + +Therefore, you need to create a new pod in your Kubernetes cluster to send a CloudEvent to the broker. You can use the following command to create a new pod: + +```bash +$ kubectl run curler --image=radial/busyboxplus:curl -it --restart=Never +``` +You will see this message if you successfully entered the pod's shell + +``` +If you don't see a command prompt, try pressing enter. +[root@curler:/]$ +``` + + +Using curl command to send a CloudEvent to the broker: +```bash +[root@curler:/]$ curl -v "" \ +-X POST \ +-H "Ce-Id: review1" \ +-H "Ce-Specversion: 1.0" \ +-H "Ce-Type: new-review-comment" \ +-H "Ce-Source: bookstore-web-app" \ +-H "Content-Type: application/json" \ +-d 'Hello from Knative!' +``` + +You can find the URI to your broker by running the following command: + +```bash +$ kubectl get broker book-review-broker + +NAME URL AGE READY REASON +book-review-broker http://broker-ingress.knative-eventing.svc.cluster.local/default/book-review-broker 5m37s True +``` + +Wait a few seconds, and you should see a notification in your Slack channel. Congratulations! You have successfully set up the notification service for your bookstore. +## Conclusion + +In this tutorial, you learned how to set up an event-driven service that automates notifications to a Slack channel using Knative Eventing and Apache Camel K. By leveraging these technologies, you can easily connect your applications to third-party services, and pass information between them in real-time. diff --git a/code-samples/eventing/bookstore-sample-app/slack-sink/slack-sink-camel-pipe.yaml b/code-samples/eventing/bookstore-sample-app/slack-sink/slack-sink-camel-pipe.yaml new file mode 100644 index 0000000000..11d3315642 --- /dev/null +++ b/code-samples/eventing/bookstore-sample-app/slack-sink/slack-sink-camel-pipe.yaml @@ -0,0 +1,20 @@ +apiVersion: camel.apache.org/v1 # Specifies the API version of Camel K. +kind: Pipe # This resource type is a Pipe, a custom Camel K resource for defining integration flows. +metadata: + name: bookstore-notification-service # The name of the Pipe, which identifies this particular integration flow. +spec: + source: # Defines the source of events for the Pipe. + ref: + kind: Broker # Specifies the kind of source, in this case, a Knative Eventing Broker. + apiVersion: eventing.knative.dev/v1 # The API version of the Knative Eventing Broker. + name: book-review-broker # The name of the Broker, "book-review-broker" in this case + properties: + type: new-review-comment # A filter that specifies the type of events this Pipe will listen for, here it's listening for events of type "new-review-comment". You have to have this type specified. + sink: # Defines the destination for events processed by this Pipe. + ref: + kind: Kamelet # Specifies that the sink is a Kamelet, a Camel K component for connecting to external services. + apiVersion: camel.apache.org/v1 # The API version for Kamelet. + name: slack-sink # The name of the Kamelet to use as the sink, in this case, a predefined "slack-sink" Kamelet. + properties: + channel: “#bookstore-owner” # The Slack channel where notifications will be sent. + webhookUrl: "https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK" # The Webhook URL provided by Slack for posting messages to a specific channel. \ No newline at end of file