Cloud Native Runtimes 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:
Before you can use or test RabbitMQ eventing on Cloud Native Runtimes, you need to install the following products on your Kubernetes cluster:
The RabbitMQ Cluster Kubernetes Operator (cluster Operator) automates the lifecycle, creation, upgrade, and shutdown, of RabbitMQ clusters on Kubernetes:
To install the cluster Operator:
Create the rabbitmq-system
namespace on your Kubernetes cluster where Cloud Native Runtimes is installed:
kubectl create namespace rabbitmq-system
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
Install the RabbitMQ Cluster Kubernetes Operator v1.8.2 on your Kubernetes cluster where Cloud Native Runtimes is installed:
kubectl apply -f https://github.com/rabbitmq/cluster-operator/releases/download/v1.8.2/cluster-operator.yml
For general information about the RabbitMQ Cluster Kubernetes Operator, see rabbitmq/cluster-operator in GitHub.
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.5.3 installedmessaging-topology-operator.yaml
: Use if you want to generate and include your own certificatesTo install the topology Operator:
Read the README.md for the topology Operator in GitHub and decide which YAML to install.
If you are installing the messaging-topology-operator-with-certmanager.yaml
, then:
Create the cert-manager namespace on your Kubernetes cluster where Cloud Native Runtimes is installed:
kubectl create namespace cert-manager
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
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
Install the RabbitMQ Messaging Topology Operator v1.2.1 on your Kubernetes cluster where Cloud Native Runtimes is installed.
For general information about the topology Operator v1.2.1, see the RabbitMQ Messaging Topology Operator v1.2.1 Release Notes in GitHub.
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.