This is a demo of how to use KEDA and Kubernetes to scale RabbitMQ consumers based on the number of messages in the queue.
Settings -> Kubernetes -> Enable Kubernetes
```bash
docker run -d --hostname my-rabbit --name some-rabbit -p 5672:5672 -p 15672:15672 rabbitmq:3-management
```
```bash
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' some-rabbit
```
write that ip in the consumer.py file
and the consumer-scaler.yaml file (this should go, for instance, in a config map in the real application)
```bash
kubectl apply --server-side -f https://github.com/kedacore/keda/releases/download/v2.11.0/keda-2.11.0.yaml
```
In Visual Studio Code, right click on the Dockerfile file and select "Build Image"
```bash
kubectl apply -f .\consumer-deployment.yaml
```
```bash
kubectl apply -f .\consumer-scaler.yaml
```
```bash
python .\producer.py
```
```bash
kubectl describe hpa
```