https://github.com/rguske/openshift-serverless-eventing
Demoing OpenShift Serverless/Knative Eventing power
https://github.com/rguske/openshift-serverless-eventing
Last synced: about 1 month ago
JSON representation
Demoing OpenShift Serverless/Knative Eventing power
- Host: GitHub
- URL: https://github.com/rguske/openshift-serverless-eventing
- Owner: rguske
- Created: 2024-12-15T09:03:08.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-03-14T10:10:44.000Z (2 months ago)
- Last Synced: 2025-03-14T11:24:14.315Z (2 months ago)
- Language: Python
- Size: 196 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Red Hat OpenShift Serverless Demo
⚠️ WIP
This repository is intent to provide information on Red Hat's OpenShift Serverless (Knative Serving) capabilities.
Demoing Red Hat's OpenShift Serverless/Knative Eventing power.
## Eventing
Knative Eventing uses standard HTTP POST requests to send and receive events between event producers and sinks. These events conform to the CloudEvents specifications, which enables creating, parsing, sending, and receiving events in any programming language.
### InMemoryChannel Broker
In order to send events from a system (source) to a sink, you need a component which does it for you. This is a [Broker](https://docs.redhat.com/en/documentation/red_hat_openshift_serverless/1.34/html/eventing/brokers#serverless-brokers).

For testing and lab purposes, Knative provides the `InMemoryChannel` broker. Other types of brokers are available too. Like Kafka or RabbitMQ for example. These kind of brokers should be used for production since they are providing e.g. event delivery guarantees.
Creating the `InMemoryChannel` broker:
`kn broker create inmem-broker`
Alternatively:
```shell
oc apply -f - < EventMode controls the format of the event. Set to Reference to send a dataref event type for the resource being watched. Only a reference to the resource is included in the event payload. Set to Resource to have the full resource lifecycle event in the payload. Defaults to Reference.[Source: ApiServerSource reference](https://knative.dev/docs/eventing/sources/apiserversource/reference/#apiserversource)
```shell
kn source apiserver create api-server-source \
--sink broker:inmem-broker \
--resource "event:v1" \
--service-account events-sa \
--mode Resource
```Alternatively:
```yaml
oc create -f - < Broker --> Trigger --> Sink
Kubernetes --> InMemoryChannel Broker --> Trigger --> SockeyeCreate `trigger`s for the two event-display apps:
`kn trigger create trigger-event-display --broker inmem-broker --sink ksvc:event-display`
`kn trigger create trigger-sockeye --broker inmem-broker --sink ksvc:sockeye`
```shell
kn trigger list
NAME BROKER SINK AGE CONDITIONS READY REASON
trigger-event-display inmem-broker ksvc:event-display 26s 7 OK / 7 True
trigger-sockeye inmem-broker ksvc:sockeye 17s 7 OK / 7 True
```In `yaml`:
```yaml
oc create -f - <