Skip to content

Commit

Permalink
Apply feedback
Browse files Browse the repository at this point in the history
Signed-off-by: gabriel-farache <[email protected]>
  • Loading branch information
gabriel-farache committed Dec 16, 2024
1 parent 2419fa0 commit 782627f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
19 changes: 11 additions & 8 deletions docs/main/kafka-knative-broker/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Using Knative kafka broker
# Using Knative Kafka broker
If you want to use a Knative broker for communication between the different componenets (Data Index, Job Service and Workflows), you should use a reliable broker, i.e: not in-memory.

Kafka perfectly fullfills this reliability need.
Expand All @@ -9,13 +9,13 @@ Kafka perfectly fullfills this reliability need.

## Installation steps

1. Configure and enable kafka broker feature in Knative: https://knative.dev/docs/eventing/brokers/broker-types/kafka-broker/
1. Configure and enable Kafka broker feature in Knative: https://knative.dev/docs/eventing/brokers/broker-types/kafka-broker/
```console
oc apply --filename https://github.com/knative-extensions/eventing-kafka-broker/releases/download/knative-v1.14.5/eventing-kafka-controller.yaml
oc apply --filename https://github.com/knative-extensions/eventing-kafka-broker/releases/download/knative-v1.14.5/eventing-kafka-broker.yaml
```
> [!NOTE]
> This examples uses`knative-v1.14.5`, this may change, please refer to [the official documentation link](https://knative.dev/docs/eventing/brokers/broker-types/kafka-broker/)
> At the time this document was written, the latest `knative` version was `v1.14.5`. Please refer to [the latest official documentation](https://knative.dev/docs/eventing/brokers/broker-types/kafka-broker/) for more up-to-date instructions for the Kafka broker setup.
* Review the `Security Context Constraints` (`scc`) to be granted to the `knative-kafka-broker-data-plane` service account used by the `kafka-broker-receiver` deployment:
```console
oc get deployments.apps -n knative-eventing kafka-broker-receiver -oyaml | oc adm policy scc-subject-review --filename -
Expand All @@ -41,21 +41,24 @@ oc patch cm kafka-broker-config -n knative-eventing \
oc wait --for condition=ready=true pod -l app=kafka-broker-receiver -n knative-eventing --timeout=60s
```

2. Create kafka broker (Knative `sink`): see https://docs.openshift.com/serverless/1.33/eventing/brokers/kafka-broker.html for more details:
2. Create Kafka broker (Knative `sink`): see https://docs.openshift.com/serverless/1.35/eventing/brokers/kafka-broker.html for more details:
```Console
BROKER_NAME=kafka-broker # change the name to match your needs
BROKER_NAMESPACE=sonataflow-infra # change to your target namespace
echo "apiVersion: eventing.knative.dev/v1
kind: Broker
metadata:
annotations:
# case-sensitive
eventing.knative.dev/broker.class: Kafka
name: kafka-broker
name: ${BROKER_NAME}
namespace: ${BROKER_NAMESPACE}
spec:
# Configuration specific to this broker.
config:
apiVersion: v1
kind: ConfigMap
name: kafka-broker-config
name: ${BROKER_NAME}-config
namespace: knative-eventing" | oc apply -n sonataflow-infra -f -
```
3. Configure the `sonataflowplatforms.sonataflow.org`: given that the `Orchestrator` is named `orchestrator-sample` and was created under the `orchestrator` namespace:
Expand All @@ -68,8 +71,8 @@ oc -n orchestrator patch orchestrators.rhdh.redhat.com orchestrator-sample --typ
"sonataflowPlatform": {
"eventing": {
"broker": {
"name": "<BROKER NAME>",
"namespace": "<BROKER NAMESPACE>"
"name": "${BROKER_NAME}",
"namespace": "${BROKER_NAMESPACE}"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions helm-charts/orchestrator/templates/sonataflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ spec:
limits:
memory: {{ .Values.orchestrator.sonataflowPlatform.resources.limits.memory }}
cpu: {{ .Values.orchestrator.sonataflowPlatform.resources.limits.cpu }}
{{- if (and (.Values.orchestrator.sonataflowPlatform.broker.name) (.Values.orchestrator.sonataflowPlatform.broker.namespace)) }}
{{- if (and (.Values.orchestrator.sonataflowPlatform.eventing.broker.name) (.Values.orchestrator.sonataflowPlatform.eventing.broker.namespace)) }}
eventing:
broker:
ref:
apiVersion: eventing.knative.dev/v1
kind: Broker
name: {{ .Values.orchestrator.sonataflowPlatform.broker.name }}
namespace: {{ .Values.orchestrator.sonataflowPlatform.broker.namespace }}
name: {{ .Values.orchestrator.sonataflowPlatform.eventing.broker.name }}
namespace: {{ .Values.orchestrator.sonataflowPlatform.eventing.broker.namespace }}
{{- end }}
services:
dataIndex:
Expand Down

0 comments on commit 782627f

Please sign in to comment.