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

Commit a7684e2

Browse files
author
odacremolbap
committed
use 80 port for exposed broker service
1 parent 22b0612 commit a7684e2

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

docs/getting-started-memory.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Wait until the MemoryBroker is ready. It will inform in its status of the URL wh
2323
kubectl get memorybroker demo
2424

2525
NAME URL AGE READY REASON
26-
demo http://demo-mb-broker.default.svc.cluster.local:8080 10s True
26+
demo http://demo-mb-broker.default.svc.cluster.local 10s True
2727
```
2828

2929
To be able to use the broker we will create a `curl` Pod that allow us to send events inside the Kubernetes cluster.
@@ -35,7 +35,7 @@ kubectl apply -f https://raw.githubusercontent.com/triggermesh/triggermesh-core/
3535
It is possible now to send events to the broker address by issuing curl commands. The response for ingested events must be an `HTTP 200` which means that the broker has received it and will try to deliver them to configured triggers.
3636

3737
```console
38-
kubectl exec -ti curl -- curl -v http://demo-mb-broker.default.svc.cluster.local:8080 \
38+
kubectl exec -ti curl -- curl -v http://demo-mb-broker.default.svc.cluster.local \
3939
-X POST \
4040
-H "Ce-Id: 1234-abcd" \
4141
-H "Ce-Specversion: 1.0" \
@@ -67,7 +67,7 @@ The Trigger created above filters by CloudEvents containing `type: demo.type1` a
6767
Using the `curl` Pod again we can send this CloudEvent to the broker.
6868

6969
```console
70-
kubectl exec -ti curl -- curl -v http://demo-mb-broker.default.svc.cluster.local:8080 \
70+
kubectl exec -ti curl -- curl -v http://demo-mb-broker.default.svc.cluster.local \
7171
-X POST \
7272
-H "Ce-Id: 1234-abcd" \
7373
-H "Ce-Specversion: 1.0" \
@@ -107,7 +107,7 @@ kubectl delete -f https://raw.githubusercontent.com/triggermesh/triggermesh-core
107107
Any event that pass the filter will try to be sent to the target, and upon failing will be delivered to the DLS.
108108

109109
```console
110-
kubectl exec -ti curl -- curl -v http://demo-mb-broker.default.svc.cluster.local:8080 \
110+
kubectl exec -ti curl -- curl -v http://demo-mb-broker.default.svc.cluster.local \
111111
-X POST \
112112
-H "Ce-Id: 1234-abcd" \
113113
-H "Ce-Specversion: 1.0" \

docs/getting-started-redis.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Wait until the RedisBroker is ready. It will inform in its status of the URL whe
2323
kubectl get redisbroker demo
2424

2525
NAME URL AGE READY REASON
26-
demo http://demo-rb-broker.default.svc.cluster.local:8080 10s True
26+
demo http://demo-rb-broker.default.svc.cluster.local 10s True
2727
```
2828

2929
To be able to use the broker we will create a Pod that allow us to send events inside the Kubernetes cluster.
@@ -35,7 +35,7 @@ kubectl apply -f https://raw.githubusercontent.com/triggermesh/triggermesh-core/
3535
It is possible now to send events to the broker address by issuing curl commands. The response for ingested events must be an `HTTP 200` which means that the broker has received it and will try to deliver them to configured triggers.
3636

3737
```console
38-
kubectl exec -ti curl -- curl -v http://demo-rb-broker.default.svc.cluster.local:8080 \
38+
kubectl exec -ti curl -- curl -v http://demo-rb-broker.default.svc.cluster.local \
3939
-X POST \
4040
-H "Ce-Id: 1234-abcd" \
4141
-H "Ce-Specversion: 1.0" \
@@ -67,7 +67,7 @@ The Trigger created above filters by CloudEvents containing `type: demo.type1` a
6767
Using the `curl` Pod again we can send this CloudEvent to the broker.
6868

6969
```console
70-
kubectl exec -ti curl -- curl -v http://demo-rb-broker.default.svc.cluster.local:8080 \
70+
kubectl exec -ti curl -- curl -v http://demo-rb-broker.default.svc.cluster.local \
7171
-X POST \
7272
-H "Ce-Id: 1234-abcd" \
7373
-H "Ce-Specversion: 1.0" \
@@ -107,7 +107,7 @@ kubectl delete -f https://raw.githubusercontent.com/triggermesh/triggermesh-core
107107
Any event that pass the filter will try to be sent to the target, and upon failing will be delivered to the DLS.
108108

109109
```console
110-
kubectl exec -ti curl -- curl -v http://demo-rb-broker.default.svc.cluster.local:8080 \
110+
kubectl exec -ti curl -- curl -v http://demo-rb-broker.default.svc.cluster.local \
111111
-X POST \
112112
-H "Ce-Id: 1234-abcd" \
113113
-H "Ce-Specversion: 1.0" \

docs/observable-broker.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Wait until the RedisBroker is ready. It will inform in its status of the URL whe
3131
kubectl get redisbroker metrics-demo
3232

3333
NAME URL AGE READY REASON
34-
demo http://metrics-demo-rb-broker.default.svc.cluster.local:8080 10s True
34+
demo http://metrics-demo-rb-broker.default.svc.cluster.local 10s True
3535
```
3636

3737
Prometheus can be easily installed following one of this methods:
@@ -92,7 +92,7 @@ kubectl apply -f https://raw.githubusercontent.com/triggermesh/triggermesh-core/
9292
It is possible now to send events to the broker address by issuing curl commands. The response for ingested events must be an `HTTP 200` which means that the broker has received it and will try to deliver them to configured triggers.
9393

9494
```console
95-
kubectl exec -ti curl -- curl -v http://metrics-demo-rb-broker.default.svc.cluster.local:8080 \
95+
kubectl exec -ti curl -- curl -v http://metrics-demo-rb-broker.default.svc.cluster.local \
9696
-X POST \
9797
-H "Ce-Id: 1234-abcd" \
9898
-H "Ce-Specversion: 1.0" \

pkg/reconciler/common/reconcile_broker.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ const (
2828
brokerResourceSuffix = "broker"
2929
brokerDeploymentComponentLabel = "broker-deployment"
3030

31-
// ports must be >1024 to be able to bind them
31+
// container ports must be >1024 to be able to bind them
3232
// in unprivileged environments.
33-
defaultBrokerServicePort = 8080
33+
brokerContainerPort = 8080
34+
35+
defaultBrokerServicePort = 80
3436
metricsServicePort = 9090
3537
)
3638

@@ -91,13 +93,13 @@ func buildBrokerDeployment(rb eventingv1alpha1.ReconcilableBroker, sa *corev1.Se
9193

9294
copts := []resources.ContainerOption{
9395
resources.ContainerAddArgs("start"),
94-
resources.ContainerAddEnvFromValue("PORT", strconv.Itoa(int(defaultBrokerServicePort))),
96+
resources.ContainerAddEnvFromValue("PORT", strconv.Itoa(int(brokerContainerPort))),
9597
resources.ContainerAddEnvFromValue("BROKER_NAME", name),
9698
resources.ContainerAddEnvFromFieldRef("KUBERNETES_NAMESPACE", "metadata.namespace"),
9799
resources.ContainerAddEnvFromValue("KUBERNETES_BROKER_CONFIG_SECRET_NAME", secret.Name),
98100
resources.ContainerAddEnvFromValue("KUBERNETES_BROKER_CONFIG_SECRET_KEY", ConfigSecretKey),
99101
resources.ContainerWithImagePullPolicy(pullPolicy),
100-
resources.ContainerAddPort("httpce", defaultBrokerServicePort),
102+
resources.ContainerAddPort("httpce", brokerContainerPort),
101103
resources.ContainerAddPort("metrics", metricsServicePort),
102104
}
103105

@@ -214,7 +216,7 @@ func buildBrokerService(rb eventingv1alpha1.ReconcilableBroker) *corev1.Service
214216
resources.ServiceSetType(corev1.ServiceTypeClusterIP),
215217
resources.ServiceAddSelectorLabel(resources.AppComponentLabel, brokerDeploymentComponentLabel),
216218
resources.ServiceAddSelectorLabel(resources.AppInstanceLabel, sn),
217-
resources.ServiceAddPort("httpce", int32(brokerPort), defaultBrokerServicePort))
219+
resources.ServiceAddPort("httpce", int32(brokerPort), brokerContainerPort))
218220
}
219221

220222
func (r *brokerReconciler) reconcileService(ctx context.Context, rb eventingv1alpha1.ReconcilableBroker) (*corev1.Service, error) {

0 commit comments

Comments
 (0)