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

Commit c3f0bbf

Browse files
author
odacremolbap
committed
solve conflicts
2 parents 261e53a + c622e46 commit c3f0bbf

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,26 @@ Development version can be installed using [ko](https://github.com/ko-build/ko)
3030
ko apply -f ./config
3131
```
3232

33+
### Namespaced installation
34+
35+
TriggerMesh Core controller can be configured to work with a single namespace set at the `WORKING_NAMESPACE` environment variable, which can be added editing the deployment manifest.
36+
37+
```yaml
38+
- name: WORKING_NAMESPACE
39+
value: my-namespace
40+
```
41+
42+
When working with a single namespace, all `ClusterRoleBindings` should also be modified adding the namespace to limit the scope of the granted permissions.
43+
44+
```yaml
45+
apiVersion: rbac.authorization.k8s.io/v1
46+
kind: ClusterRoleBinding
47+
metadata:
48+
name: triggermesh-core-controller
49+
namespace: working
50+
...
51+
```
52+
3353
## Concepts
3454

3555
TriggerMesh core contains Kubernetes objects for Brokers and Triggers:

cmd/core-controller/main.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
package main
55

66
import (
7+
"os"
8+
9+
injection "knative.dev/pkg/injection"
710
"knative.dev/pkg/injection/sharedmain"
11+
"knative.dev/pkg/signals"
812

913
"github.com/triggermesh/triggermesh-core/pkg/reconciler/memorybroker"
1014
"github.com/triggermesh/triggermesh-core/pkg/reconciler/redisbroker"
@@ -13,7 +17,18 @@ import (
1317
)
1418

1519
func main() {
16-
sharedmain.Main("core-controller",
20+
21+
ctx := signals.NewContext()
22+
23+
// There is only one configuration item for the TriggerMesh Core controller.
24+
// Instead of creating a structure and a formal configuration retrieval
25+
// from environment, we use this very simplistic approach
26+
ns := os.Getenv("WORKING_NAMESPACE")
27+
if len(ns) != 0 {
28+
ctx = injection.WithNamespaceScope(ctx, ns)
29+
}
30+
31+
sharedmain.MainWithContext(ctx, "core-controller",
1732
memorybroker.NewController,
1833
redisbroker.NewController,
1934
trigger.NewController,

docs/redis-broker.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ spec:
4040
tlsEnabled: <boolean that indicates if the Redis server is TLS protected. Optional, defaults to false>
4141
tlsSkipVerify: <boolean that skips verifying TLS certificates. Optional, defaults to false>
4242
stream: <Redis stream name. Optional, defaults to a combination of namespace and broker name>
43-
streamMaxLen: <maximum number of items the Redis stream can host. Optional, defaults to unlimited>
43+
streamMaxLen: <maximum number of items the Redis stream can host. Optional, defaults to 1000. Set to 0 for unlimited>
4444
enableTrackingID: <boolean that indicates if the Redis ID should be written as the CloudEvent attribute triggermeshbackendid>
4545
broker:
4646
port: <HTTP port for ingesting events>
@@ -52,7 +52,7 @@ The `RedisBroker` specific parameters are:
5252

5353
- `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.
5454
- `spec.stream` is the Redis stream name to be used by the broker. If it doesn't exists the Broker will create it.
55-
- `spec.streamMaxLen` is the maximum number of elements that the stream will contain.
55+
- `spec.streamMaxLen` is the maximum number of elements that the stream might contain. Set to 0 for unlimited.
5656
- `spec.enableTrackingID` when set adds the `triggermeshbackendid` CloudEvents attribute containing the Redis ID for the message to all outgoing events.
5757

5858
The `spec.broker` section contains generic Borker parameters:

0 commit comments

Comments
 (0)