Cloud Native Runtimes for Tanzu supports using RabbitMQ as an event source to react to messages sent to a RabbitMQ exchange or as an event broker to distribute events within your app. The integration allows you to create:

  • A RabbitMQ broker: A Knative Eventing broker backed by RabbitMQ. This broker uses RabbitMQ exchanges to store CloudEvents that are then routed from one component to another.
  • A RabbitMQ source: An event source that translates external messages on a RabbitMQ exchange to CloudEvents, which can then be used with Knative Serving or Knative Eventing over HTTP.

About the RabbitMQ Operators

Before you can use or test RabbitMQ eventing on Cloud Native Runtimes, you need to install the following products on your Kubernetes cluster:

Install RabbitMQ Cluster Kubernetes Operator v1.6.0

The RabbitMQ Cluster Kubernetes Operator (cluster Operator) automates the lifecycle, creation, upgrade, and shutdown, of RabbitMQ clusters on Kubernetes:

To install the cluster Operator:

  1. Create the rabbitmq-system namespace on your Kubernetes cluster where Cloud Native Runtimes is installed:

    kubectl create namespace rabbitmq-system
    
  2. Define the following role binding:

    kubectl apply -f - << EOF
    kind: RoleBinding
    apiVersion: rbac.authorization.k8s.io/v1
    metadata:
      name: rabbitmq-cluster-operator-psp
      namespace: rabbitmq-system
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: ClusterRole
      name: cnr-restricted
    subjects:
    - kind: ServiceAccount
      name: rabbitmq-cluster-operator
      namespace: rabbitmq-system
    EOF
    
  3. Install the RabbitMQ Cluster Kubernetes Operator v1.6.0 on your Kubernetes cluster where Cloud Native Runtimes is installed:

    kubectl apply -f https://github.com/rabbitmq/cluster-operator/releases/download/v1.6.0/cluster-operator.yml
    

    For general information about the RabbitMQ Cluster Kubernetes Operator, see rabbitmq/cluster-operator in GitHub.

Install RabbitMQ Messaging Topology Kubernetes Operator v0.8.0

The RabbitMQ Messaging Topology Kubernetes Operator (topology Operator) manages the topologies, or exchange types, of RabbitMQ clusters provisioned by the cluster Operator.

There are two YAMLs for the RabbitMQ Messaging Topology Kubernetes Operator:

  • messaging-topology-operator-with-certmanager.yaml: Requires that you have cert-manager v1.2.0 installed
  • messaging-topology-operator.yaml: Use if you want to generate and include your own certificates

To install the topology Operator:

  1. Read the README.md for the topology Operator in GitHub and decide which YAML to install.

  2. If you are installing the messaging-topology-operator-with-certmanager.yaml, then:

    1. Create the cert-manager namespace on your Kubernetes cluster where Cloud Native Runtimes is installed:

      kubectl create namespace cert-manager
      
    2. Define the following role binding:

      kubectl apply -f - << EOF
      kind: RoleBinding
      apiVersion: rbac.authorization.k8s.io/v1
      metadata:
        name: cert-manager-psp
        namespace: cert-manager
      roleRef:
        apiGroup: rbac.authorization.k8s.io
        kind: ClusterRole
        name: cnr-restricted
      subjects:
      - kind: ServiceAccount
        name: cert-manager
        namespace: cert-manager
      - kind: ServiceAccount
        name: cert-manager-cainjector
        namespace: cert-manager
      - kind: ServiceAccount
        name: cert-manager-webhook
        namespace: cert-manager
      EOF
      
  3. Define the following role binding:

    kubectl apply -f - << EOF
    kind: RoleBinding
    apiVersion: rbac.authorization.k8s.io/v1
    metadata:
      name: rabbitmq-topology-psp
      namespace: rabbitmq-system
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: ClusterRole
      name: cnr-restricted
    subjects:
    - kind: ServiceAccount
      name: messaging-topology-operator
      namespace: rabbitmq-system
    EOF
    
  4. Install the RabbitMQ Messaging Topology Operator v0.8.0 on your Kubernetes cluster where Cloud Native Runtimes is installed.

    For general information about the topology Operator v0.8.0, see the RabbitMQ Messaging Topology Operator v0.8.0 Release Notes in GitHub.

Next Steps

After completing these installations, you can:

  • Verify your Knative Eventing installation using an example RabbitMQ broker. For instructions, see Verify Knative Eventing.

  • Create a broker, producer, and a consumer to use RabbitMQ and Knative Eventing with your own app.

check-circle-line exclamation-circle-line close-line
Scroll to top icon