forked from knative/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "drop eventing-rabbitmq (knative#5861)" (knative#5910)
This reverts commit a0d137b.
- Loading branch information
Showing
11 changed files
with
299 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/eventing/brokers/broker-types/channel-based-broker/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
docs/eventing/brokers/broker-types/rabbitmq-broker/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: <rabbitmq-broker-config-name> | ||
spec: | ||
rabbitmqClusterReference: | ||
# Configure name if a RabbitMQ Cluster Operator is being used. | ||
name: <cluster-name> | ||
# Configure connectionSecret if an external RabbitMQ cluster is being used. | ||
connectionSecret: | ||
name: rabbitmq-secret-credentials | ||
queueType: quorum | ||
``` | ||
Where: | ||
|
||
- <rabbitmq-broker-config-name> is the name you want for your RabbitMQBrokerConfig object. | ||
- <cluster-name> 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 <filename> | ||
``` | ||
Where `<filename>` 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: <broker-name> | ||
spec: | ||
config: | ||
apiVersion: eventing.knative.dev/v1alpha1 | ||
kind: RabbitmqBrokerConfig | ||
name: <rabbitmq-broker-config-name> | ||
``` | ||
Where `<rabbitmq-broker-config-name>` is the name you gave your RabbitMQBrokerConfig in the step above. | ||
|
||
1. Apply the YAML file by running the command: | ||
|
||
```bash | ||
kubectl apply -f <filename> | ||
``` | ||
Where `<filename>` 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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: <source-name> | ||
spec: | ||
rabbitmqClusterReference: | ||
# Configure name if a RabbitMQ Cluster Operator is being used. | ||
name: <cluster-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: | ||
|
||
- `<source-name>` is the name you want for your RabbitMQSource object. | ||
- `<cluster-name>` 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 <filename> | ||
``` | ||
Where `<filename>` 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/<source-name> | ||
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 <source-yaml-filename> | ||
``` | ||
|
||
1. Delete the RabbitMQ credentials secret: | ||
|
||
```sh | ||
kubectl delete -f <secret-yaml-filename> | ||
``` | ||
|
||
1. Delete the event display Service: | ||
|
||
```sh | ||
kubectl delete -f <service-yaml-filename> | ||
``` | ||
|
||
## 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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters