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

Commit 77722ff

Browse files
author
odacremolbap
committed
remove 8080 as default port
1 parent 5390c31 commit 77722ff

File tree

5 files changed

+91
-11
lines changed

5 files changed

+91
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ The Trigger created above filters by CloudEvents containing `type: demo.type1` a
7171
Using the `curl` Pod again we can send this CloudEvent to the broker.
7272

7373
```console
74-
kubectl exec -ti curl -- curl -v http://demo-rb-broker.default.svc.cluster.local:8080/ \
74+
kubectl exec -ti curl -- curl -v http://demo-rb-broker.default.svc.cluster.local/ \
7575
-X POST \
7676
-H "Ce-Id: 1234-abcd" \
7777
-H "Ce-Specversion: 1.0" \

docs/getting-started/display-deadlettersink.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ spec:
2929
app: display-deadlettersink
3030
ports:
3131
- protocol: TCP
32-
port: 8080
32+
port: 80
3333
targetPort: 8080
3434

docs/getting-started/display-target.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ spec:
2929
app: display-target
3030
ports:
3131
- protocol: TCP
32-
port: 8080
32+
port: 80
3333
targetPort: 8080
3434

docs/usage.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Usage
2+
3+
This is a TODO doc page containing examples.
4+
5+
## RedisBroker
6+
7+
```yaml
8+
apiVersion: eventing.triggermesh.io/v1alpha1
9+
kind: RedisBroker
10+
metadata:
11+
name: mybroker
12+
```
13+
14+
## RedisBroker using external Redis
15+
16+
```console
17+
kubectl create secret generic redis-creds \
18+
--from-literal=username=user1 \
19+
--from-literal=password=password1
20+
```
21+
22+
```yaml
23+
apiVersion: eventing.triggermesh.io/v1alpha1
24+
kind: RedisBroker
25+
metadata:
26+
name: mybroker-external
27+
spec:
28+
redis:
29+
connection:
30+
url: testme.com:9876
31+
username:
32+
secretKeyRef:
33+
name: redis-creds
34+
key: username
35+
password:
36+
secretKeyRef:
37+
name: redis-creds
38+
key: password
39+
stream: mybroker-stream
40+
streamMaxLen: 1000
41+
broker:
42+
# port defaults to 80
43+
port: 1080
44+
```
45+
46+
47+
## Triggers
48+
49+
```yaml
50+
apiVersion: eventing.triggermesh.io/v1alpha1
51+
kind: Trigger
52+
metadata:
53+
name: my-trigger
54+
spec:
55+
broker:
56+
kind: RedisBroker
57+
group: eventing.triggermesh.io
58+
name: my-broker
59+
filters:
60+
- any:
61+
- exact:
62+
type: my.type1
63+
- exact:
64+
type: my.type2
65+
target:
66+
ref:
67+
apiVersion: serving.knative.dev/v1
68+
kind: Service
69+
name: eventdisplay
70+
delivery:
71+
retry: 3
72+
backoffPolicy: linear
73+
backoffDelay: PT5S
74+
deadLetterSink:
75+
apiVersion: serving.knative.dev/v1
76+
kind: Service
77+
name: eventdisplay-dls
78+
```
79+
80+
- **spec.broker** needs to be informed the broker instance to subscribe to. It can use either `group, kind, name` or `apiVersion, kind, name`.
81+
- **spec.filters** (optional) contains a dialect (or a hierarchy of them) that will be evaulated against all CloudEvents flowing through the broker, trying to send to the target only those that pass the filter.
82+
- **spec.target** needs to be informed either a reference to a Kubernetes object or a URI.
83+
- **delivery.retry** (optional) minimum number of retries for delivering each message.
84+
- **delivery.backoffPolicy** retries policy, can be linear or exponential.
85+
- **delivery.backoffDelay** delay before retries using [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) duration format.
86+
- **delivery.deadLetterSink** (optional) points to a Kubernetes object or URI to send not delivered messages.
87+
88+
When using Kubernetes objects for a target or DLS destination the `triggermesh-core` controller must have permissions to `get, list, watch` those objects, which is usually done by creating a ClusterRole for that contains the `duck.knative.dev/addressable: "true"` label.

pkg/reconciler/trigger/reconciler.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ func (r *Reconciler) resolveTarget(ctx context.Context, t *eventingv1alpha1.Trig
8181
"Failed to get target's URI: %w", err)
8282
}
8383

84-
if targetURI.URL().Port() == "" {
85-
targetURI.Host = targetURI.Host + ":8080"
86-
}
87-
8884
t.Status.TargetURI = targetURI
8985
t.Status.MarkTargetResolvedSucceeded()
9086

@@ -113,10 +109,6 @@ func (r *Reconciler) resolveDLS(ctx context.Context, t *eventingv1alpha1.Trigger
113109
"Failed to get dead letter sink's URI: %w", err)
114110
}
115111

116-
if dlsURI.URL().Port() == "" {
117-
dlsURI.Host = dlsURI.Host + ":8080"
118-
}
119-
120112
t.Status.DeadLetterSinkURI = dlsURI
121113
t.Status.MarkDeadLetterSinkResolvedSucceeded()
122114

0 commit comments

Comments
 (0)