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

Files

Latest commit

author
odacremolbap
May 26, 2023
a7908cd · May 26, 2023

History

History
66 lines (56 loc) · 3.57 KB

redis-broker.md

File metadata and controls

66 lines (56 loc) · 3.57 KB

Redis Broker

The RedisBroker persist every ingested message at a Stream before returning an ACK to the event sender, making it more reliable than the MemoryBroker.

It can be configured with any Redis instance version 6 and up, by providing connection parameters. If a Redis connection is not informed a Redis Deployment will be created by the TriggerMesh Core controller.

Spec

apiVersion: eventing.triggermesh.io/v1alpha1
kind: RedisBroker
metadata:
  name: <broker instance name>
spec:
  redis:
    connection: <Provides a connection to an external Redis instance. Optional>
        url: <redis URL. Required if clusterURLs not informed>
        clusterURLs:
        - <an entry for each redis URL in the cluster. Required if url not informed>
        username: <redis username, referenced using a Kubernetes secret>
          secretKeyRef:
            name: <Kubernetes secret name>
            key: <Kubernetes secret key>
        password: <redis password, referenced using a Kubernetes secret>
          secretKeyRef:
            name: <Kubernetes secret name>
            key: <Kubernetes secret key>
        tlsCACertificate: <CA certificate used to connect to redis. Optional>
          secretKeyRef:
            name: <Kubernetes secret name>
            key: <Kubernetes secret key>
        tlsCertificate: <Certificate used to authenticate to redis. Optional>
          secretKeyRef:
            name: <Kubernetes secret name>
            key: <Kubernetes secret key>
        tlsKey: <Certificate key used to authenticate to redis. Optional>
          secretKeyRef:
            name: <Kubernetes secret name>
            key: <Kubernetes secret key>
        tlsEnabled: <boolean that indicates if the Redis server is TLS protected. Optional, defaults to false>
        tlsSkipVerify: <boolean that skips verifying TLS certificates. Optional, defaults to false>
    stream: <Redis stream name. Optional, defaults to a combination of namespace and broker name>
    streamMaxLen: <maximum number of items the Redis stream can host. Optional, defaults to 1000. Set to 0 for unlimited>
    enableTrackingID: <boolean that indicates if the Redis ID should be written as the CloudEvent attribute triggermeshbackendid>
  broker:
    port: <HTTP port for ingesting events>
    observability:
      valueFromConfigMap: <kubernetes ConfigMap that contains observability configuration>

The RedisBroker specific parameters are:

  • spec.redis.connection. When not used the broker will spin up a managed Redis Deployment. However for production scenarios that require HA and hardened security it is recommended to provide the connection to a user managed Redis instance.
  • spec.stream is the Redis stream name to be used by the broker. If it doesn't exists the Broker will create it.
  • spec.streamMaxLen is the maximum number of elements that the stream might contain. Set to 0 for unlimited.
  • spec.enableTrackingID when set adds the triggermeshbackendid CloudEvents attribute containing the Redis ID for the message to all outgoing events.

The spec.broker section contains generic Borker parameters:

  • spec.broker.port that the Broker service will be listening at. Optional, defaults to port 80.
  • spec.broker.observability can be set to the name of a ConfigMap at the same namespace that contains observability settings. This parameter is optional.

Example