.Net Core 3.1, RabbitMq, MediatR, Keda
A simple docker container that will receive messages from a RabbitMQ queue and scale via KEDA. The reciever will receive a single message at a time (per instance), and sleep for 1 second to simulate performing work. When adding a massive amount of queue messages, KEDA will drive the container to scale out according to the event source (RabbitMQ).
More about Event driven scaling : Keda
- .Net Core
- .Net Core >= 3.1
- Helm
- Kubernetes cluster
This setup will go through creating a RabbitMQ queue on the cluster and deploying this consumer with the ScaledObject
to scale via KEDA. If you already have RabbitMQ you can use your existing queues.
First you should clone the project:
git clone https://github.com/ozanerdogan90/KedaWithRabbitMQSample.git
cd KedaWithRabbitMQSample
cd deploy
run rabbitmq-install.sh
kubectl get po
NAME READY STATUS RESTARTS AGE
rabbitmq-0 1/1 Running 0 3m3s
cd deploy
run keda-install.sh
cd deploy
run run.sh
hey -n 500 -c 500 -m POST -T "application/json" -H "Content-Type: application/json" "http://localhost:5000/orders" -d ""
this will create 500 items in RabbitMq
kubectl get deploy -w