Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Commit 46d9223

Browse files
author
odacremolbap
committed
brokers doc
1 parent a43cb3b commit 46d9223

File tree

5 files changed

+94
-0
lines changed

5 files changed

+94
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ Devevlopment version might be unstable.
1414
ko apply -f ./config
1515
```
1616

17+
## Concepts
18+
19+
TriggerMesh core contains Kubernetes objects for Brokers and Triggers:
20+
21+
- [RedisBroker](docs/redis-broker.md)
22+
- [MemoryBroker](docs/memory-broker.md)
23+
- [Trigger](docs/trigger.md)
24+
25+
The brokers are used to ingest events and route them to targets. To ingest events, they must conform to the [CloudEvents specification][ce-spec] using the HTTP binding, and must use the HTTP address exposed by the Broker.
26+
27+
Events consumption is done asynchronously by configuring Triggers that reference a Broker object. A Trigger must also include information about the consumer address, either a Kubernetes object or an HTTP address, and optionally can include an event filter.
28+
1729
## Usage
1830

1931
- [Getting Started (Redis Broker)](docs/getting-started-redis.md).
@@ -37,3 +49,4 @@ Additionally, the End User License Agreement included in the [`EULA.pdf`](EULA.p
3749
executables and container images released by TriggerMesh Inc.
3850

3951
[asl2]: https://www.apache.org/licenses/LICENSE-2.0
52+
[ce-spec]: https://github.com/cloudevents/spec

docs/memory-broker.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Memory Broker
2+
3+
## Spec
4+
5+
```yaml
6+
apiVersion: eventing.triggermesh.io/v1alpha1
7+
kind: MemoryBroker
8+
metadata:
9+
name: <broker instance name>
10+
spec:
11+
memory:
12+
bufferSize: <maximum number of events>
13+
broker:
14+
port: <HTTP port for ingesting events>
15+
observability:
16+
valueFromConfigMap: <kubernetes ConfigMap that contains observability configuration>
17+
```
18+
19+
The only `MemoryBroker` specific parameter is `spec.memory.bufferSize` which indicates the availible size of the internal queue that the broker manages. When the maximum number of items is reached, new ingest requests will block and might eventually time out. This parameter is optional and defaults to 10000.
20+
21+
The `spec.broker` section contains generic Borker parameters:
22+
23+
- `spec.broker.port` that the Broker service will be listening at. Optional, defaults to port 80.
24+
- `spec.broker.observability` can be set to the name of a ConfigMap at the same namespace that contains [observability settings](observability.md). This parameter is optional.
25+
26+
## Example
27+
28+
- See [MemoryBroker example](https://github.com/triggermesh/triggermesh-core/blob/main/docs/assets/manifests/getting-started-memory/broker.yaml)
29+
- See [MemoryBroker getting started guide](getting-started-memory.md)

docs/observability.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Broker Observability
2+
3+
TODO

docs/redis-broker.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Redis Broker
2+
3+
## Spec
4+
5+
```yaml
6+
apiVersion: eventing.triggermesh.io/v1alpha1
7+
kind: RedisBroker
8+
metadata:
9+
name: <broker instance name>
10+
spec:
11+
redis:
12+
connection: <Provides a connection to an external Redis instance. Optional>
13+
url: <redis URL. Required>
14+
username: <redis username, referenced using a Kubernetes secret>
15+
secretKeyRef:
16+
name: <Kubernetes secret name>
17+
key: <Kubernetes secret key>
18+
password: <redis password, referenced using a Kubernetes secret>
19+
secretKeyRef:
20+
name: <Kubernetes secret name>
21+
key: <Kubernetes secret key>
22+
tlsEnabled: <boolean that indicates if the Redis server is TLS protected. Optional, defaults to false>
23+
tlsSkipVerify: <boolean that skips verifying TLS certificates. Optional, defaults to false>
24+
stream: <Redis stream name. Optional, defaults to a combination of namespace and broker name>
25+
streamMaxLen: <maximum number of items the Redis stream can host. Optional, defaults to unlimited>
26+
broker:
27+
port: <HTTP port for ingesting events>
28+
observability:
29+
valueFromConfigMap: <kubernetes ConfigMap that contains observability configuration>
30+
```
31+
32+
The only `RedisBroker` specific parameters are:
33+
34+
- `spec.redis.connection`. When not used the broker will spin up a managed Redis Deployment. However for production scenarios that require HA and hardened security it is recommended to provide the connection to a user managed Redis instance.
35+
- `spec.stream` is the Redis stream name to be used by the broker. If it doesn't exists the Broker will create it.
36+
- `spec.streamMaxLen` is the maximum number of elements that the stream will contain.
37+
38+
The `spec.broker` section contains generic Borker parameters:
39+
40+
- `spec.broker.port` that the Broker service will be listening at. Optional, defaults to port 80.
41+
- `spec.broker.observability` can be set to the name of a ConfigMap at the same namespace that contains [observability settings](observability.md). This parameter is optional.
42+
43+
## Example
44+
45+
- See [RedisBroker example](https://github.com/triggermesh/triggermesh-core/blob/main/docs/assets/manifests/getting-started-redis/broker.yaml)
46+
- See [RedisBroker getting started guide](getting-started-redis.md)

docs/trigger.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Trigger
2+
3+
TODO

0 commit comments

Comments
 (0)