Skip to content

Openshift Serverless Eventing

Hemanth B edited this page Jan 4, 2025 · 3 revisions

Examples of Openshift Serverless Evening for Event Sources, Brokers, Triggers, Channels, Subscriptions

Here are some examples of OpenShift Serverless Evening for Event Sources, Brokers, Triggers, Channels, and Subscriptions:

Event Sources

API Server Source: Exposes an event source that can receive events from an HTTP API.
Container Source: Watches container logs and sends new log messages as events.
Ping Source: Sends events at a specified interval.
Brokers

In-memory Broker: Stores events in memory.
Kafka Broker: Stores events in a Kafka cluster.

Triggers

Cron Trigger: Triggers events at a specified interval.
Manual Trigger: Triggers events manually.
Kamelet Trigger: Triggers events using Kamelet sources.

Channels

In-memory Channel: Stores events in memory.
Kafka Channel: Stores events in a Kafka cluster.
DNS Channel: Stores events in a DNS service.

Subscriptions

Service Subscription: Subscribes to events and sends them to a Kubernetes service.
URI Subscription: Subscribes to events and sends them to a specified URI.

Here's an example YAML configuration for an event source, broker, trigger, channel, and subscription:

# Event Source
apiVersion: sources.eventing.knative.dev/v1
kind: ApiServerSource
metadata:
  name: test-source
spec:
  serviceAccountName: test-service-account
  mode: Resource
  resources:
  - apiVersion: v1
    kind: Event

# Broker
apiVersion: eventing.knative.dev/v1
kind: Broker
metadata:
  name: default
spec:
  config:
    apiVersion: eventing.knative.dev/v1
    kind: InMemoryChannel

# Trigger
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
  name: test-trigger
spec:
  broker: default
  filter:
    attributes:
      type: dev.knative.sources.ping
  subscriber:
    ref:
      apiVersion: serving.knative.dev/v1
      kind: Service
      name: test-service

# Channel
apiVersion: messaging.knative.dev/v1
kind: InMemoryChannel
metadata:
  name: test-channel

# Subscription
apiVersion: messaging.knative.dev/v1
kind: Subscription
metadata:
  name: test-subscription
spec:
  channel:
    apiVersion: messaging.knative.dev/v1
    kind: InMemoryChannel
    name: test-channel
  subscriber:
    ref:
      apiVersion: serving.knative.dev/v1
      kind: Service
      name: test-service